Skip to content

Commit

Permalink
Fix Response::context_menu return type (#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
mankinskin authored Nov 1, 2021
1 parent 78dfde4 commit b9368ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions egui/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion egui_demo_lib/src/apps/demo/drag_and_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b9368ab

Please sign in to comment.