diff --git a/egui/src/response.rs b/egui/src/response.rs index e28efd4c..5c0c54a2 100644 --- a/egui/src/response.rs +++ b/egui/src/response.rs @@ -437,13 +437,12 @@ impl Response { /// Move the scroll to this UI with the specified alignment. /// /// ``` - /// # use egui::Align; /// # egui::__run_test_ui(|ui| { /// egui::ScrollArea::vertical().show(ui, |ui| { /// for i in 0..1000 { - /// let response = ui.button(format!("Button {}", i)); + /// let response = ui.button("Scroll to me"); /// if response.clicked() { - /// response.scroll_to_me(Align::Center); + /// response.scroll_to_me(egui::Align::Center); /// } /// } /// }); @@ -490,6 +489,8 @@ impl Response { /// }); /// # }); /// ``` + /// + /// See also: [`Ui::menu_button`] and [`Ui::close_menu`]. pub fn context_menu(self, add_contents: impl FnOnce(&mut Ui)) -> Self { self.ctx .context_menu_system() diff --git a/egui/src/ui.rs b/egui/src/ui.rs index cbaba6f6..28874ee9 100644 --- a/egui/src/ui.rs +++ b/egui/src/ui.rs @@ -1763,7 +1763,9 @@ impl Ui { result } - /// Close menu (with submenus), if any. + /// Close the menu we are in (including submenus), if any. + /// + /// See also: [`Self::menu_button`] and [`Response::context_menu`]. pub fn close_menu(&mut self) { if let Some(menu_state) = &mut self.menu_state { menu_state.write().close(); @@ -1780,7 +1782,9 @@ impl Ui { } #[inline] - /// Create a menu button. Creates a button for a sub-menu when the `Ui` is inside a menu. + /// Create a menu button that when clicked will show the given menu. + /// + /// If called from within a menu this will instead create a button for a sub-menu. /// /// ``` /// # egui::__run_test_ui(|ui| { @@ -1793,6 +1797,8 @@ impl Ui { /// }); /// # }); /// ``` + /// + /// See also: [`Self::close_menu`] and [`Response::context_menu`]. pub fn menu_button( &mut self, title: impl Into, diff --git a/egui_demo_lib/src/apps/demo/demo_app_windows.rs b/egui_demo_lib/src/apps/demo/demo_app_windows.rs index 437e2278..5db67ebd 100644 --- a/egui_demo_lib/src/apps/demo/demo_app_windows.rs +++ b/egui_demo_lib/src/apps/demo/demo_app_windows.rs @@ -153,7 +153,7 @@ impl DemoWindows { egui::SidePanel::right("egui_demo_panel") .min_width(150.0) - .default_width(190.0) + .default_width(180.0) .show(ctx, |ui| { egui::trace!(ui); ui.vertical_centered(|ui| { diff --git a/egui_demo_lib/src/backend_panel.rs b/egui_demo_lib/src/backend_panel.rs index 170d7081..375a41eb 100644 --- a/egui_demo_lib/src/backend_panel.rs +++ b/egui_demo_lib/src/backend_panel.rs @@ -153,7 +153,6 @@ impl BackendPanel { ui.label( "Everything you see is rendered as textured triangles. There is no DOM and no HTML elements. \ This is the web page, reinvented with game tech."); - ui.label("This is also work in progress, and not ready for production… yet :)"); ui.hyperlink("https://github.com/emilk/egui"); ui.separator();