Merge PR #536: Menus: rounded selection

# Conflicts:
#	flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuBarUI.java
#	flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuUI.java
#	flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties
#	flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt
This commit is contained in:
Karl Tauber
2022-10-30 09:55:09 +01:00
12 changed files with 171 additions and 42 deletions

View File

@@ -3,6 +3,10 @@ FlatLaf Change Log
## 3.0-SNAPSHOT ## 3.0-SNAPSHOT
#### New features and improvements
- Menus: Support rounded selection. (PR #536)
#### Fixed bugs #### Fixed bugs
- FileChooser: Fixed layout of (optional) accessory component and fixed too - FileChooser: Fixed layout of (optional) accessory component and fixed too

View File

@@ -75,6 +75,9 @@ public class FlatMenuBarUI
/** @since 2 */ @Styleable protected Insets itemMargins; /** @since 2 */ @Styleable protected Insets itemMargins;
// used in FlatMenuUI // used in FlatMenuUI
/** @since 3 */ @Styleable protected Insets selectionInsets;
/** @since 3 */ @Styleable protected Insets selectionEmbeddedInsets;
/** @since 3 */ @Styleable protected int selectionArc = -1;
/** @since 2 */ @Styleable protected Color hoverBackground; /** @since 2 */ @Styleable protected Color hoverBackground;
/** @since 2.5 */ @Styleable protected Color selectionBackground; /** @since 2.5 */ @Styleable protected Color selectionBackground;
/** @since 2.5 */ @Styleable protected Color selectionForeground; /** @since 2.5 */ @Styleable protected Color selectionForeground;

View File

@@ -63,6 +63,8 @@ import com.formdev.flatlaf.util.SystemInfo;
* @uiDefault MenuItem.acceleratorArrowGap int * @uiDefault MenuItem.acceleratorArrowGap int
* @uiDefault MenuItem.checkBackground Color * @uiDefault MenuItem.checkBackground Color
* @uiDefault MenuItem.checkMargins Insets * @uiDefault MenuItem.checkMargins Insets
* @uiDefault MenuItem.selectionInsets Insets
* @uiDefault MenuItem.selectionArc int
* @uiDefault MenuItem.selectionType String null (default) or underline * @uiDefault MenuItem.selectionType String null (default) or underline
* @uiDefault MenuItem.underlineSelectionBackground Color * @uiDefault MenuItem.underlineSelectionBackground Color
* @uiDefault MenuItem.underlineSelectionCheckBackground Color * @uiDefault MenuItem.underlineSelectionCheckBackground Color
@@ -91,6 +93,9 @@ public class FlatMenuItemRenderer
@Styleable protected Color checkBackground = UIManager.getColor( "MenuItem.checkBackground" ); @Styleable protected Color checkBackground = UIManager.getColor( "MenuItem.checkBackground" );
@Styleable protected Insets checkMargins = UIManager.getInsets( "MenuItem.checkMargins" ); @Styleable protected Insets checkMargins = UIManager.getInsets( "MenuItem.checkMargins" );
/** @since 3 */ @Styleable protected Insets selectionInsets = UIManager.getInsets( "MenuItem.selectionInsets" );
/** @since 3 */ @Styleable protected int selectionArc = UIManager.getInt( "MenuItem.selectionArc" );
@Styleable protected Color underlineSelectionBackground = UIManager.getColor( "MenuItem.underlineSelectionBackground" ); @Styleable protected Color underlineSelectionBackground = UIManager.getColor( "MenuItem.underlineSelectionBackground" );
@Styleable protected Color underlineSelectionCheckBackground = UIManager.getColor( "MenuItem.underlineSelectionCheckBackground" ); @Styleable protected Color underlineSelectionCheckBackground = UIManager.getColor( "MenuItem.underlineSelectionCheckBackground" );
@Styleable protected Color underlineSelectionColor = UIManager.getColor( "MenuItem.underlineSelectionColor" ); @Styleable protected Color underlineSelectionColor = UIManager.getColor( "MenuItem.underlineSelectionColor" );
@@ -337,10 +342,16 @@ public class FlatMenuItemRenderer
g.setColor( Color.orange ); g.drawRect( arrowRect.x, arrowRect.y, arrowRect.width - 1, arrowRect.height - 1 ); g.setColor( Color.orange ); g.drawRect( arrowRect.x, arrowRect.y, arrowRect.width - 1, arrowRect.height - 1 );
debug*/ debug*/
boolean armedOrSelected = isArmedOrSelected( menuItem );
boolean underlineSelection = isUnderlineSelection(); boolean underlineSelection = isUnderlineSelection();
paintBackground( g, underlineSelection ? underlineSelectionBackground : selectionBackground );
if( underlineSelection && isArmedOrSelected( menuItem ) ) paintBackground( g );
paintUnderlineSelection( g, underlineSelectionColor, underlineSelectionHeight ); if( armedOrSelected ) {
if( underlineSelection )
paintUnderlineSelection( g, underlineSelectionBackground, underlineSelectionColor, underlineSelectionHeight );
else
paintSelection( g, selectionBackground, selectionInsets, selectionArc );
}
paintIcon( g, iconRect, getIconForPainting(), underlineSelection ? underlineSelectionCheckBackground : checkBackground, selectionBackground ); paintIcon( g, iconRect, getIconForPainting(), underlineSelection ? underlineSelectionCheckBackground : checkBackground, selectionBackground );
paintText( g, textRect, menuItem.getText(), selectionForeground, disabledForeground ); paintText( g, textRect, menuItem.getText(), selectionForeground, disabledForeground );
paintAccelerator( g, accelRect, getAcceleratorText(), acceleratorForeground, acceleratorSelectionForeground, disabledForeground ); paintAccelerator( g, accelRect, getAcceleratorText(), acceleratorForeground, acceleratorSelectionForeground, disabledForeground );
@@ -348,21 +359,39 @@ debug*/
paintArrowIcon( g, arrowRect, arrowIcon ); paintArrowIcon( g, arrowRect, arrowIcon );
} }
protected void paintBackground( Graphics g, Color selectionBackground ) { /** @since 3 */
boolean armedOrSelected = isArmedOrSelected( menuItem ); protected void paintBackground( Graphics g ) {
if( menuItem.isOpaque() || armedOrSelected ) { if( menuItem.isOpaque() ) {
// paint background g.setColor( menuItem.getBackground() );
g.setColor( armedOrSelected
? deriveBackground( selectionBackground )
: menuItem.getBackground() );
g.fillRect( 0, 0, menuItem.getWidth(), menuItem.getHeight() ); g.fillRect( 0, 0, menuItem.getWidth(), menuItem.getHeight() );
} }
} }
protected void paintUnderlineSelection( Graphics g, Color underlineSelectionColor, int underlineSelectionHeight ) { /** @since 3 */
protected void paintSelection( Graphics g, Color selectionBackground, Insets selectionInsets, int selectionArc ) {
Rectangle r = FlatUIUtils.subtractInsets( new Rectangle( menuItem.getSize() ), scale( selectionInsets ) );
g.setColor( deriveBackground( selectionBackground ) );
if( selectionArc > 0 ) {
Object[] oldRenderingHints = FlatUIUtils.setRenderingHints( g );
FlatUIUtils.paintComponentBackground( (Graphics2D) g, r.x, r.y, r.width, r.height, 0, scale( selectionArc ) );
FlatUIUtils.resetRenderingHints( g, oldRenderingHints );
} else
g.fillRect( r.x, r.y, r.width, r.height );
}
/** @since 3 */
protected void paintUnderlineSelection( Graphics g, Color underlineSelectionBackground,
Color underlineSelectionColor, int underlineSelectionHeight )
{
int width = menuItem.getWidth(); int width = menuItem.getWidth();
int height = menuItem.getHeight(); int height = menuItem.getHeight();
// paint background
g.setColor( deriveBackground( underlineSelectionBackground ) );
g.fillRect( 0, 0, width, height );
// paint underline
int underlineHeight = scale( underlineSelectionHeight ); int underlineHeight = scale( underlineSelectionHeight );
g.setColor( underlineSelectionColor ); g.setColor( underlineSelectionColor );
if( isTopLevelMenu( menuItem ) ) { if( isTopLevelMenu( menuItem ) ) {

View File

@@ -20,7 +20,9 @@ import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font; import java.awt.Font;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Window;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodHandles;
@@ -32,7 +34,9 @@ import javax.swing.JComponent;
import javax.swing.JMenu; import javax.swing.JMenu;
import javax.swing.JMenuBar; import javax.swing.JMenuBar;
import javax.swing.JMenuItem; import javax.swing.JMenuItem;
import javax.swing.JRootPane;
import javax.swing.LookAndFeel; import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.event.MouseInputListener; import javax.swing.event.MouseInputListener;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
@@ -75,9 +79,12 @@ import com.formdev.flatlaf.util.LoggingFacade;
* *
* <!-- FlatMenuRenderer --> * <!-- FlatMenuRenderer -->
* *
* @uiDefault MenuBar.selectionInsets Insets
* @uiDefault MenuBar.selectionEmbeddedInsets Insets
* @uiDefault MenuBar.selectionArc int
* @uiDefault MenuBar.hoverBackground Color * @uiDefault MenuBar.hoverBackground Color
* @uiDefault MenuBar.selectionBackground Color * @uiDefault MenuBar.selectionBackground Color optional; defaults to Menu.selectionBackground
* @uiDefault MenuBar.selectionForeground Color * @uiDefault MenuBar.selectionForeground Color optional; defaults to Menu.selectionForeground
* @uiDefault MenuBar.underlineSelectionBackground Color * @uiDefault MenuBar.underlineSelectionBackground Color
* @uiDefault MenuBar.underlineSelectionColor Color * @uiDefault MenuBar.underlineSelectionColor Color
* @uiDefault MenuBar.underlineSelectionHeight int * @uiDefault MenuBar.underlineSelectionHeight int
@@ -225,12 +232,15 @@ public class FlatMenuUI
protected class FlatMenuRenderer protected class FlatMenuRenderer
extends FlatMenuItemRenderer extends FlatMenuItemRenderer
{ {
/** @since 3 */ protected Insets menuBarSelectionInsets = UIManager.getInsets( "MenuBar.selectionInsets" );
/** @since 3 */ protected Insets menuBarSelectionEmbeddedInsets = UIManager.getInsets( "MenuBar.selectionEmbeddedInsets" );
/** @since 3 */ protected int menuBarSelectionArc = UIManager.getInt( "MenuBar.selectionArc" );
protected Color hoverBackground = UIManager.getColor( "MenuBar.hoverBackground" ); protected Color hoverBackground = UIManager.getColor( "MenuBar.hoverBackground" );
protected Color menuBarSelectionBackground = UIManager.getColor( "MenuBar.selectionBackground" ); /** @since 2.5 */ protected Color menuBarSelectionBackground = UIManager.getColor( "MenuBar.selectionBackground" );
protected Color menuBarSelectionForeground = UIManager.getColor( "MenuBar.selectionForeground" ); /** @since 2.5 */ protected Color menuBarSelectionForeground = UIManager.getColor( "MenuBar.selectionForeground" );
protected Color menuBarUnderlineSelectionBackground = FlatUIUtils.getUIColor( "MenuBar.underlineSelectionBackground", underlineSelectionBackground ); protected Color menuBarUnderlineSelectionBackground = UIManager.getColor( "MenuBar.underlineSelectionBackground" );
protected Color menuBarUnderlineSelectionColor = FlatUIUtils.getUIColor( "MenuBar.underlineSelectionColor", underlineSelectionColor ); protected Color menuBarUnderlineSelectionColor = UIManager.getColor( "MenuBar.underlineSelectionColor" );
protected int menuBarUnderlineSelectionHeight = FlatUIUtils.getUIInt( "MenuBar.underlineSelectionHeight", underlineSelectionHeight ); protected int menuBarUnderlineSelectionHeight = FlatUIUtils.getUIInt( "MenuBar.underlineSelectionHeight", -1 );
protected FlatMenuRenderer( JMenuItem menuItem, Icon checkIcon, Icon arrowIcon, protected FlatMenuRenderer( JMenuItem menuItem, Icon checkIcon, Icon arrowIcon,
Font acceleratorFont, String acceleratorDelimiter ) Font acceleratorFont, String acceleratorDelimiter )
@@ -238,46 +248,77 @@ public class FlatMenuUI
super( menuItem, checkIcon, arrowIcon, acceleratorFont, acceleratorDelimiter ); super( menuItem, checkIcon, arrowIcon, acceleratorFont, acceleratorDelimiter );
} }
/** @since 3 */
@Override @Override
protected void paintBackground( Graphics g, Color selectionBackground ) { protected void paintBackground( Graphics g ) {
if( ((JMenu)menuItem).isTopLevelMenu() ) { if( ((JMenu)menuItem).isTopLevelMenu() && isHover() ) {
if( isUnderlineSelection() ) // paint hover background
selectionBackground = getStyleFromMenuBarUI( ui -> ui.underlineSelectionBackground, menuBarUnderlineSelectionBackground ); Color color = deriveBackground( getStyleFromMenuBarUI( ui -> ui.hoverBackground, hoverBackground ) );
else { if( isUnderlineSelection() ) {
selectionBackground = getStyleFromMenuBarUI( ui -> ui.selectionBackground, g.setColor( color );
menuBarSelectionBackground != null ? menuBarSelectionBackground : selectionBackground );
}
ButtonModel model = menuItem.getModel();
if( model.isRollover() && !model.isArmed() && !model.isSelected() && model.isEnabled() ) {
g.setColor( deriveBackground( getStyleFromMenuBarUI( ui -> ui.hoverBackground, hoverBackground ) ) );
g.fillRect( 0, 0, menuItem.getWidth(), menuItem.getHeight() ); g.fillRect( 0, 0, menuItem.getWidth(), menuItem.getHeight() );
} else
paintSelection( g, color, selectionInsets, selectionArc );
return; return;
} }
super.paintBackground( g );
} }
super.paintBackground( g, selectionBackground ); /** @since 3 */
@Override
protected void paintSelection( Graphics g, Color selectionBackground, Insets selectionInsets, int selectionArc ) {
if( ((JMenu)menuItem).isTopLevelMenu() ) {
if( !isHover() )
selectionBackground = getStyleFromMenuBarUI( ui -> ui.selectionBackground, menuBarSelectionBackground, selectionBackground );
JMenuBar menuBar = (JMenuBar) menuItem.getParent();
JRootPane rootPane = SwingUtilities.getRootPane( menuBar );
if( rootPane != null && rootPane.getParent() instanceof Window &&
rootPane.getJMenuBar() == menuBar &&
FlatRootPaneUI.isMenuBarEmbedded( rootPane ) )
{
selectionInsets = getStyleFromMenuBarUI( ui -> ui.selectionEmbeddedInsets, menuBarSelectionEmbeddedInsets );
} else
selectionInsets = getStyleFromMenuBarUI( ui -> ui.selectionInsets, menuBarSelectionInsets );
selectionArc = getStyleFromMenuBarUI( ui -> (ui.selectionArc != -1)
? ui.selectionArc : null, menuBarSelectionArc );
}
super.paintSelection( g, selectionBackground, selectionInsets, selectionArc );
} }
@Override @Override
protected void paintText( Graphics g, Rectangle textRect, String text, Color selectionForeground, Color disabledForeground ) { protected void paintText( Graphics g, Rectangle textRect, String text, Color selectionForeground, Color disabledForeground ) {
if( ((JMenu)menuItem).isTopLevelMenu() && !isUnderlineSelection() ) { if( ((JMenu)menuItem).isTopLevelMenu() && !isUnderlineSelection() )
selectionForeground = getStyleFromMenuBarUI( ui -> ui.selectionForeground, selectionForeground = getStyleFromMenuBarUI( ui -> ui.selectionForeground, menuBarSelectionForeground, selectionForeground );
menuBarSelectionForeground != null ? menuBarSelectionForeground : selectionForeground );
}
super.paintText( g, textRect, text, selectionForeground, disabledForeground ); super.paintText( g, textRect, text, selectionForeground, disabledForeground );
} }
/** @since 3 */
@Override @Override
protected void paintUnderlineSelection( Graphics g, Color underlineSelectionColor, int underlineSelectionHeight ) { protected void paintUnderlineSelection( Graphics g, Color underlineSelectionBackground,
Color underlineSelectionColor, int underlineSelectionHeight )
{
if( ((JMenu)menuItem).isTopLevelMenu() ) { if( ((JMenu)menuItem).isTopLevelMenu() ) {
underlineSelectionColor = getStyleFromMenuBarUI( ui -> ui.underlineSelectionColor, menuBarUnderlineSelectionColor ); underlineSelectionBackground = getStyleFromMenuBarUI( ui -> ui.underlineSelectionBackground, menuBarUnderlineSelectionBackground, underlineSelectionBackground );
underlineSelectionHeight = getStyleFromMenuBarUI( ui -> (ui.underlineSelectionHeight != -1) underlineSelectionColor = getStyleFromMenuBarUI( ui -> ui.underlineSelectionColor, menuBarUnderlineSelectionColor, underlineSelectionColor );
? ui.underlineSelectionHeight : null, menuBarUnderlineSelectionHeight ); underlineSelectionHeight = getStyleFromMenuBarUI( ui -> (ui.underlineSelectionHeight != -1) ? ui.underlineSelectionHeight : null,
(menuBarUnderlineSelectionHeight != -1) ? menuBarUnderlineSelectionHeight : underlineSelectionHeight );
} }
super.paintUnderlineSelection( g, underlineSelectionColor, underlineSelectionHeight ); super.paintUnderlineSelection( g, underlineSelectionBackground, underlineSelectionColor, underlineSelectionHeight );
}
private boolean isHover() {
ButtonModel model = menuItem.getModel();
return model.isRollover() && !model.isArmed() && !model.isSelected() && model.isEnabled();
}
private <T> T getStyleFromMenuBarUI( Function<FlatMenuBarUI, T> f, T defaultValue, T defaultValue2 ) {
return getStyleFromMenuBarUI( f, (defaultValue != null) ? defaultValue : defaultValue2 );
} }
private <T> T getStyleFromMenuBarUI( Function<FlatMenuBarUI, T> f, T defaultValue ) { private <T> T getStyleFromMenuBarUI( Function<FlatMenuBarUI, T> f, T defaultValue ) {

View File

@@ -422,6 +422,9 @@ MenuBar.border = com.formdev.flatlaf.ui.FlatMenuBarBorder
MenuBar.background = @menuBackground MenuBar.background = @menuBackground
MenuBar.hoverBackground = @menuHoverBackground MenuBar.hoverBackground = @menuHoverBackground
MenuBar.itemMargins = 3,8,3,8 MenuBar.itemMargins = 3,8,3,8
MenuBar.selectionInsets = $MenuItem.selectionInsets
MenuBar.selectionEmbeddedInsets = $MenuItem.selectionInsets
MenuBar.selectionArc = $MenuItem.selectionArc
#---- MenuItem ---- #---- MenuItem ----
@@ -444,6 +447,8 @@ MenuItem.textNoAcceleratorGap = 6
MenuItem.acceleratorArrowGap = 2 MenuItem.acceleratorArrowGap = 2
MenuItem.acceleratorDelimiter = "+" MenuItem.acceleratorDelimiter = "+"
[mac]MenuItem.acceleratorDelimiter = "" [mac]MenuItem.acceleratorDelimiter = ""
MenuItem.selectionInsets = 0,0,0,0
MenuItem.selectionArc = 0
# for MenuItem.selectionType = underline # for MenuItem.selectionType = underline
MenuItem.underlineSelectionBackground = @menuHoverBackground MenuItem.underlineSelectionBackground = @menuHoverBackground

View File

@@ -283,6 +283,9 @@ public class TestFlatStyleableInfo
Map<String, Class<?>> expected = expectedMap( Map<String, Class<?>> expected = expectedMap(
"itemMargins", Insets.class, "itemMargins", Insets.class,
"selectionInsets", Insets.class,
"selectionEmbeddedInsets", Insets.class,
"selectionArc", int.class,
"hoverBackground", Color.class, "hoverBackground", Color.class,
"selectionBackground", Color.class, "selectionBackground", Color.class,
"selectionForeground", Color.class, "selectionForeground", Color.class,
@@ -369,6 +372,9 @@ public class TestFlatStyleableInfo
"checkBackground", Color.class, "checkBackground", Color.class,
"checkMargins", Insets.class, "checkMargins", Insets.class,
"selectionInsets", Insets.class,
"selectionArc", int.class,
"underlineSelectionBackground", Color.class, "underlineSelectionBackground", Color.class,
"underlineSelectionCheckBackground", Color.class, "underlineSelectionCheckBackground", Color.class,
"underlineSelectionColor", Color.class, "underlineSelectionColor", Color.class,

View File

@@ -435,6 +435,9 @@ public class TestFlatStyling
FlatMenuBarUI ui = (FlatMenuBarUI) c.getUI(); FlatMenuBarUI ui = (FlatMenuBarUI) c.getUI();
ui.applyStyle( "itemMargins: 1,2,3,4" ); ui.applyStyle( "itemMargins: 1,2,3,4" );
ui.applyStyle( "selectionInsets: 1,2,3,4" );
ui.applyStyle( "selectionEmbeddedInsets: 1,2,3,4" );
ui.applyStyle( "selectionArc: 8" );
ui.applyStyle( "hoverBackground: #fff" ); ui.applyStyle( "hoverBackground: #fff" );
ui.applyStyle( "selectionBackground: #fff" ); ui.applyStyle( "selectionBackground: #fff" );
ui.applyStyle( "selectionForeground: #fff" ); ui.applyStyle( "selectionForeground: #fff" );
@@ -523,6 +526,9 @@ public class TestFlatStyling
applyStyle.accept( "checkBackground: #fff" ); applyStyle.accept( "checkBackground: #fff" );
applyStyle.accept( "checkMargins: 1,2,3,4" ); applyStyle.accept( "checkMargins: 1,2,3,4" );
applyStyle.accept( "selectionInsets: 1,2,3,4" );
applyStyle.accept( "selectionArc: 8" );
applyStyle.accept( "underlineSelectionBackground: #fff" ); applyStyle.accept( "underlineSelectionBackground: #fff" );
applyStyle.accept( "underlineSelectionCheckBackground: #fff" ); applyStyle.accept( "underlineSelectionCheckBackground: #fff" );
applyStyle.accept( "underlineSelectionColor: #fff" ); applyStyle.accept( "underlineSelectionColor: #fff" );

View File

@@ -594,6 +594,9 @@ MenuBar.foreground #bbbbbb HSL 0 0 73 javax.swing.plaf.Colo
MenuBar.highlight #232324 HSL 240 1 14 javax.swing.plaf.ColorUIResource [UI] MenuBar.highlight #232324 HSL 240 1 14 javax.swing.plaf.ColorUIResource [UI]
MenuBar.hoverBackground #484c4f HSL 206 5 30 com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse) MenuBar.hoverBackground #484c4f HSL 206 5 30 com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse)
MenuBar.itemMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI] MenuBar.itemMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI]
MenuBar.selectionArc 0
MenuBar.selectionEmbeddedInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
MenuBar.selectionInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
MenuBar.shadow #616365 HSL 210 2 39 javax.swing.plaf.ColorUIResource [UI] MenuBar.shadow #616365 HSL 210 2 39 javax.swing.plaf.ColorUIResource [UI]
MenuBar.windowBindings length=2 [Ljava.lang.Object; MenuBar.windowBindings length=2 [Ljava.lang.Object;
[0] F10 [0] F10
@@ -622,8 +625,10 @@ MenuItem.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI]
MenuItem.minimumIconSize 16,16 javax.swing.plaf.DimensionUIResource [UI] MenuItem.minimumIconSize 16,16 javax.swing.plaf.DimensionUIResource [UI]
MenuItem.minimumWidth 72 MenuItem.minimumWidth 72
MenuItem.opaque false MenuItem.opaque false
MenuItem.selectionArc 0
MenuItem.selectionBackground #4b6eaf HSL 219 40 49 javax.swing.plaf.ColorUIResource [UI] MenuItem.selectionBackground #4b6eaf HSL 219 40 49 javax.swing.plaf.ColorUIResource [UI]
MenuItem.selectionForeground #bbbbbb HSL 0 0 73 javax.swing.plaf.ColorUIResource [UI] MenuItem.selectionForeground #bbbbbb HSL 0 0 73 javax.swing.plaf.ColorUIResource [UI]
MenuItem.selectionInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
MenuItem.textAcceleratorGap 24 MenuItem.textAcceleratorGap 24
MenuItem.textNoAcceleratorGap 6 MenuItem.textNoAcceleratorGap 6
MenuItem.underlineSelectionBackground #484c4f HSL 206 5 30 com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse) MenuItem.underlineSelectionBackground #484c4f HSL 206 5 30 com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse)

View File

@@ -599,6 +599,9 @@ MenuBar.foreground #000000 HSL 0 0 0 javax.swing.plaf.Colo
MenuBar.highlight #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] MenuBar.highlight #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
MenuBar.hoverBackground #e6e6e6 HSL 0 0 90 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) MenuBar.hoverBackground #e6e6e6 HSL 0 0 90 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse)
MenuBar.itemMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI] MenuBar.itemMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI]
MenuBar.selectionArc 0
MenuBar.selectionEmbeddedInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
MenuBar.selectionInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
MenuBar.shadow #c2c2c2 HSL 0 0 76 javax.swing.plaf.ColorUIResource [UI] MenuBar.shadow #c2c2c2 HSL 0 0 76 javax.swing.plaf.ColorUIResource [UI]
MenuBar.windowBindings length=2 [Ljava.lang.Object; MenuBar.windowBindings length=2 [Ljava.lang.Object;
[0] F10 [0] F10
@@ -627,8 +630,10 @@ MenuItem.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI]
MenuItem.minimumIconSize 16,16 javax.swing.plaf.DimensionUIResource [UI] MenuItem.minimumIconSize 16,16 javax.swing.plaf.DimensionUIResource [UI]
MenuItem.minimumWidth 72 MenuItem.minimumWidth 72
MenuItem.opaque false MenuItem.opaque false
MenuItem.selectionArc 0
MenuItem.selectionBackground #2675bf HSL 209 67 45 javax.swing.plaf.ColorUIResource [UI] MenuItem.selectionBackground #2675bf HSL 209 67 45 javax.swing.plaf.ColorUIResource [UI]
MenuItem.selectionForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] MenuItem.selectionForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
MenuItem.selectionInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
MenuItem.textAcceleratorGap 24 MenuItem.textAcceleratorGap 24
MenuItem.textNoAcceleratorGap 6 MenuItem.textNoAcceleratorGap 6
MenuItem.underlineSelectionBackground #e6e6e6 HSL 0 0 90 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) MenuItem.underlineSelectionBackground #e6e6e6 HSL 0 0 90 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse)

View File

@@ -615,6 +615,11 @@ MenuBar.foreground #ff0000 HSL 0 100 50 javax.swing.plaf.Colo
MenuBar.highlight #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] MenuBar.highlight #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
MenuBar.hoverBackground #ffdddd HSL 0 100 93 javax.swing.plaf.ColorUIResource [UI] MenuBar.hoverBackground #ffdddd HSL 0 100 93 javax.swing.plaf.ColorUIResource [UI]
MenuBar.itemMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI] MenuBar.itemMargins 3,8,3,8 javax.swing.plaf.InsetsUIResource [UI]
MenuBar.selectionArc 8
MenuBar.selectionBackground #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
MenuBar.selectionEmbeddedInsets 2,3,2,3 javax.swing.plaf.InsetsUIResource [UI]
MenuBar.selectionForeground #00ff00 HSL 120 100 50 javax.swing.plaf.ColorUIResource [UI]
MenuBar.selectionInsets 1,3,1,3 javax.swing.plaf.InsetsUIResource [UI]
MenuBar.shadow #a0a0a0 HSL 0 0 63 javax.swing.plaf.ColorUIResource [UI] MenuBar.shadow #a0a0a0 HSL 0 0 63 javax.swing.plaf.ColorUIResource [UI]
MenuBar.underlineSelectionBackground #00ff00 HSL 120 100 50 javax.swing.plaf.ColorUIResource [UI] MenuBar.underlineSelectionBackground #00ff00 HSL 120 100 50 javax.swing.plaf.ColorUIResource [UI]
MenuBar.underlineSelectionColor #ffff00 HSL 60 100 50 javax.swing.plaf.ColorUIResource [UI] MenuBar.underlineSelectionColor #ffff00 HSL 60 100 50 javax.swing.plaf.ColorUIResource [UI]
@@ -646,8 +651,10 @@ MenuItem.margin 3,6,3,6 javax.swing.plaf.InsetsUIResource [UI]
MenuItem.minimumIconSize 16,16 javax.swing.plaf.DimensionUIResource [UI] MenuItem.minimumIconSize 16,16 javax.swing.plaf.DimensionUIResource [UI]
MenuItem.minimumWidth 72 MenuItem.minimumWidth 72
MenuItem.opaque false MenuItem.opaque false
MenuItem.selectionArc 8
MenuItem.selectionBackground #00aa00 HSL 120 100 33 javax.swing.plaf.ColorUIResource [UI] MenuItem.selectionBackground #00aa00 HSL 120 100 33 javax.swing.plaf.ColorUIResource [UI]
MenuItem.selectionForeground #ffff00 HSL 60 100 50 javax.swing.plaf.ColorUIResource [UI] MenuItem.selectionForeground #ffff00 HSL 60 100 50 javax.swing.plaf.ColorUIResource [UI]
MenuItem.selectionInsets 0,3,0,3 javax.swing.plaf.InsetsUIResource [UI]
MenuItem.textAcceleratorGap 24 MenuItem.textAcceleratorGap 24
MenuItem.textNoAcceleratorGap 6 MenuItem.textNoAcceleratorGap 6
MenuItem.underlineSelectionBackground #e6e6e6 HSL 0 0 90 javax.swing.plaf.ColorUIResource [UI] MenuItem.underlineSelectionBackground #e6e6e6 HSL 0 0 90 javax.swing.plaf.ColorUIResource [UI]

View File

@@ -255,13 +255,26 @@ Menu.icon.disabledArrowColor = #ABABAB
#---- MenuBar ---- #---- MenuBar ----
MenuBar.selectionInsets = 1,3,1,3
MenuBar.selectionEmbeddedInsets = 2,3,2,3
MenuBar.selectionArc = 8
MenuBar.borderColor = #44f MenuBar.borderColor = #44f
MenuBar.hoverBackground = #fdd MenuBar.hoverBackground = #fdd
MenuBar.selectionBackground = #f00
MenuBar.selectionForeground = #0f0
MenuBar.underlineSelectionBackground = #0f0 MenuBar.underlineSelectionBackground = #0f0
MenuBar.underlineSelectionColor = #ff0 MenuBar.underlineSelectionColor = #ff0
MenuBar.underlineSelectionHeight = 5 MenuBar.underlineSelectionHeight = 5
#---- MenuItem ----
MenuItem.selectionInsets = 0,3,0,3
MenuItem.selectionArc = 8
#---- OptionPane ---- #---- OptionPane ----
OptionPane.background = #fdd OptionPane.background = #fdd

View File

@@ -477,8 +477,11 @@ MenuBar.foreground
MenuBar.highlight MenuBar.highlight
MenuBar.hoverBackground MenuBar.hoverBackground
MenuBar.itemMargins MenuBar.itemMargins
MenuBar.selectionArc
MenuBar.selectionBackground MenuBar.selectionBackground
MenuBar.selectionEmbeddedInsets
MenuBar.selectionForeground MenuBar.selectionForeground
MenuBar.selectionInsets
MenuBar.shadow MenuBar.shadow
MenuBar.underlineSelectionBackground MenuBar.underlineSelectionBackground
MenuBar.underlineSelectionColor MenuBar.underlineSelectionColor
@@ -504,8 +507,10 @@ MenuItem.margin
MenuItem.minimumIconSize MenuItem.minimumIconSize
MenuItem.minimumWidth MenuItem.minimumWidth
MenuItem.opaque MenuItem.opaque
MenuItem.selectionArc
MenuItem.selectionBackground MenuItem.selectionBackground
MenuItem.selectionForeground MenuItem.selectionForeground
MenuItem.selectionInsets
MenuItem.selectionType MenuItem.selectionType
MenuItem.textAcceleratorGap MenuItem.textAcceleratorGap
MenuItem.textNoAcceleratorGap MenuItem.textNoAcceleratorGap