Browse Source

Removed blue spinner/combo background on intelliJ macos.

pull/127/head
weisj 5 years ago
parent
commit
0e7c76f648
  1. 6
      core/src/main/java/com/github/weisj/darklaf/theme/IntelliJTheme.java
  2. 55
      core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java
  3. 9
      core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java
  4. 45
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/comboBox.properties
  5. 3
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/spinner.properties
  6. 34
      core/src/main/resources/com/github/weisj/darklaf/theme/intellij/intellij_mac.properties

6
core/src/main/java/com/github/weisj/darklaf/theme/IntelliJTheme.java

@ -67,10 +67,4 @@ public class IntelliJTheme extends Theme {
protected Class<? extends Theme> getLoaderClass() { protected Class<? extends Theme> getLoaderClass() {
return IntelliJTheme.class; return IntelliJTheme.class;
} }
@Override
public void loadUIProperties(final Properties properties, final UIDefaults currentDefaults) {
super.loadUIProperties(properties, currentDefaults);
loadCustomProperties("ui", properties, currentDefaults);
}
} }

55
core/src/main/java/com/github/weisj/darklaf/ui/combobox/DarkComboBoxUI.java

@ -68,7 +68,7 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements Border, PropertyC
protected Color focusBorderColor; protected Color focusBorderColor;
protected Color borderColor; protected Color borderColor;
protected Color inactiveBorderColor; protected Color inactiveBorderColor;
protected Color arrowBackgroundStart; protected Color arrowBackground;
protected Color arrowBackgroundEnd; protected Color arrowBackgroundEnd;
private Insets boxPadding; private Insets boxPadding;
private Insets cellPadding; private Insets cellPadding;
@ -77,26 +77,6 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements Border, PropertyC
return new DarkComboBoxUI(); return new DarkComboBoxUI();
} }
@Override
public void installUI(final JComponent c) {
super.installUI(c);
boxPadding = UIManager.getInsets("ComboBox.insets");
borderSize = UIManager.getInt("ComboBox.borderThickness");
background = UIManager.getColor("ComboBox.activeBackground");
editBackground = UIManager.getColor("ComboBox.editBackground");
inactiveBackground = UIManager.getColor("ComboBox.inactiveBackground");
inactiveForeground = UIManager.getColor("ComboBox.disabledForeground");
focusBorderColor = UIManager.getColor("ComboBox.focusBorderColor");
borderColor = UIManager.getColor("ComboBox.activeBorderColor");
inactiveBorderColor = UIManager.getColor("ComboBox.inactiveBorderColor");
arrowBackgroundStart = UIManager.getColor("ComboBox.arrowBackgroundStart");
arrowBackgroundEnd = UIManager.getColor("ComboBox.arrowBackgroundEnd");
cellPadding = UIManager.getInsets("ComboBox.cellEditorInsets");
if (boxPadding == null) boxPadding = new Insets(0, 0, 0, 0);
if (cellPadding == null) cellPadding = new Insets(0, 0, 0, 0);
comboBox.setBorder(this);
}
protected static boolean isTableCellEditor(final Component c) { protected static boolean isTableCellEditor(final Component c) {
return c instanceof JComponent return c instanceof JComponent
&& Boolean.TRUE.equals(((JComponent) c).getClientProperty(KEY_IS_TABLE_EDITOR)); && Boolean.TRUE.equals(((JComponent) c).getClientProperty(KEY_IS_TABLE_EDITOR));
@ -116,6 +96,27 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements Border, PropertyC
comboBox.removePropertyChangeListener(this); comboBox.removePropertyChangeListener(this);
} }
@Override
protected void installDefaults() {
super.installDefaults();
LookAndFeel.installProperty(comboBox, PropertyKey.OPAQUE, false);
arcSize = UIManager.getInt("ComboBox.arc");
boxPadding = UIManager.getInsets("ComboBox.insets");
borderSize = UIManager.getInt("ComboBox.borderThickness");
background = UIManager.getColor("ComboBox.activeBackground");
editBackground = UIManager.getColor("ComboBox.editBackground");
inactiveBackground = UIManager.getColor("ComboBox.inactiveBackground");
inactiveForeground = UIManager.getColor("ComboBox.disabledForeground");
focusBorderColor = UIManager.getColor("ComboBox.focusBorderColor");
borderColor = UIManager.getColor("ComboBox.activeBorderColor");
inactiveBorderColor = UIManager.getColor("ComboBox.inactiveBorderColor");
arrowBackground = UIManager.getColor("ComboBox.arrowBackground");
cellPadding = UIManager.getInsets("ComboBox.cellEditorInsets");
if (boxPadding == null) boxPadding = new Insets(0, 0, 0, 0);
if (cellPadding == null) cellPadding = new Insets(0, 0, 0, 0);
comboBox.setBorder(this);
}
@Override @Override
protected ComboPopup createPopup() { protected ComboPopup createPopup() {
return new DarkComboPopup(comboBox); return new DarkComboPopup(comboBox);
@ -222,13 +223,6 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements Border, PropertyC
&& Boolean.TRUE.equals(((JComponent) c).getClientProperty(KEY_IS_TREE_EDITOR)); && Boolean.TRUE.equals(((JComponent) c).getClientProperty(KEY_IS_TREE_EDITOR));
} }
@Override
protected void installDefaults() {
super.installDefaults();
LookAndFeel.installProperty(comboBox, PropertyKey.OPAQUE, false);
arcSize = UIManager.getInt("ComboBox.arc");
}
@Override @Override
protected LayoutManager createLayoutManager() { protected LayoutManager createLayoutManager() {
return new LayoutManagerDelegate(super.createLayoutManager()) { return new LayoutManagerDelegate(super.createLayoutManager()) {
@ -408,10 +402,7 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements Border, PropertyC
protected Paint getArrowBackground(final JComboBox<?> c) { protected Paint getArrowBackground(final JComboBox<?> c) {
if (!c.isEnabled()) return inactiveBackground; if (!c.isEnabled()) return inactiveBackground;
if (c.isEditable()) { if (c.isEditable()) return arrowBackground;
return new GradientPaint(0, borderSize, arrowBackgroundStart,
0, c.getHeight() - borderSize, arrowBackgroundEnd);
}
return background; return background;
} }

9
core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java

@ -74,7 +74,7 @@ public class DarkSpinnerUI extends BasicSpinnerUI implements PropertyChangeListe
spinner.getEditor().requestFocus(); spinner.getEditor().requestFocus();
} }
}; };
protected Color arrowBackgroundStart; protected Color arrowBackground;
protected Color background; protected Color background;
protected Color arrowBackgroundEnd; protected Color arrowBackgroundEnd;
protected Icon arrowDownIcon; protected Icon arrowDownIcon;
@ -294,8 +294,7 @@ public class DarkSpinnerUI extends BasicSpinnerUI implements PropertyChangeListe
borderSize = UIManager.getInt("Spinner.borderThickness"); borderSize = UIManager.getInt("Spinner.borderThickness");
background = UIManager.getColor("Spinner.activeBackground"); background = UIManager.getColor("Spinner.activeBackground");
inactiveBackground = UIManager.getColor("Spinner.inactiveBackground"); inactiveBackground = UIManager.getColor("Spinner.inactiveBackground");
arrowBackgroundStart = UIManager.getColor("Spinner.arrowBackgroundStart"); arrowBackground = UIManager.getColor("Spinner.arrowBackground");
arrowBackgroundEnd = UIManager.getColor("Spinner.arrowBackgroundEnd");
arrowDownIcon = UIManager.getIcon("Spinner.arrowDown.icon"); arrowDownIcon = UIManager.getIcon("Spinner.arrowDown.icon");
arrowUpIcon = UIManager.getIcon("Spinner.arrowUp.icon"); arrowUpIcon = UIManager.getIcon("Spinner.arrowUp.icon");
@ -333,9 +332,7 @@ public class DarkSpinnerUI extends BasicSpinnerUI implements PropertyChangeListe
} }
protected Paint getArrowBackground(final JComponent c) { protected Paint getArrowBackground(final JComponent c) {
return c == null || !c.isEnabled() ? inactiveBackground return c == null || !c.isEnabled() ? inactiveBackground : arrowBackground;
: new GradientPaint(0, borderSize, arrowBackgroundStart,
0, c.getHeight() - borderSize, arrowBackgroundEnd);
} }
@Override @Override

45
core/src/main/resources/com/github/weisj/darklaf/properties/ui/comboBox.properties

@ -22,28 +22,27 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE. # SOFTWARE.
# #
ComboBoxUI = com.github.weisj.darklaf.ui.combobox.DarkComboBoxUI ComboBoxUI = com.github.weisj.darklaf.ui.combobox.DarkComboBoxUI
ComboBox.squareButton = false ComboBox.squareButton = false
ComboBox.background = %backgroundContainer ComboBox.background = %backgroundContainer
ComboBox.activeBorderColor = %widgetBorder ComboBox.activeBorderColor = %widgetBorder
ComboBox.inactiveBorderColor = %widgetBorderInactive ComboBox.inactiveBorderColor = %widgetBorderInactive
ComboBox.focusBorderColor = %glowFocusLine ComboBox.focusBorderColor = %glowFocusLine
ComboBox.inactiveBackground = %widgetFillInactive ComboBox.inactiveBackground = %widgetFillInactive
ComboBox.activeBackground = %backgroundContainer ComboBox.activeBackground = %backgroundContainer
ComboBox.arrowBackgroundStart = %background ComboBox.arrowBackground = %background
ComboBox.arrowBackgroundEnd = %background ComboBox.editBackground = %background
ComboBox.editBackground = %background ComboBox.disabledForeground = %textForegroundInactive
ComboBox.disabledForeground = %textForegroundInactive ComboBox.disabledBackground = %widgetFillInactive
ComboBox.disabledBackground = %widgetFillInactive ComboBox.selectionBackground = %highlightFillFocus
ComboBox.selectionBackground = %highlightFillFocus ComboBox.arc = %arc
ComboBox.arc = %arc ComboBox.borderThickness = %borderThickness
ComboBox.borderThickness = %borderThickness ComboBox.selectionForeground = %textSelectionForeground
ComboBox.selectionForeground = %textSelectionForeground ComboBox.insets = 5,5,5,5
ComboBox.insets = 5,5,5,5 ComboBox.cellEditorInsets = 1,1,1,1
ComboBox.cellEditorInsets = 1,1,1,1 ComboBox.buttonPad = 4
ComboBox.buttonPad = 4
#Icons #Icons
ComboBox.arrow.icon = navigation/arrowDown.svg[themed] ComboBox.arrow.icon = navigation/arrowDown.svg[themed]
ComboBox.arrowEditable.icon = navigation/arrowDown.svg[themed] ComboBox.arrowEditable.icon = navigation/arrowDown.svg[themed]
ComboBox.arrowInactive.icon = navigation/arrowDownDisabled.svg[themed] ComboBox.arrowInactive.icon = navigation/arrowDownDisabled.svg[themed]

3
core/src/main/resources/com/github/weisj/darklaf/properties/ui/spinner.properties

@ -28,8 +28,7 @@ Spinner.activeBorderColor = %widgetBorder
Spinner.inactiveBorderColor = %widgetBorderInactive Spinner.inactiveBorderColor = %widgetBorderInactive
Spinner.focusBorderColor = %glowFocusLine Spinner.focusBorderColor = %glowFocusLine
Spinner.inactiveBackground = %widgetFillInactive Spinner.inactiveBackground = %widgetFillInactive
Spinner.arrowBackgroundStart = %background Spinner.arrowBackground = %background
Spinner.arrowBackgroundEnd = %background
Spinner.activeBackground = %textBackground Spinner.activeBackground = %textBackground
Spinner.arrowButtonInsets = 2,2,2,2 Spinner.arrowButtonInsets = 2,2,2,2
Spinner.editorBorderPainted = false Spinner.editorBorderPainted = false

34
core/src/main/resources/com/github/weisj/darklaf/theme/intellij/intellij_mac.properties

@ -1,34 +0,0 @@
#
# MIT License
#
# Copyright (c) 2020 Jannis Weis
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
ComboBox.arrowBackgroundStart = 68B2FA
ComboBox.arrowBackgroundEnd = 0E80FF
ComboBox.arrow.icon = navigation/arrowDown.svg[themed]
ComboBox.arrowEditable.icon = navigation/arrowDownSelected.svg[themed]
Spinner.arrowBackgroundStart = 68B2FA
Spinner.arrowBackgroundEnd = 0E80FF
Spinner.plus.icon = misc/plusSelected.svg[themed]
Spinner.minus.icon = misc/minusSelected.svg[themed]
Spinner.arrowUp.icon = navigation/arrowUpSelected.svg[themed]
Spinner.arrowDown.icon = navigation/arrowDownSelected.svg[themed]
Loading…
Cancel
Save