FlatLaf icon indicating copy to clipboard operation
FlatLaf copied to clipboard

Menus: rounded selection

Open DevCharly opened this issue 2 years ago • 1 comments

This PR enables using "rounded" selection for menu items. It also enables using different selection colors for top-level JMenus.

This is not yet used in any theme, but intended to be used for macOS themes (see PR #533) and future Windows 11 style themes.

Perhaps this should also be used for existing themes to make menus look more beautiful. Any opinions?

Example

(left image shows rounded selection; right image shows default look)

image image

UI properties for above screenshot (see Application properties files):

# make menu item margins larger (default is 3,6,3,6)
@menuItemMargin = 3,9,3,9

MenuBar.selectionBackground = darken(@menuBackground,15%,derived)
MenuBar.selectionForeground = @foreground

MenuBar.selectionInsets = 1,0,1,0
MenuBar.selectionEmbeddedInsets = 3,0,3,0

MenuItem.selectionInsets = 0,3,0,3
MenuItem.selectionArc = 8

DevCharly avatar May 15 '22 15:05 DevCharly

Perhaps this should also be used for existing themes to make menus look more beautiful. Any opinions?

Awesome work, looks great to my eyes, even with non-macOS / non-Win11 UIs. But I am not a UI / UX expert :-)

j-dimension avatar May 15 '22 20:05 j-dimension