mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 22:40:53 +03:00
MenuItem: vertically align text if icons have different widths (issue #437)
This commit is contained in:
@@ -628,6 +628,7 @@ MenuItem.underlineSelectionBackground #484c4f HSL 206 5 30 com.formdev.fl
|
||||
MenuItem.underlineSelectionCheckBackground #3c588b HSL 219 40 39 com.formdev.flatlaf.util.DerivedColor [UI] darken(10%)
|
||||
MenuItem.underlineSelectionColor #4c87c8 HSL 211 53 54 javax.swing.plaf.ColorUIResource [UI]
|
||||
MenuItem.underlineSelectionHeight 3
|
||||
MenuItem.verticallyAlignText true
|
||||
MenuItemUI com.formdev.flatlaf.ui.FlatMenuItemUI
|
||||
|
||||
|
||||
|
||||
@@ -633,6 +633,7 @@ MenuItem.underlineSelectionBackground #e6e6e6 HSL 0 0 90 com.formdev.fl
|
||||
MenuItem.underlineSelectionCheckBackground #bfd9f2 HSL 209 66 85 com.formdev.flatlaf.util.DerivedColor [UI] lighten(40%)
|
||||
MenuItem.underlineSelectionColor #3c83c5 HSL 209 54 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
MenuItem.underlineSelectionHeight 3
|
||||
MenuItem.verticallyAlignText true
|
||||
MenuItemUI com.formdev.flatlaf.ui.FlatMenuItemUI
|
||||
|
||||
|
||||
|
||||
@@ -638,6 +638,7 @@ MenuItem.underlineSelectionBackground #e6e6e6 HSL 0 0 90 javax.swing.pl
|
||||
MenuItem.underlineSelectionCheckBackground #ccccff HSL 240 100 90 javax.swing.plaf.ColorUIResource [UI]
|
||||
MenuItem.underlineSelectionColor #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
MenuItem.underlineSelectionHeight 3
|
||||
MenuItem.verticallyAlignText true
|
||||
MenuItemUI com.formdev.flatlaf.ui.FlatMenuItemUI
|
||||
|
||||
|
||||
|
||||
@@ -165,6 +165,11 @@ public class FlatMenusTest
|
||||
JMenu menu12 = new JMenu();
|
||||
JMenuItem menuItem41 = new JMenuItem();
|
||||
JMenuItem menuItem42 = new JMenuItem();
|
||||
JMenuItem menuItem43 = new JMenuItem();
|
||||
JMenuItem menuItem44 = new JMenuItem();
|
||||
JMenuItem menuItem45 = new JMenuItem();
|
||||
JMenuItem menuItem46 = new JMenuItem();
|
||||
JMenuItem menuItem47 = new JMenuItem();
|
||||
menuBar2 = new JMenuBar();
|
||||
JMenu menu8 = new JMenu();
|
||||
FlatMenusTest.LargerMenuItem menuItem13 = new FlatMenusTest.LargerMenuItem();
|
||||
@@ -397,6 +402,32 @@ public class FlatMenusTest
|
||||
menuItem42.setDisabledIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste.png")));
|
||||
menuItem42.setEnabled(false);
|
||||
menu12.add(menuItem42);
|
||||
menu12.addSeparator();
|
||||
|
||||
//---- menuItem43 ----
|
||||
menuItem43.setText("text");
|
||||
menuItem43.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/test16.png")));
|
||||
menu12.add(menuItem43);
|
||||
|
||||
//---- menuItem44 ----
|
||||
menuItem44.setText("text");
|
||||
menuItem44.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/test24.png")));
|
||||
menu12.add(menuItem44);
|
||||
|
||||
//---- menuItem45 ----
|
||||
menuItem45.setText("text");
|
||||
menuItem45.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/test32.png")));
|
||||
menu12.add(menuItem45);
|
||||
|
||||
//---- menuItem46 ----
|
||||
menuItem46.setText("text");
|
||||
menuItem46.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/test48.png")));
|
||||
menu12.add(menuItem46);
|
||||
|
||||
//---- menuItem47 ----
|
||||
menuItem47.setText("text");
|
||||
menuItem47.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/test64.png")));
|
||||
menu12.add(menuItem47);
|
||||
}
|
||||
menuBar1.add(menu12);
|
||||
}
|
||||
|
||||
@@ -165,6 +165,34 @@ new FormModel {
|
||||
"disabledIcon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste.png" )
|
||||
"enabled": false
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
|
||||
name: "separator6"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "menuItem43"
|
||||
"text": "text"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/test16.png" )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "menuItem44"
|
||||
"text": "text"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/test24.png" )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "menuItem45"
|
||||
"text": "text"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/test32.png" )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "menuItem46"
|
||||
"text": "text"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/test48.png" )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JMenuItem" ) {
|
||||
name: "menuItem47"
|
||||
"text": "text"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/test64.png" )
|
||||
} )
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 0 2 1,growx"
|
||||
|
||||
Reference in New Issue
Block a user