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() {
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 borderColor;
protected Color inactiveBorderColor;
protected Color arrowBackgroundStart;
protected Color arrowBackground;
protected Color arrowBackgroundEnd;
private Insets boxPadding;
private Insets cellPadding;
@ -77,26 +77,6 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements Border, PropertyC
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) {
return c instanceof JComponent
&& 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);
}
@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
protected ComboPopup createPopup() {
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));
}
@Override
protected void installDefaults() {
super.installDefaults();
LookAndFeel.installProperty(comboBox, PropertyKey.OPAQUE, false);
arcSize = UIManager.getInt("ComboBox.arc");
}
@Override
protected LayoutManager createLayoutManager() {
return new LayoutManagerDelegate(super.createLayoutManager()) {
@ -408,10 +402,7 @@ public class DarkComboBoxUI extends BasicComboBoxUI implements Border, PropertyC
protected Paint getArrowBackground(final JComboBox<?> c) {
if (!c.isEnabled()) return inactiveBackground;
if (c.isEditable()) {
return new GradientPaint(0, borderSize, arrowBackgroundStart,
0, c.getHeight() - borderSize, arrowBackgroundEnd);
}
if (c.isEditable()) return arrowBackground;
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();
}
};
protected Color arrowBackgroundStart;
protected Color arrowBackground;
protected Color background;
protected Color arrowBackgroundEnd;
protected Icon arrowDownIcon;
@ -294,8 +294,7 @@ public class DarkSpinnerUI extends BasicSpinnerUI implements PropertyChangeListe
borderSize = UIManager.getInt("Spinner.borderThickness");
background = UIManager.getColor("Spinner.activeBackground");
inactiveBackground = UIManager.getColor("Spinner.inactiveBackground");
arrowBackgroundStart = UIManager.getColor("Spinner.arrowBackgroundStart");
arrowBackgroundEnd = UIManager.getColor("Spinner.arrowBackgroundEnd");
arrowBackground = UIManager.getColor("Spinner.arrowBackground");
arrowDownIcon = UIManager.getIcon("Spinner.arrowDown.icon");
arrowUpIcon = UIManager.getIcon("Spinner.arrowUp.icon");
@ -333,9 +332,7 @@ public class DarkSpinnerUI extends BasicSpinnerUI implements PropertyChangeListe
}
protected Paint getArrowBackground(final JComponent c) {
return c == null || !c.isEnabled() ? inactiveBackground
: new GradientPaint(0, borderSize, arrowBackgroundStart,
0, c.getHeight() - borderSize, arrowBackgroundEnd);
return c == null || !c.isEnabled() ? inactiveBackground : arrowBackground;
}
@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
# SOFTWARE.
#
ComboBoxUI = com.github.weisj.darklaf.ui.combobox.DarkComboBoxUI
ComboBox.squareButton = false
ComboBox.background = %backgroundContainer
ComboBox.activeBorderColor = %widgetBorder
ComboBox.inactiveBorderColor = %widgetBorderInactive
ComboBox.focusBorderColor = %glowFocusLine
ComboBox.inactiveBackground = %widgetFillInactive
ComboBox.activeBackground = %backgroundContainer
ComboBox.arrowBackgroundStart = %background
ComboBox.arrowBackgroundEnd = %background
ComboBox.editBackground = %background
ComboBox.disabledForeground = %textForegroundInactive
ComboBox.disabledBackground = %widgetFillInactive
ComboBox.selectionBackground = %highlightFillFocus
ComboBox.arc = %arc
ComboBox.borderThickness = %borderThickness
ComboBox.selectionForeground = %textSelectionForeground
ComboBox.insets = 5,5,5,5
ComboBox.cellEditorInsets = 1,1,1,1
ComboBox.buttonPad = 4
ComboBoxUI = com.github.weisj.darklaf.ui.combobox.DarkComboBoxUI
ComboBox.squareButton = false
ComboBox.background = %backgroundContainer
ComboBox.activeBorderColor = %widgetBorder
ComboBox.inactiveBorderColor = %widgetBorderInactive
ComboBox.focusBorderColor = %glowFocusLine
ComboBox.inactiveBackground = %widgetFillInactive
ComboBox.activeBackground = %backgroundContainer
ComboBox.arrowBackground = %background
ComboBox.editBackground = %background
ComboBox.disabledForeground = %textForegroundInactive
ComboBox.disabledBackground = %widgetFillInactive
ComboBox.selectionBackground = %highlightFillFocus
ComboBox.arc = %arc
ComboBox.borderThickness = %borderThickness
ComboBox.selectionForeground = %textSelectionForeground
ComboBox.insets = 5,5,5,5
ComboBox.cellEditorInsets = 1,1,1,1
ComboBox.buttonPad = 4
#Icons
ComboBox.arrow.icon = navigation/arrowDown.svg[themed]
ComboBox.arrowEditable.icon = navigation/arrowDown.svg[themed]
ComboBox.arrowInactive.icon = navigation/arrowDownDisabled.svg[themed]
ComboBox.arrow.icon = navigation/arrowDown.svg[themed]
ComboBox.arrowEditable.icon = navigation/arrowDown.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.focusBorderColor = %glowFocusLine
Spinner.inactiveBackground = %widgetFillInactive
Spinner.arrowBackgroundStart = %background
Spinner.arrowBackgroundEnd = %background
Spinner.arrowBackground = %background
Spinner.activeBackground = %textBackground
Spinner.arrowButtonInsets = 2,2,2,2
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