Browse Source

Make togglebutton hints depend on contrast property of theme.

pull/235/head
weisj 4 years ago
parent
commit
b152520471
No known key found for this signature in database
GPG Key ID: 31124CB75461DA2A
  1. 2
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/toggleButton.properties
  2. 10
      core/src/test/java/theme/ThemeEditor.java
  3. 1
      theme/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_dark/high_contrast_dark_ui.properties
  4. 1
      theme/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_light/high_contrast_light_ui.properties

2
core/src/main/resources/com/github/weisj/darklaf/properties/ui/toggleButton.properties

@ -39,5 +39,5 @@ ToggleButton.inactiveFillColor = %widgetFill
ToggleButton.activeFillColor = %textForegroundInactive
ToggleButton.sliderSize = 35,17
ToggleButton.showSliderHints = false
ToggleButton.showSliderHints = %Theme.highContrast
ToggleButton.animated = true

10
core/src/test/java/theme/ThemeEditor.java

@ -182,10 +182,12 @@ public class ThemeEditor extends JPanel {
apply.addActionListener(e -> {
mutableTheme.setDelegate(baseTheme.get());
mutableTheme.colorToneRule =
darkToggle.isSelected() ? ColorToneRule.DARK : ColorToneRule.LIGHT;
mutableTheme.contrastRule =
contrastToggle.isSelected() ? ContrastRule.HIGH_CONTRAST : ContrastRule.STANDARD;
mutableTheme.colorToneRule = darkToggle.isSelected()
? ColorToneRule.DARK
: ColorToneRule.LIGHT;
mutableTheme.contrastRule = contrastToggle.isSelected()
? ContrastRule.HIGH_CONTRAST
: ContrastRule.STANDARD;
LafManager.setTheme((Theme) null);
LafManager.install(mutableTheme);
});

1
theme/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_dark/high_contrast_dark_ui.properties

@ -30,4 +30,3 @@ TabbedPane.selectedHoverBackground = %backgroundHover
ToolTip.paintShadow = false
RootPane.borderInsets = 1,1,1,1
ScrollBar.thumbAlpha = 100
ToggleButton.showSliderHints = true

1
theme/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_light/high_contrast_light_ui.properties

@ -33,4 +33,3 @@ TabFrameTab.selectedForeground = %textSelectionForeground
TabFrameTab.hoverForeground = %textSelectionForeground
RootPane.borderInsets = 1,1,1,1
ScrollBar.thumbAlpha = 100
ToggleButton.showSliderHints = true

Loading…
Cancel
Save