Skip to content

Deprecate unused Style::compact_menu_style - #8909

Draft
IG-ABHINAV wants to merge 2 commits into
emilk:mainfrom
IG-ABHINAV:deprecate-compact-menu-style
Draft

IG-ABHINAV wants to merge 2 commits into
emilk:mainfrom
IG-ABHINAV:deprecate-compact-menu-style

Conversation

@IG-ABHINAV

Copy link
Copy Markdown

What & why

The field compact_menu_style on egui::Style is currently unused. It should probably be deprecated and then removed, or should be used to alter the style of menus

The flag stopped having an effect when #8105 removed the old menu module (its set_menu_style was the only reader).

How

  • Mark Style::compact_menu_style #[deprecated(note = "This is now unused and has no effect")], the same way Visuals::clip_rect_margin is handled.
  • Remove its checkbox from Style::ui, since toggling it did nothing.

Verification

  • cargo fmt --all -- --check ✅
  • cargo clippy -p egui --all-features --all-targets -- -D warnings ✅
  • cargo test -p egui --lib: 99 passed ✅
  • cargo check -p egui_demo_lib ✅

Judgment calls

I deprecated the field rather than removing it or wiring it to menu::menu_style. That keeps existing code and serialized styles compiling and loading. Happy to switch to either alternative if you'd prefer.

The field has had no effect since the old menu module was removed in
emilk#8105. Mark it deprecated, like `Visuals::clip_rect_margin`, and drop
its checkbox from the style settings UI.

Fixes emilk#8896
@github-actions

Copy link
Copy Markdown

Preview is being built...

Preview will be available at https://egui-pr-preview.github.io/pr/8909-deprecate-compact-menu-style

View snapshot changes at kitdiff

@emilk emilk added egui style visuals and theming labels Nov 23, 2026
Comment thread crates/egui/src/style.rs Outdated
Comment on lines 346 to 352

/// Use a more compact style for menus.
/// Unused. Kept only for backwards compatibility.
///
/// Used to select a more compact style for menus.
/// Setting it now has no effect.
#[deprecated(note = "This is now unused and has no effect")]
pub compact_menu_style: bool,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets just remove it instead

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

egui style visuals and theming

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Style::compact_menu_style is unused

2 participants