From 767d50db1d2e42682a77a23344d7815fd62ef2e5 Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Mon, 10 May 2021 13:33:35 +0300 Subject: [PATCH] Introduce named color DragAndDrop.borderColor to support theming in D-n-D for trees/lists GitOrigin-RevId: b88ad5b7e02d11f27d196ef35aa5aba99064979d --- .../src/com/intellij/ide/dnd/Highlighters.java | 8 +++++--- .../themes/metadata/IntelliJPlatform.themeMetadata.json | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/dnd/Highlighters.java b/platform/platform-impl/src/com/intellij/ide/dnd/Highlighters.java index 100bc9999a9f..991de7ec2c16 100644 --- a/platform/platform-impl/src/com/intellij/ide/dnd/Highlighters.java +++ b/platform/platform-impl/src/com/intellij/ide/dnd/Highlighters.java @@ -186,12 +186,14 @@ public class Highlighters implements DnDEvent.DropTargetHighlightingType { } } + private static final JBColor HIGHLIGHTER_COLOR = JBColor.namedColor("DragAndDrop.borderColor", JBColor.RED); + private static class FilledRectangleHighlighter extends AbstractComponentHighlighter { FilledRectangleHighlighter() { super(); setOpaque(true); - setBorder(BorderFactory.createLineBorder(JBColor.RED)); - setBackground(JBColor.RED); + setBorder(BorderFactory.createLineBorder(HIGHLIGHTER_COLOR)); + setBackground(HIGHLIGHTER_COLOR); } @Override @@ -209,7 +211,7 @@ public class Highlighters implements DnDEvent.DropTargetHighlightingType { RectangleHighlighter() { super(); setOpaque(false); - setBorder(BorderFactory.createLineBorder(JBColor.RED)); + setBorder(BorderFactory.createLineBorder(HIGHLIGHTER_COLOR)); } @Override diff --git a/platform/platform-resources/src/themes/metadata/IntelliJPlatform.themeMetadata.json b/platform/platform-resources/src/themes/metadata/IntelliJPlatform.themeMetadata.json index f290cabf7b04..14dcea57c3a2 100644 --- a/platform/platform-resources/src/themes/metadata/IntelliJPlatform.themeMetadata.json +++ b/platform/platform-resources/src/themes/metadata/IntelliJPlatform.themeMetadata.json @@ -1204,6 +1204,11 @@ "key": "StateWidget.activeBackground", "description": "Background of the state widget when at least one of the registered processes is active", "since": "2021.1" + }, + { + "key": "DragAndDrop.borderColor", + "description": "Drop position highlighting (line/rectangle) for drag-n-drop in trees and lists", + "since": "2021.2" } ] } \ No newline at end of file