Browse Source

Fixed Tristate model not installed when updating state icon.

pull/130/head
weisj 5 years ago
parent
commit
050d6b520d
  1. 13
      core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/radiobutton/DarkRadioButtonMenuItemUI.java
  2. 7
      core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/tristate/DarkTristateCheckBoxMenuItemUI.java
  3. 5
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/menuItem.properties

13
core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/radiobutton/DarkRadioButtonMenuItemUI.java

@ -55,19 +55,14 @@ public class DarkRadioButtonMenuItemUI extends DarkMenuItemUIBase implements Tog
return "RadioButtonMenuItem";
}
@Override
public void installUI(final JComponent c) {
super.installUI(c);
acceleratorFont = UIManager.getFont("MenuItem.font");
acceleratorForeground = UIManager.getColor("MenuItem.foreground");
acceleratorSelectionForeground = UIManager.getColor("MenuItem.selectionForeground");
c.putClientProperty(KEY_NO_NOT_CLOSE_ON_CLICK, UIManager.getBoolean(KEY_NO_NOT_CLOSE_ON_CLICK));
}
@Override
public void installDefaults() {
super.installDefaults();
iconBaselineOffset = UIManager.getInt(getPropertyPrefix() + ".iconBaselineOffset");
acceleratorFont = UIManager.getFont("MenuItem.font");
acceleratorForeground = UIManager.getColor("MenuItem.foreground");
acceleratorSelectionForeground = UIManager.getColor("MenuItem.selectionForeground");
menuItem.putClientProperty(KEY_NO_NOT_CLOSE_ON_CLICK, UIManager.getBoolean(KEY_NO_NOT_CLOSE_ON_CLICK));
installIcons();
checkIcon = getStateIcon(menuItem);
}

7
core/src/main/java/com/github/weisj/darklaf/ui/togglebutton/tristate/DarkTristateCheckBoxMenuItemUI.java

@ -23,6 +23,7 @@
*/
package com.github.weisj.darklaf.ui.togglebutton.tristate;
import com.github.weisj.darklaf.components.tristate.TristateButtonModel;
import com.github.weisj.darklaf.components.tristate.TristateCheckBoxMenuItem;
import com.github.weisj.darklaf.components.tristate.TristateState;
import com.github.weisj.darklaf.ui.togglebutton.checkbox.DarkCheckBoxMenuItemUI;
@ -42,6 +43,12 @@ public class DarkTristateCheckBoxMenuItemUI extends DarkCheckBoxMenuItemUI {
return new DarkTristateCheckBoxMenuItemUI();
}
@Override
public void installDefaults() {
menuItem.setModel(new TristateButtonModel());
super.installDefaults();
}
@Override
protected void installIcons() {
super.installIcons();

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

@ -38,8 +38,6 @@ RadioButtonMenuItem.acceleratorForeground = %acceleratorForeground
RadioButtonMenuItem.acceleratorSelectionForeground = %acceleratorForeground
RadioButtonMenuItem.selectionBackground = %highlightFillFocus
RadioButtonMenuItem.doNotCloseOnMouseClick = true
RadioButtonMenuItem.iconBaselineOffset = 0
CheckBoxMenuItemUI = com.github.weisj.darklaf.ui.togglebutton.checkbox.DarkCheckBoxMenuItemUI
CheckBoxMenuItem.border = com.github.weisj.darklaf.ui.menu.DarkMenuItemBorder
@ -49,7 +47,6 @@ CheckBoxMenuItem.acceleratorSelectionForeground = %acceleratorForeground
CheckBoxMenuItem.selectionBackground = %highlightFillFocus
CheckBoxMenuItem.foreground = %textForeground
CheckBoxMenuItem.doNotCloseOnMouseClick = true
CheckBoxMenuItem.iconBaselineOffset = 0
Menu.afterCheckIconGap = 2
@ -69,12 +66,14 @@ CheckBoxMenuItem.iconTextGap = 2
CheckBoxMenuItem.checkIconOffset = 2
CheckBoxMenuItem.minimumTextOffset = 16
CheckBoxMenuItem.acceleratorTextOffset = 10
CheckBoxMenuItem.iconBaselineOffset = 0
RadioButtonMenuItem.afterCheckIconGap = 2
RadioButtonMenuItem.iconTextGap = 2
RadioButtonMenuItem.checkIconOffset = 2
RadioButtonMenuItem.minimumTextOffset = 16
RadioButtonMenuItem.acceleratorTextOffset = 10
RadioButtonMenuItem.iconBaselineOffset = 0
#Icons
Menu.arrowIcon = navigation/arrowRight.svg[themed]

Loading…
Cancel
Save