mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[push]: (IDEA-166338) Push dialog: change selection color for new label
This commit is contained in:
@@ -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<GitPushTarget> {
|
||||
private static final Comparator<GitRemoteBranch> 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<GitPushTarget> {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user