Browse Source

Fixed menuitems missing right margin.

pull/127/head
weisj 5 years ago
parent
commit
bd0cbe479f
  1. 1
      core/src/main/java/com/github/weisj/darklaf/ui/menu/DarkMenuItemUIBase.java
  2. 8
      core/src/main/java/com/github/weisj/darklaf/ui/menu/DarkMenuUI.java
  3. 7
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/menuItem.properties
  4. 2
      core/src/test/java/ui/popupMenu/PopupMenuDemo.java

1
core/src/main/java/com/github/weisj/darklaf/ui/menu/DarkMenuItemUIBase.java

@ -55,7 +55,6 @@ public class DarkMenuItemUIBase extends BasicMenuItemUI {
acceleratorFont = UIManager.getFont("MenuItem.font");
acceleratorForeground = UIManager.getColor("MenuItem.foreground");
acceleratorSelectionForeground = UIManager.getColor("MenuItem.selectionForeground");
arrowIcon = null;
}
public void paint(final Graphics g, final JComponent c) {

8
core/src/main/java/com/github/weisj/darklaf/ui/menu/DarkMenuUI.java

@ -108,10 +108,10 @@ public class DarkMenuUI extends BasicMenuUI {
@Override
protected void installDefaults() {
super.installDefaults();
acceleratorFont = UIManager.getFont("MenuItem.font");
acceleratorForeground = UIManager.getColor("MenuItem.foreground");
acceleratorSelectionForeground = UIManager.getColor("MenuItem.selectionForeground");
arrowIconHover = UIManager.getIcon("MenuItem.arrowHover.icon");
acceleratorFont = UIManager.getFont("Menu.font");
acceleratorForeground = UIManager.getColor("Menu.foreground");
acceleratorSelectionForeground = UIManager.getColor("Menu.selectionForeground");
arrowIconHover = UIManager.getIcon("Menu.arrowHover.icon");
}
public void paint(final Graphics g, final JComponent c) {

7
core/src/main/resources/com/github/weisj/darklaf/properties/ui/menuItem.properties

@ -52,10 +52,11 @@ CheckBoxMenuItem.doNotCloseOnMouseClick = true
CheckBoxMenuItem.iconBaselineOffset = 1
#Icons
MenuItem.arrowIcon = navigation/arrowRight.svg[themed]
MenuItem.arrowHover.icon = navigation/arrowRightHover.svg[themed]
MenuItem.checkIcon = empty(7,7)
Menu.arrowIcon = navigation/arrowRight.svg[themed]
Menu.arrowHover.icon = navigation/arrowRightHover.svg[themed]
Menu.checkIcon = empty(7,7)
MenuItem.checkIcon = empty(7,7)
MenuItem.arrowIcon = empty(7,7)
CheckBoxMenuItem.checkIcon = empty(19,19)
CheckBoxMenuItem.arrowIcon = empty(16,16)

2
core/src/test/java/ui/popupMenu/PopupMenuDemo.java

@ -51,9 +51,11 @@ public class PopupMenuDemo implements ComponentDemo {
}});
add(new JMenuItem("Item 1"));
add(new JMenuItem("Item 2"));
addSeparator();
}
add(new JMenuItem("Item 1"));
add(new JMenuItem("Item 2"));
addSeparator();
}});
}
}});

Loading…
Cancel
Save