From a68e9930b4c0a9b36a6e54d2f768a15117b99fd0 Mon Sep 17 00:00:00 2001 From: weisj Date: Sun, 26 Jul 2020 21:26:27 +0200 Subject: [PATCH] Provide method to obtain alternative background color. --- .../github/weisj/darklaf/ui/cell/CellUtil.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/cell/CellUtil.java b/core/src/main/java/com/github/weisj/darklaf/ui/cell/CellUtil.java index 4e29bf6e..9760f24a 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/cell/CellUtil.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/cell/CellUtil.java @@ -410,11 +410,20 @@ public class CellUtil { } public static void setupStandardBackground(final Component comp, final JComponent parent, final boolean selected) { + setupStandardBackground(comp, parent, selected, false); + } + + public static void setupStandardBackground(final Component comp, final JComponent parent, + final boolean selected, final boolean alt) { setupBackground(comp, getColor(comp, hasFocus(parent, comp), selected, - cellBackground, cellBackgroundSelected, - cellBackgroundNoFocus, cellBackgroundSelectedNoFocus, - cellInactiveBackground, cellInactiveBackgroundSelected, - cellInactiveBackgroundNoFocus, cellInactiveBackgroundSelectedNoFocus)); + alt ? cellBackgroundAlternative : cellBackground, + cellBackgroundSelected, + alt ? cellBackgroundNoFocusAlternative : cellBackgroundNoFocus, + cellBackgroundSelectedNoFocus, + alt ? cellInactiveBackgroundAlternative : cellInactiveBackground, + cellInactiveBackgroundSelected, + alt ? cellInactiveBackgroundNoFocusAlternative : cellInactiveBackgroundNoFocus, + cellInactiveBackgroundSelectedNoFocus)); } public static void setupBackground(final Component comp, final Color c) {