Skip to content

ui: Menu rows highlight on hover, indent the label and span the menu width - #1301

Closed
emirbaki wants to merge 1 commit into
storytold:mainfrom
emirbaki:fix/menu-row-hover-1178
Closed

emirbaki wants to merge 1 commit into
storytold:mainfrom
emirbaki:fix/menu-row-hover-1178

Conversation

@emirbaki

Copy link
Copy Markdown

Closes #1178.

What changed

Button::frame(false) gives a menu row no feedback under the pointer. The same flag drops the frame that carries weak_bg_fill and zeroes style.spacing.button_padding. A row therefore showed no highlight, and its label touched the row edge.

  • menu_row in crates/ui-egui/src/widgets.rs paints the theme hover fill behind a frameless label and restores the indent with a spacer atom.
  • The four menu call sites use the helper: the cell context menu, the header menus, the ribbon dropdowns and the validation picker.
  • The cell context menu and the header menu set one width for the popup and its rows. A narrower row left the highlight short of the menu's right edge.

Measurements

The release build at 1280x800, a pixel scale of 1.25:

Item Value
Row width 250 px (200 logical)
Highlight width 250 px
Gap from the highlight to the popup border 9 px (7 logical), the same on both sides

Tests

crates/ui-egui/tests/context_menu_hover.rs opens the cell context menu, hovers a row and checks that the row paints the hover fill. A second test checks that the highlight clears when the pointer leaves.

Gates: fmt, clippy -D warnings, the ui-egui suite, assets, layers, wasm.

🤖 Generated with Claude Code

…width (storytold#1178)

A frameless button gives a menu row no feedback under the pointer. The same flag drops the
frame that carries `weak_bg_fill` and zeroes `style.spacing.button_padding`. The new
`menu_row` helper paints the theme hover fill behind the label and restores the indent with
a spacer atom.

The cell context menu and the header menu now set one width for the popup and its rows. A
narrower row left the highlight short of the menu's right edge.

Fixes storytold#1178

Co-Authored-By: Claude Code <noreply@anthropic.com>
@aiongg

aiongg commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Superseded by #1180, merged in #2226.

@aiongg aiongg closed this Oct 22, 2026
@emirbaki
emirbaki deleted the fix/menu-row-hover-1178 branch October 22, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] [GridCraft] Hover on the context menu

2 participants