Browse Source

Add option to disable tree popups.

pull/198/head
weisj 4 years ago
parent
commit
0205ad3d53
  1. 14
      core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java
  2. 1
      core/src/main/resources/com/github/weisj/darklaf/properties/overwrites.properties
  3. 63
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/tree.properties

14
core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java

@ -179,8 +179,10 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener, C
@Override
protected void installListeners() {
super.installListeners();
popupListener = createPopupMouseListener();
popupListener.install();
if (UIManager.getBoolean("Tree.showFullRowInPopup")) {
popupListener = createPopupMouseListener();
popupListener.install();
}
tree.addPropertyChangeListener(this);
tree.addMouseListener(selectionListener);
}
@ -377,8 +379,10 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener, C
@Override
protected void uninstallListeners() {
super.uninstallListeners();
popupListener.uninstall();
popupListener = null;
if (popupListener != null) {
popupListener.uninstall();
popupListener = null;
}
tree.removeMouseListener(selectionListener);
tree.removePropertyChangeListener(this);
}
@ -550,7 +554,7 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener, C
@Override
public void update(final Graphics g, final JComponent c) {
popupListener.repaint();
if (popupListener != null) popupListener.repaint();
super.update(g, c);
}

1
core/src/main/resources/com/github/weisj/darklaf/properties/overwrites.properties

@ -30,4 +30,5 @@ Tree.renderBooleanAsCheckBox = treeBooleanRenderer
TextComponent.roundedSelection = roundedSelection
Button.convertIconOnlyToBorderless = borderlessIconButtons
Tree.defaultLineStyle = treeLineStyle
Tree.showFullRowInPopup = treeRowPopup
ToolTip.defaultStyle = tooltipStyle

63
core/src/main/resources/com/github/weisj/darklaf/properties/ui/tree.properties

@ -24,16 +24,16 @@
#
# suppress inspection "UnusedProperty" for whole file
#
TreeUI = com.github.weisj.darklaf.ui.tree.DarkTreeUI
Tree.editorBorder = com.github.weisj.darklaf.ui.tree.DarkTreeCellBorder
Tree.editorBorderColor = %widgetBorder
Tree.rendererFillBackground = false
Tree.selectionBorderColor = null
Tree.line = %borderFocus
Tree.hash = %borderFocus
Tree.lineFocusSelected = %borderFocus
Tree.lineSelected = %gridLine
Tree.lineUnselected = %gridLine
TreeUI = com.github.weisj.darklaf.ui.tree.DarkTreeUI
Tree.editorBorder = com.github.weisj.darklaf.ui.tree.DarkTreeCellBorder
Tree.editorBorderColor = %widgetBorder
Tree.rendererFillBackground = false
Tree.selectionBorderColor = null
Tree.line = %borderFocus
Tree.hash = %borderFocus
Tree.lineFocusSelected = %borderFocus
Tree.lineSelected = %gridLine
Tree.lineUnselected = %gridLine
Tree.background = %Cell.background
Tree.backgroundAlternative = %Cell.backgroundAlternative
@ -59,29 +59,30 @@ Tree.inactiveForegroundSelected = %Cell.inactiveForegroundSelected
Tree.inactiveForegroundNoFocus = %Cell.inactiveForegroundNoFocus
Tree.inactiveSelectedNoFocus = %Cell.inactiveSelectedNoFocus
Tree.textBackground = %textBackground
Tree.rowHeight = 22
Tree.dropLineColor = %dropForeground
Tree.textBackground = %textBackground
Tree.rowHeight = 22
Tree.dropLineColor = %dropForeground
Tree.alternateRowColor = false
Tree.renderBooleanAsCheckBox = true
Tree.booleanRenderType = checkBox
Tree.defaultLineStyle = line
Tree.alternateRowColor = false
Tree.renderBooleanAsCheckBox = true
Tree.booleanRenderType = checkBox
Tree.defaultLineStyle = line
Tree.showFullRowInPopup = true
Tree.editorBorderInsets = 2,5,2,5
Tree.editorBorderInsets = 2,5,2,5
#Icons
Tree.collapsedIcon = navigation/arrowRight.svg[themed]
Tree.expandedIcon = navigation/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.collapsedIcon = navigation/arrowRight.svg[themed]
Tree.expandedIcon = navigation/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.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]

Loading…
Cancel
Save