mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Fix Response::context_menu return type (#857)
This commit is contained in:
@@ -487,8 +487,8 @@ impl Response {
|
|||||||
/// }
|
/// }
|
||||||
/// });
|
/// });
|
||||||
/// ```
|
/// ```
|
||||||
pub fn context_menu(&self, add_contents: impl FnOnce(&mut Ui)) -> &Self {
|
pub fn context_menu(self, add_contents: impl FnOnce(&mut Ui)) -> Self {
|
||||||
self.ctx.show_context_menu(self, add_contents);
|
self.ctx.show_context_menu(&self, add_contents);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ impl super::View for DragAndDropDemo {
|
|||||||
})
|
})
|
||||||
.response;
|
.response;
|
||||||
|
|
||||||
response.context_menu(|ui| {
|
let response = response.context_menu(|ui| {
|
||||||
if ui.button("New Item").clicked() {
|
if ui.button("New Item").clicked() {
|
||||||
self.columns[col_idx].push("New Item".to_string());
|
self.columns[col_idx].push("New Item".to_string());
|
||||||
ui.close_menu();
|
ui.close_menu();
|
||||||
|
|||||||
Reference in New Issue
Block a user