From e9ddb1d7c7f0114fe6c2ff97503a65b0452a076f Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Wed, 15 Mar 2017 17:42:52 +0300 Subject: [PATCH] [push]: (IDEA-166338) Push dialog: change selection color for new label --- plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java b/plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java index 5f8fd5b3a0b9..310ff88234ed 100644 --- a/plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java +++ b/plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java @@ -38,6 +38,7 @@ import com.intellij.ui.components.JBLabel; import com.intellij.ui.popup.list.ListPopupImpl; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.JBUI; +import com.intellij.util.ui.UIUtil; import com.intellij.util.ui.table.ComponentsListFocusTraversalPolicy; import git4idea.GitRemoteBranch; import git4idea.commands.Git; @@ -67,7 +68,10 @@ public class GitPushTargetPanel extends PushTargetPanel { private static final Comparator REMOTE_BRANCH_COMPARATOR = new MyRemoteBranchComparator(); private static final String SEPARATOR = " : "; private static final Color NEW_BRANCH_LABEL_FG = new JBColor(0x00b53d, 0x6ba65d); + private static final Color NEW_BRANCH_SELECTION_LABEL_FG = UIUtil.getTreeSelectionForeground(); private static final Color NEW_BRANCH_LABEL_BG = new JBColor(0xebfcf1, 0x313b32); + private static final Color NEW_BRANCH_SELECTION_LABEL__BG = + new JBColor(ColorUtil.toAlpha(NEW_BRANCH_SELECTION_LABEL_FG, 20), ColorUtil.toAlpha(NEW_BRANCH_SELECTION_LABEL_FG, 30)); private static final RelativeFont NEW_BRANCH_LABEL_FONT = RelativeFont.TINY.small(); private static final TextIcon NEW_BRANCH_LABEL = new TextIcon("New", NEW_BRANCH_LABEL_FG, NEW_BRANCH_LABEL_BG, 0); @@ -278,6 +282,8 @@ public class GitPushTargetPanel extends PushTargetPanel { NEW_BRANCH_LABEL.setInsets(JBUI.insets(2)); NEW_BRANCH_LABEL.setRound(JBUI.scale(4)); NEW_BRANCH_LABEL.setFont(NEW_BRANCH_LABEL_FONT.derive(renderer.getFont())); + NEW_BRANCH_LABEL.setForeground(isSelected ? NEW_BRANCH_SELECTION_LABEL_FG : NEW_BRANCH_LABEL_FG); + NEW_BRANCH_LABEL.setBackground(isSelected ? NEW_BRANCH_SELECTION_LABEL__BG : NEW_BRANCH_LABEL_BG); renderer.setIcon(NEW_BRANCH_LABEL); } }