From b99b0b9ad4b7a896336114560344f825f6a78dc9 Mon Sep 17 00:00:00 2001 From: weisj Date: Sun, 8 Mar 2020 22:42:36 +0100 Subject: [PATCH] Fixed focus background when tree was obscured by popupmenu. --- .../java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java index 809cb148..5a0d60a4 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java @@ -323,7 +323,7 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener { && Boolean.TRUE.equals(((JComponent) owner).getClientProperty("JToggleButton.isTreeCellEditor")); boolean treeRenderer = owner instanceof JComponent && Boolean.TRUE.equals(((JComponent) owner).getClientProperty("JToggleButton.isTreeCellRenderer")); - return owner == null || treeEditor || treeRenderer; + return treeEditor || treeRenderer; } return true; } @@ -363,7 +363,6 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener { if (treeState == null) { return; } - Rectangle paintBounds = g.getClipBounds(); Insets insets = tree.getInsets(); @@ -501,7 +500,7 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener { protected Color getRowBackground(final int row, final boolean selected) { if (selected) { boolean isTableTree = Boolean.TRUE.equals(tree.getClientProperty(TREE_TABLE_TREE_KEY)); - return getTreeSelectionBackground(tree.hasFocus() || isTableTree || tree.isEditing()); + return getTreeSelectionBackground(hasFocus() || isTableTree || tree.isEditing()); } if (Boolean.TRUE.equals(tree.getClientProperty(STRIPED_CLIENT_PROPERTY)) && row % 2 == 1) { return alternativeBackground;