Tune DragAndDrop.rowBackground after designer's review

GitOrigin-RevId: 0f206b4f7e4e0f42608bfd761e7d5799018990dc
This commit is contained in:
Sergey Malenkov
2021-08-02 12:16:45 +00:00
committed by intellij-monorepo-bot
parent 4342ea0083
commit 0954195598
7 changed files with 15 additions and 6 deletions
@@ -224,7 +224,7 @@ public class Highlighters implements DnDEvent.DropTargetHighlightingType {
@Override
protected void paintComponent(Graphics g) {
g.setColor(JBUI.CurrentTheme.DragAndDrop.Area.BACKGROUND);
g.setColor(JBUI.CurrentTheme.DragAndDrop.ROW_BACKGROUND);
g.fillRect(0, 0, getWidth(), getHeight());
super.paintComponent(g);
}
@@ -133,6 +133,7 @@
"DragAndDrop": {
"borderColor": "#2F65CA",
"rowBackground": "#2F65CA33",
"areaBackground": "#FFFFFF33",
"areaBorderColor": "#4F73A8",
"areaForeground": "#BABABA"
@@ -172,6 +172,7 @@
"DragAndDrop": {
"borderColor": "#2675BF",
"rowBackground": "#2675BF26",
"areaBackground": "#3d7dcc33",
"areaBorderColor": "#8ab2de",
"areaForeground": "#787878"
@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ui.tree.ui;
import com.intellij.ide.ui.UISettings;
@@ -11,7 +11,6 @@ import com.intellij.ui.DirtyUI;
import com.intellij.ui.ComponentUtil;
import com.intellij.ui.LoadingNode;
import com.intellij.ui.hover.TreeHoverListener;
import com.intellij.ui.paint.RectanglePainter;
import com.intellij.ui.render.RenderingHelper;
import com.intellij.ui.render.RenderingUtil;
import com.intellij.ui.tree.AsyncTreeModel;
@@ -51,6 +50,7 @@ import static com.intellij.openapi.util.SystemInfo.isMac;
import static com.intellij.openapi.util.registry.Registry.intValue;
import static com.intellij.openapi.util.registry.Registry.is;
import static com.intellij.ui.paint.RectanglePainter.DRAW;
import static com.intellij.ui.paint.RectanglePainter.FILL;
import static com.intellij.util.EditSourceOnDoubleClickHandler.isExpandPreferable;
import static com.intellij.util.ReflectionUtil.getMethod;
import static com.intellij.util.containers.ContainerUtil.createWeakSet;
@@ -270,10 +270,10 @@ public final class DefaultTreeUI extends BasicTreeUI {
JTree.DropLocation dropLocation = tree.getDropLocation();
if (dropLocation != null && g instanceof Graphics2D && path.equals(dropLocation.getPath())) {
// paint a dragged tree path in accordance to Highlighters.RectangleHighlighter
g.setColor(JBUI.CurrentTheme.DragAndDrop.Area.BACKGROUND);
RectanglePainter.FILL.paint((Graphics2D)g, helper.getX(), bounds.y, helper.getWidth(), bounds.height, 0);
g.setColor(JBUI.CurrentTheme.DragAndDrop.ROW_BACKGROUND);
FILL.paint((Graphics2D)g, helper.getX(), bounds.y, helper.getWidth(), bounds.height, 0);
g.setColor(JBUI.CurrentTheme.DragAndDrop.BORDER_COLOR);
RectanglePainter.DRAW.paint((Graphics2D)g, helper.getX(), bounds.y, helper.getWidth(), bounds.height, 0);
DRAW.paint((Graphics2D)g, helper.getX(), bounds.y, helper.getWidth(), bounds.height, 0);
}
}
if ((bounds.y + bounds.height) >= maxPaintY) break;
@@ -112,6 +112,7 @@
"DragAndDrop": {
"borderColor": "#3366FF",
"rowBackground": "#3366FF80",
"areaForeground": "#FFFFFF",
"areaBackground": "#00EAFF7F",
"areaBorderColor": "#1AEBFF"
@@ -1236,6 +1236,11 @@
"description": "Drop position highlighting (line/rectangle) for drag-n-drop in trees and lists",
"since": "2021.2"
},
{
"key": "DragAndDrop.rowBackground",
"description": "Drop position highlighting (rectangle) for drag-n-drop in trees and lists",
"since": "2021.3"
},
{
"key": "Label.successForeground",
"description": "Foreground for successful state/text",
@@ -660,6 +660,7 @@ public class JBUI {
public interface DragAndDrop {
Color BORDER_COLOR = JBColor.namedColor("DragAndDrop.borderColor", 0x2675BF, 0x2F65CA);
Color ROW_BACKGROUND = JBColor.namedColor("DragAndDrop.rowBackground", 0x2675BF26, 0x2F65CA33);
interface Area {
Color FOREGROUND = JBColor.namedColor("DragAndDrop.areaForeground", 0x787878, 0xBABABA);