1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

Use AtomLayoutResponse in TextEditOutput (#8003)

This is necessary to add e.g. buttons as prefix/suffix within the
textedit (so you can read the rect and place the button).

I'm not sure if deref on the AtomLayoutResponse is the right call but it
should make the migration easier and is generally convenient (but might
lead to some confusion).
This commit is contained in:
Lucas Meurer
2026-03-24 11:04:36 +01:00
committed by GitHub
parent 91effb9e57
commit c0ea6117e0
3 changed files with 18 additions and 5 deletions

View File

@@ -520,6 +520,20 @@ impl AtomLayoutResponse {
}
}
impl Deref for AtomLayoutResponse {
type Target = Response;
fn deref(&self) -> &Self::Target {
&self.response
}
}
impl DerefMut for AtomLayoutResponse {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.response
}
}
impl Widget for AtomLayout<'_> {
fn ui(self, ui: &mut Ui) -> Response {
self.show(ui).response