Skip to content

Keep hovered menu option inside the menu borders - #3543

Open
b84330808 wants to merge 1 commit into
iced-rs:masterfrom
b84330808:fix-menu-highlight-borders
Open

b84330808 wants to merge 1 commit into
iced-rs:masterfrom
b84330808:fix-menu-highlight-borders

Conversation

@b84330808

Copy link
Copy Markdown

Fixes #3534.

The highlight of the hovered option in overlay::menu was only inset horizontally by the border width, so hovering the first or the last option painted over the top or bottom border of the menu. It shows with the default theme too.

The highlight is now clipped to the visible menu area inside its top and bottom borders. Clipping against the viewport (instead of special-casing the first and last options) also covers a scrolled menu, where a partially visible option sits under a border.

I checked it with a small iced_test snapshot (tiny-skia backend, 2px black menu border) that counts the border rows in one pixel column: before, hovering the first, the last, or a half-scrolled option left only one border visible; after, both stay visible in all cases. cargo test -p iced_widget and clippy are clean.

The highlight of the hovered option was only inset horizontally, so hovering the first or last option painted over the top or bottom border of the menu.

Fixes iced-rs#3534.
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.

Menu options eat the top and bottom borders of pick list menu

1 participant