1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-27 23:13:13 -04:00

Fix Response::context_menu return type (#857)

This commit is contained in:
Linus Behrbohm
2021-11-01 19:27:51 +01:00
committed by GitHub
parent 78dfde40b2
commit b9368aba13
2 changed files with 3 additions and 3 deletions

View File

@@ -487,8 +487,8 @@ impl Response {
/// }
/// });
/// ```
pub fn context_menu(&self, add_contents: impl FnOnce(&mut Ui)) -> &Self {
self.ctx.show_context_menu(self, add_contents);
pub fn context_menu(self, add_contents: impl FnOnce(&mut Ui)) -> Self {
self.ctx.show_context_menu(&self, add_contents);
self
}
}

View File

@@ -145,7 +145,7 @@ impl super::View for DragAndDropDemo {
})
.response;
response.context_menu(|ui| {
let response = response.context_menu(|ui| {
if ui.button("New Item").clicked() {
self.columns[col_idx].push("New Item".to_string());
ui.close_menu();