Browse Source

Add option to disable tree popups.

pull/198/head
weisj 4 years ago
parent
commit
0205ad3d53
  1. 6
      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. 1
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/tree.properties

6
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();
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();
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

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

@ -67,6 +67,7 @@ Tree.alternateRowColor = false
Tree.renderBooleanAsCheckBox = true
Tree.booleanRenderType = checkBox
Tree.defaultLineStyle = line
Tree.showFullRowInPopup = true
Tree.editorBorderInsets = 2,5,2,5

Loading…
Cancel
Save