- use derived colors for menu bar hover
- use derived colors for menu item selected background
- top-level JMenu now uses foreground color from parent JMenuBar

This allows changing menu bar background to dark with:
  UIManager.put( "MenuBar.background", Color.DARK_GRAY );
  UIManager.put( "MenuBar.foreground", Color.WHITE );
or
  menuBar.setBackground( Color.DARK_GRAY );
  menuBar.setForeground( Color.WHITE );

(issue #117)
This commit is contained in:
Karl Tauber
2020-06-25 11:36:36 +02:00
parent c25ff57b61
commit 46d3204bc3
8 changed files with 57 additions and 20 deletions

View File

@@ -515,7 +515,7 @@ MenuBar.borderColor #515151 javax.swing.plaf.ColorUIResource [UI]
MenuBar.font [active] $defaultFont [UI]
MenuBar.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
MenuBar.highlight #242424 javax.swing.plaf.ColorUIResource [UI]
MenuBar.hoverBackground #484c4f javax.swing.plaf.ColorUIResource [UI]
MenuBar.hoverBackground #484c4f com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse)
MenuBar.itemMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI]
MenuBar.shadow #646464 javax.swing.plaf.ColorUIResource [UI]
MenuBar.windowBindings length=2 [Ljava.lang.Object;
@@ -535,7 +535,7 @@ MenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenu
MenuItem.background #303234 javax.swing.plaf.ColorUIResource [UI]
MenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI]
MenuItem.borderPainted true
MenuItem.checkBackground #484c4f javax.swing.plaf.ColorUIResource [UI]
MenuItem.checkBackground #484c4f com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse)
MenuItem.checkMargins 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI]
MenuItem.disabledForeground #777777 javax.swing.plaf.ColorUIResource [UI]
MenuItem.font [active] $defaultFont [UI]
@@ -549,8 +549,8 @@ MenuItem.selectionBackground #4b6eaf javax.swing.plaf.ColorUIResource [UI]
MenuItem.selectionForeground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
MenuItem.textAcceleratorGap 24
MenuItem.textNoAcceleratorGap 6
MenuItem.underlineSelectionBackground #484c4f javax.swing.plaf.ColorUIResource [UI]
MenuItem.underlineSelectionCheckBackground #616569 javax.swing.plaf.ColorUIResource [UI]
MenuItem.underlineSelectionBackground #484c4f com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse)
MenuItem.underlineSelectionCheckBackground #616569 com.formdev.flatlaf.util.DerivedColor [UI] lighten(20% autoInverse)
MenuItem.underlineSelectionColor #4a88c7 javax.swing.plaf.ColorUIResource [UI]
MenuItem.underlineSelectionHeight 3

View File

@@ -520,7 +520,7 @@ MenuBar.borderColor #cdcdcd javax.swing.plaf.ColorUIResource [UI]
MenuBar.font [active] $defaultFont [UI]
MenuBar.foreground #000000 javax.swing.plaf.ColorUIResource [UI]
MenuBar.highlight #ffffff javax.swing.plaf.ColorUIResource [UI]
MenuBar.hoverBackground #e6e6e6 javax.swing.plaf.ColorUIResource [UI]
MenuBar.hoverBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse)
MenuBar.itemMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI]
MenuBar.shadow #c4c4c4 javax.swing.plaf.ColorUIResource [UI]
MenuBar.windowBindings length=2 [Ljava.lang.Object;
@@ -540,7 +540,7 @@ MenuItem.arrowIcon [lazy] 6,10 com.formdev.flatlaf.icons.FlatMenu
MenuItem.background #ffffff javax.swing.plaf.ColorUIResource [UI]
MenuItem.border [lazy] 0,0,0,0 false com.formdev.flatlaf.ui.FlatMenuItemBorder [UI]
MenuItem.borderPainted true
MenuItem.checkBackground #e6e6e6 javax.swing.plaf.ColorUIResource [UI]
MenuItem.checkBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse)
MenuItem.checkMargins 2,2,2,2 javax.swing.plaf.InsetsUIResource [UI]
MenuItem.disabledForeground #8c8c8c javax.swing.plaf.ColorUIResource [UI]
MenuItem.font [active] $defaultFont [UI]
@@ -554,8 +554,8 @@ MenuItem.selectionBackground #2675bf javax.swing.plaf.ColorUIResource [UI]
MenuItem.selectionForeground #ffffff javax.swing.plaf.ColorUIResource [UI]
MenuItem.textAcceleratorGap 24
MenuItem.textNoAcceleratorGap 6
MenuItem.underlineSelectionBackground #e6e6e6 javax.swing.plaf.ColorUIResource [UI]
MenuItem.underlineSelectionCheckBackground #cccccc javax.swing.plaf.ColorUIResource [UI]
MenuItem.underlineSelectionBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse)
MenuItem.underlineSelectionCheckBackground #cccccc com.formdev.flatlaf.util.DerivedColor [UI] darken(20% autoInverse)
MenuItem.underlineSelectionColor #4083c9 javax.swing.plaf.ColorUIResource [UI]
MenuItem.underlineSelectionHeight 3