Browse Source

Fixed question icon color for light icons.

Improved plus/minus icons.
Ensure cell renderers are opaque when installing the background.
pull/170/head
weisj 5 years ago
parent
commit
13d8a7d27b
  1. 4
      core/src/main/java/com/github/weisj/darklaf/components/help/HelpButton.java
  2. 4
      core/src/main/java/com/github/weisj/darklaf/ui/cell/CellUtil.java
  3. 2
      core/src/main/resources/com/github/weisj/darklaf/icons/misc/minus.svg
  4. 2
      core/src/main/resources/com/github/weisj/darklaf/icons/misc/minusSelected.svg
  5. 4
      core/src/main/resources/com/github/weisj/darklaf/icons/misc/plus.svg
  6. 4
      core/src/main/resources/com/github/weisj/darklaf/icons/misc/plusSelected.svg
  7. 15
      property-loader/src/main/java/com/github/weisj/darklaf/icons/IconLoader.java
  8. 2
      theme/src/main/resources/com/github/weisj/darklaf/theme/icon_presets/light_icons.properties

4
core/src/main/java/com/github/weisj/darklaf/components/help/HelpButton.java

@ -43,7 +43,7 @@ public class HelpButton extends JButton {
protected void init() {
putClientProperty(DarkButtonUI.KEY_SQUARE, true);
putClientProperty(DarkButtonUI.KEY_ROUND, true);
setIcon(DarkUIUtil.ICON_LOADER.getIcon("menu/helpHighlight.svg"));
setDisabledIcon(DarkUIUtil.ICON_LOADER.getIcon("menu/helpDisabled.svg"));
setIcon(DarkUIUtil.ICON_LOADER.getIcon("menu/helpHighlight.svg", true));
setDisabledIcon(DarkUIUtil.ICON_LOADER.getIcon("menu/helpDisabled.svg", true));
}
}

4
core/src/main/java/com/github/weisj/darklaf/ui/cell/CellUtil.java

@ -34,6 +34,7 @@ import com.github.weisj.darklaf.ui.table.DarkTableUI;
import com.github.weisj.darklaf.ui.table.renderer.IconWrapper;
import com.github.weisj.darklaf.ui.tree.DarkTreeUI;
import com.github.weisj.darklaf.util.DarkUIUtil;
import com.github.weisj.darklaf.util.PropertyKey;
import com.github.weisj.darklaf.util.PropertyUtil;
public class CellUtil {
@ -384,6 +385,9 @@ public class CellUtil {
bg, selBg, bgNoFocus, selBgNoFocus, inactiveBg, inactiveSelBg,
inactiveBgNoFocus, inactiveSelBgNoFocus);
PropertyUtil.installBackground(comp, c);
if (comp instanceof JComponent) {
LookAndFeel.installProperty((JComponent) comp, PropertyKey.OPAQUE, true);
}
}
public static Color getColor(final boolean enabled, final boolean selected, final boolean focus,

2
core/src/main/resources/com/github/weisj/darklaf/icons/misc/minus.svg

@ -5,5 +5,5 @@
<stop offset="1" stop-color="#AFB1B3"/>
</linearGradient>
</defs>
<rect x="4.8" y="7.3" fill="url(#Icons.minus.color)" width="6.5" height="1.5"/>
<rect x="4.5" y="7" fill="url(#Icons.minus.color)" width="7" height="2"/>
</svg>

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 396 B

2
core/src/main/resources/com/github/weisj/darklaf/icons/misc/minusSelected.svg

@ -5,5 +5,5 @@
<stop offset="1" stop-color="#AFB1B3"/>
</linearGradient>
</defs>
<rect x="4.8" y="7.3" fill="url(#Icons.minusSelected.color)" width="6.5" height="1.5"/>
<rect x="4.5" y="7" fill="url(#Icons.minusSelected.color)" width="7" height="2"/>
</svg>

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 412 B

4
core/src/main/resources/com/github/weisj/darklaf/icons/misc/plus.svg

@ -5,6 +5,6 @@
<stop offset="1" stop-color="#AFB1B3"/>
</linearGradient>
</defs>
<rect x="4.8" y="7.3" fill="url(#Icons.plus.color)" width="6.5" height="1.5"/>
<rect x="7.3" y="4.8" fill="url(#Icons.plus.color)" width="1.5" height="6.5"/>
<rect x="4.5" y="7" fill="url(#Icons.plus.color)" width="7" height="2"/>
<rect x="7" y="4.5" fill="url(#Icons.plus.color)" width="2" height="7"/>
</svg>

Before

Width:  |  Height:  |  Size: 499 B

After

Width:  |  Height:  |  Size: 487 B

4
core/src/main/resources/com/github/weisj/darklaf/icons/misc/plusSelected.svg

@ -5,6 +5,6 @@
<stop offset="1" stop-color="#AFB1B3"/>
</linearGradient>
</defs>
<rect x="4.8" y="7.3" fill="url(#Icons.plusSelected.color)" width="6.5" height="1.5"/>
<rect x="7.3" y="4.8" fill="url(#Icons.plusSelected.color)" width="1.5" height="6.5"/>
<rect x="4.5" y="7" fill="url(#Icons.plusSelected.color)" width="7" height="2"/>
<rect x="7" y="4.5" fill="url(#Icons.plusSelected.color)" width="2" height="7"/>
</svg>

Before

Width:  |  Height:  |  Size: 523 B

After

Width:  |  Height:  |  Size: 511 B

15
property-loader/src/main/java/com/github/weisj/darklaf/icons/IconLoader.java

@ -197,6 +197,21 @@ public final class IconLoader {
return getIcon(path, DEFAULT_W, DEFAULT_H);
}
/**
* Get an icon at the specified location. The icon type is deduced from the file name. i.e. "folder/icon.svg"
* will be loaded as an svg.icon.
* Uses 16x16 icons by default.
*
* @see #get(Class)
* @see #get
* @param path the path to the icon with respect to the IconLoader resource root.
* @param themed determines whether the icon is themed. This only has an effect on svg icons.
* @return the icon.
*/
public Icon getIcon(final String path, final boolean themed) {
return getIcon(path, DEFAULT_W, DEFAULT_H, themed);
}
/**
* Get an icon at the specified location. The icon type is deduced from the file name. i.e. "folder/icon.svg"
* will be loaded as an svg.icon.

2
theme/src/main/resources/com/github/weisj/darklaf/theme/icon_presets/light_icons.properties

@ -49,4 +49,4 @@
%errorIconColor = DB5860
%informationIconColor = 389FD6
%warningIconColor = e2a53a
%questionIconColor = EDA200
%questionIconColor = 389FD6

Loading…
Cancel
Save