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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user