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 @Override
protected void installListeners() { protected void installListeners() {
super.installListeners(); super.installListeners();
if (UIManager.getBoolean("Tree.showFullRowInPopup")) {
popupListener = createPopupMouseListener(); popupListener = createPopupMouseListener();
popupListener.install(); popupListener.install();
}
tree.addPropertyChangeListener(this); tree.addPropertyChangeListener(this);
tree.addMouseListener(selectionListener); tree.addMouseListener(selectionListener);
} }
@ -377,8 +379,10 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener, C
@Override @Override
protected void uninstallListeners() { protected void uninstallListeners() {
super.uninstallListeners(); super.uninstallListeners();
if (popupListener != null) {
popupListener.uninstall(); popupListener.uninstall();
popupListener = null; popupListener = null;
}
tree.removeMouseListener(selectionListener); tree.removeMouseListener(selectionListener);
tree.removePropertyChangeListener(this); tree.removePropertyChangeListener(this);
} }
@ -550,7 +554,7 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener, C
@Override @Override
public void update(final Graphics g, final JComponent c) { public void update(final Graphics g, final JComponent c) {
popupListener.repaint(); if (popupListener != null) popupListener.repaint();
super.update(g, c); 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 TextComponent.roundedSelection = roundedSelection
Button.convertIconOnlyToBorderless = borderlessIconButtons Button.convertIconOnlyToBorderless = borderlessIconButtons
Tree.defaultLineStyle = treeLineStyle Tree.defaultLineStyle = treeLineStyle
Tree.showFullRowInPopup = treeRowPopup
ToolTip.defaultStyle = tooltipStyle 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.renderBooleanAsCheckBox = true
Tree.booleanRenderType = checkBox Tree.booleanRenderType = checkBox
Tree.defaultLineStyle = line Tree.defaultLineStyle = line
Tree.showFullRowInPopup = true
Tree.editorBorderInsets = 2,5,2,5 Tree.editorBorderInsets = 2,5,2,5

Loading…
Cancel
Save