Skip to content

Commit

Permalink
Updated tree control icons.
Browse files Browse the repository at this point in the history
Use old icons on mac for consistency.
Add disabled icons for tree controls.
  • Loading branch information
weisJ committed Aug 5, 2020
1 parent 4597251 commit df5206f
Show file tree
Hide file tree
Showing 43 changed files with 237 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener, C
protected Icon expandedSelected;
protected Icon expandedFocus;
protected Icon expanded;
protected Icon expandedDisabled;
protected Icon collapsedFocusSelected;
protected Icon collapsedSelected;
protected Icon collapsedFocus;
protected Icon collapsed;
protected Icon collapsedDisabled;

protected Insets leadSelectionBorderInsets;

Expand Down Expand Up @@ -131,10 +133,12 @@ protected void installDefaults() {
expandedSelected = UIManager.getIcon("Tree.expanded.selected.unfocused.icon");
expandedFocus = UIManager.getIcon("Tree.expanded.unselected.focused.icon");
expanded = UIManager.getIcon("Tree.expanded.unselected.unfocused.icon");
expandedDisabled = UIManager.getIcon("Tree.expanded.disabled.icon");
collapsedFocusSelected = UIManager.getIcon("Tree.collapsed.selected.focused.icon");
collapsedSelected = UIManager.getIcon("Tree.collapsed.selected.unfocused.icon");
collapsedFocus = UIManager.getIcon("Tree.collapsed.unselected.focused.icon");
collapsed = UIManager.getIcon("Tree.collapsed.unselected.unfocused.icon");
collapsedDisabled = UIManager.getIcon("Tree.collapsed.disabled.icon");
leadSelectionBorderInsets = UIManager.getInsets("Tree.leadSelectionBorderInsets");
if (leadSelectionBorderInsets == null) leadSelectionBorderInsets = new Insets(1, 1, 1, 1);
PropertyUtil.installBooleanProperty(tree, KEY_RENDER_BOOLEAN_AS_CHECKBOX, "Tree.renderBooleanAsCheckBox");
Expand Down Expand Up @@ -576,6 +580,7 @@ protected Color getLineColor(final TreePath path) {
}

protected Icon getExpandedIcon(final boolean selected, final boolean focused) {
if (!tree.isEnabled()) return expandedDisabled;
if (selected) {
return focused ? expandedFocusSelected : expandedSelected;
} else {
Expand All @@ -584,6 +589,7 @@ protected Icon getExpandedIcon(final boolean selected, final boolean focused) {
}

protected Icon getCollapsedIcon(final boolean selected, final boolean focused) {
if (!tree.isEnabled()) return collapsedDisabled;
if (selected) {
return focused ? collapsedFocusSelected : collapsedSelected;
} else {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ global.selectionForegroundInactive = %textSelectionForegroundInactive
global.selectionBackground = %textSelectionBackground

####Icons####
ArrowButton.up.icon = navigation/arrowUp.svg[themed]
ArrowButton.down.icon = navigation/arrowDown.svg[themed]
ArrowButton.up.icon = navigation/arrow/thick/arrowUp.svg[themed]
ArrowButton.down.icon = navigation/arrow/thick/arrowDown.svg[themed]
html.pendingImage = files/pendingImage.svg[themed](32,32)
html.missingImage = files/missingImage.svg[themed](32,32)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,32 @@
#
# suppress inspection "UnusedProperty" for whole file
#
ScrollBarUI = com.github.weisj.darklaf.ui.scrollpane.DarkMacScrollBarUI
ScrollBar.smallWidth = 10
ScrollBar.width = 12
ScrollBarUI = com.github.weisj.darklaf.ui.scrollpane.DarkMacScrollBarUI
ScrollBar.smallWidth = 10
ScrollBar.width = 12

TooltipUI = com.github.weisj.darklaf.ui.tooltip.DarkMacTooltipUI
TooltipUI = com.github.weisj.darklaf.ui.tooltip.DarkMacTooltipUI

Table.alternateRowColor = true
Tree.alternateRowColor = true
List.alternateRowColor = true
FileChooser.listViewWindowsStyle = false
PopupMenu.defaultLightWeightPopups = false
ToolTip.paintShadow = false
Table.alternateRowColor = true
Tree.alternateRowColor = true
List.alternateRowColor = true
FileChooser.listViewWindowsStyle = false
PopupMenu.defaultLightWeightPopups = false
ToolTip.paintShadow = false

InternalFrame.icon = navigation/arrowDown.svg[themed]
InternalFrame.useExternalMenuBar = true
InternalFrame.icon = navigation/arrow/thick/arrowDown.svg[themed]
InternalFrame.useExternalMenuBar = true

kerning.blockList = {Table.font}
Tree.collapsed.selected.focused.icon = navigation/arrow/thick/arrowRightSelected.svg[themed]
Tree.collapsed.selected.unfocused.icon = navigation/arrow/thick/arrowRight.svg[themed]
Tree.collapsed.unselected.focused.icon = navigation/arrow/thick/arrowRight.svg[themed]
Tree.collapsed.unselected.unfocused.icon = navigation/arrow/thick/arrowRight.svg[themed]
Tree.collapsed.disabled.icon = navigation/arrow/thick/arrowRightDisabled.svg[themed]

Tree.expanded.selected.focused.icon = navigation/arrow/thick/arrowDownSelected.svg[themed]
Tree.expanded.selected.unfocused.icon = navigation/arrow/thick/arrowDown.svg[themed]
Tree.expanded.unselected.focused.icon = navigation/arrow/thick/arrowDown.svg[themed]
Tree.expanded.unselected.unfocused.icon = navigation/arrow/thick/arrowDown.svg[themed]
Tree.expanded.disabled.icon = navigation/arrow/thick/arrowRightDisabled.svg[themed]

kerning.blockList = {Table.font}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ ComboBox.cellEditorInsets = 1,0,1,0
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/arrow/thick/arrowDown.svg[themed]
ComboBox.arrowEditable.icon = navigation/arrow/thick/arrowDown.svg[themed]
ComboBox.arrowInactive.icon = navigation/arrow/thick/arrowDownDisabled.svg[themed]
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Menu.submenuPopupOffsetY = -2
Menu.background = %background

#Icons
Menu.arrowIcon = navigation/arrowRight.svg[themed]
Menu.arrowIcon = navigation/arrow/thick/arrowRight.svg[themed]
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ RadioButtonMenuItem.acceleratorTextOffset = 10
RadioButtonMenuItem.iconBaselineOffset = 0

#Icons
Menu.arrowIcon = navigation/arrowRight.svg[themed]
Menu.arrowHover.icon = navigation/arrowRightHover.svg[themed]
Menu.arrowIcon = navigation/arrow/thick/arrowRight.svg[themed]
Menu.arrowHover.icon = navigation/arrow/thick/arrowRightHover.svg[themed]
Menu.checkIcon = empty(0,0)
MenuItem.checkIcon = empty(0,0)
MenuItem.arrowIcon = empty(0,0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ Spinner.minus.icon = misc/minus.svg[themed]
Spinner.minusInactive.icon = misc/minus.svg[themed]
Spinner.arrowUp.icon = navigation/arrowUp.svg[themed]
Spinner.arrowUpInactive.icon = navigation/arrowUpDisabled.svg[themed]
Spinner.arrowDown.icon = navigation/arrowDown.svg[themed]
Spinner.arrowDown.icon = navigation/arrow/thick/arrowDown.svg[themed]
Spinner.arrowDownInactive.icon = navigation/arrowDownDisabled.svg[themed]
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ SplitPane.dividerSize = 10
#Icons
SplitPane.horizontalGlue.icon = navigation/horizontalGlue.svg[themed](4,13)
SplitPane.verticalGlue.icon = navigation/verticalGlue.svg[themed](13,4)
SplitPaneDivider.leftOneTouch.icon = navigation/arrowLeft.svg[themed](13,13)
SplitPaneDivider.rightOneTouch.icon = navigation/arrowRight.svg[themed](13,13)
SplitPaneDivider.topOneTouch.icon = navigation/arrowUp.svg[themed](13,13)
SplitPaneDivider.bottomOneTouch.icon = navigation/arrowDown.svg[themed](13,13)
SplitPaneDivider.leftOneTouch.icon = navigation/arrow/thick/arrowLeft.svg[themed](13,13)
SplitPaneDivider.rightOneTouch.icon = navigation/arrow/thick/arrowRight.svg[themed](13,13)
SplitPaneDivider.topOneTouch.icon = navigation/arrow/thick/arrowUp.svg[themed](13,13)
SplitPaneDivider.bottomOneTouch.icon = navigation/arrow/thick/arrowDown.svg[themed](13,13)
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ TaskPane.titleBackgroundGradientStart = %widgetFillInactive
TaskPaneContainer.background = %backgroundContainer

#Icons
TaskPane.collapsed.icon = navigation/arrowUp.svg[themed]
TaskPane.open.icon = navigation/arrowDown.svg[themed]
TaskPane.collapsed.icon = navigation/arrow/thick/arrowUp.svg[themed]
TaskPane.open.icon = navigation/arrow/thick/arrowDown.svg[themed]
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,20 @@ Tree.leadSelectionBorderInsets = 1,1,1,1
Tree.editorBorderInsets = 2,5,2,5

#Icons
Tree.collapsedIcon = navigation/arrowRight.svg[themed]
Tree.expandedIcon = navigation/arrowDown.svg[themed]
Tree.collapsedIcon = navigation/arrow/thick/arrowRight.svg[themed]
Tree.expandedIcon = navigation/arrow/thick/arrowDown.svg[themed]
Tree.closedIcon = files/folder.svg[themed]
Tree.openIcon = files/folder.svg[themed]
Tree.leafIcon = files/general.svg[themed]
Tree.collapsed.selected.focused.icon = navigation/arrowRightSelected.svg[themed]
Tree.collapsed.selected.unfocused.icon = navigation/arrowRight.svg[themed]
Tree.collapsed.unselected.focused.icon = navigation/arrowRight.svg[themed]
Tree.collapsed.unselected.unfocused.icon = navigation/arrowRight.svg[themed]

Tree.expanded.selected.focused.icon = navigation/arrowDownSelected.svg[themed]
Tree.expanded.selected.unfocused.icon = navigation/arrowDown.svg[themed]
Tree.expanded.unselected.focused.icon = navigation/arrowDown.svg[themed]
Tree.expanded.unselected.unfocused.icon = navigation/arrowDown.svg[themed]
Tree.collapsed.selected.focused.icon = navigation/arrow/thin/arrowRightSelected.svg[themed]
Tree.collapsed.selected.unfocused.icon = navigation/arrow/thin/arrowRight.svg[themed]
Tree.collapsed.unselected.focused.icon = navigation/arrow/thin/arrowRight.svg[themed]
Tree.collapsed.unselected.unfocused.icon = navigation/arrow/thin/arrowRight.svg[themed]
Tree.collapsed.disabled.icon = navigation/arrow/thin/arrowRightDisabled.svg[themed]

Tree.expanded.selected.focused.icon = navigation/arrow/thin/arrowDownSelected.svg[themed]
Tree.expanded.selected.unfocused.icon = navigation/arrow/thin/arrowDown.svg[themed]
Tree.expanded.unselected.focused.icon = navigation/arrow/thin/arrowDown.svg[themed]
Tree.expanded.unselected.unfocused.icon = navigation/arrow/thin/arrowDown.svg[themed]
Tree.expanded.disabled.icon = navigation/arrow/thin/arrowRightDisabled.svg[themed]
2 changes: 1 addition & 1 deletion core/src/test/java/ui/tabFrame/TabFrameDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private static Component createTextArea() {
}
});
NumberingPane numbering = numberPane.getNumberingPane();
Icon icon = DarkUIUtil.ICON_LOADER.getIcon("navigation/arrowRight.svg");
Icon icon = DarkUIUtil.ICON_LOADER.getIcon("navigation/arrow/thick/arrowRight.svg");
try {
numbering.addIconAtLine(5, icon);
numbering.addIconAtLine(10, icon);
Expand Down

0 comments on commit df5206f

Please sign in to comment.