mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-224710: do not show lead selection for unfocused list or tree
GitOrigin-RevId: 5fa131ccb91e5c3827b4e8db09d88d866806d84a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6b59be105b
commit
e84885999b
@@ -56,7 +56,7 @@ public final class WideSelectionListUI extends BasicListUI {
|
||||
}
|
||||
}
|
||||
super.paintCell(g, row, rowBounds, renderer, model, selectionModel, leadSelectionIndex);
|
||||
if (!selected && row == leadSelectionIndex && g instanceof Graphics2D) {
|
||||
if (!selected && row == leadSelectionIndex && g instanceof Graphics2D && list.hasFocus()) {
|
||||
g.setColor(UIUtil.getListSelectionBackground(true));
|
||||
if (JList.VERTICAL == list.getLayoutOrientation()) {
|
||||
int viewportX = 0;
|
||||
|
||||
@@ -238,7 +238,7 @@ public final class DefaultTreeUI extends BasicTreeUI {
|
||||
rendererPane.paintComponent(g, component, tree, insets.left + offset, bounds.y, width, bounds.height, true);
|
||||
}
|
||||
}
|
||||
if (!selected && lead && g instanceof Graphics2D) {
|
||||
if (!selected && lead && focused && g instanceof Graphics2D) {
|
||||
g.setColor(getBackground(tree, path, row, true));
|
||||
DRAW.paint((Graphics2D)g, viewportX, bounds.y, viewportWidth, bounds.height, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user