diff --git a/crates/ui-egui/src/ribbon/common.rs b/crates/ui-egui/src/ribbon/common.rs index 43759baac6..89cfd930be 100644 --- a/crates/ui-egui/src/ribbon/common.rs +++ b/crates/ui-egui/src/ribbon/common.rs @@ -3,7 +3,7 @@ use std::ops::RangeInclusive; use craft::keymap::CommandRef; use craft::menu::ribbon::{RibbonGroup, RibbonRow}; use craft::ui::buttons::{Arrangement, Button}; -use craft::ui::contract::{Bind, BodyCx, Gap, Props as _, Show as _, ShowContainer as _, Trigger}; +use craft::ui::contract::{Bind, BodyCx, Gap, Props as _, Show as _, ShowContainer as _, TooltipSpec, Trigger}; use craft::ui::controls::disclosure::DisclosureGlyph; use craft::ui::display::Divider; use craft::ui::layout_components::{Row, Stack}; @@ -18,11 +18,6 @@ use super::{Ui, WordApp, json}; use crate::icons; use crate::undo_marks::apply_edits; -/// Whether the command a menu is about can run now; a menu about no command is always open. -pub(super) fn about_enabled(ctx: &egui::Context, about: &str) -> bool { - about.is_empty() || craft::ui::runtime::commands::resolve(ctx, CommandRef::new(about)).enabled -} - /// The arrow after the label of a ribbon menu button: the small filled triangle of the old ribbon. pub(crate) static MENU_ARROW: DisclosureGlyph = DisclosureGlyph::new(1.0); @@ -30,12 +25,16 @@ pub(crate) static MENU_ARROW: DisclosureGlyph = DisclosureGlyph::new(1.0); /// `face` is the caller's button; `about` is that command's id, `None` for a menu about no command. pub(crate) fn menu_button( ui: &mut Ui, - face: Button<'_>, + mut face: Button<'_>, name: impl Into