Improve deprecation message for old `egui::menu`

This commit is contained in:
Emil Ernerfeldt 2025-06-07 10:24:28 -07:00
parent 6e34152fa0
commit 209e818bd8
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#![allow(deprecated)] #![allow(deprecated)]
//! Menu bar functionality (very basic so far). //! Deprecated menu API - Use [`crate::containers::menu`] instead.
//! //!
//! Usage: //! Usage:
//! ``` //! ```
@ -88,6 +88,7 @@ fn set_menu_style(style: &mut Style) {
/// The menu bar goes well in a [`crate::TopBottomPanel::top`], /// The menu bar goes well in a [`crate::TopBottomPanel::top`],
/// but can also be placed in a [`crate::Window`]. /// but can also be placed in a [`crate::Window`].
/// In the latter case you may want to wrap it in [`Frame`]. /// In the latter case you may want to wrap it in [`Frame`].
#[deprecated = "Use `crate::containers::menu::Bar` instead"]
pub fn bar<R>(ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> { pub fn bar<R>(ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {
ui.horizontal(|ui| { ui.horizontal(|ui| {
set_menu_style(ui.style_mut()); set_menu_style(ui.style_mut());