Support custom background for popup title

GitOrigin-RevId: 6b46f47e59d47da0928fb681bb76693d9703e46d
This commit is contained in:
Vassiliy.Kudryashov
2019-12-17 12:36:49 +00:00
committed by intellij-monorepo-bot
parent 50fe9f538b
commit dd603b4a8c
2 changed files with 7 additions and 2 deletions
@@ -64,6 +64,7 @@ public class BranchActionGroupPopup extends FlatSpeedSearchPopup {
@Nullable String dimensionKey) {
super(title, createBranchSpeedSearchActionGroup(actions), SimpleDataContext.getProjectContext(project),
preselectActionCondition, true);
getTitle().setBackground(JBColor.PanelBackground);
myProject = project;
DataManager.registerDataProvider(getList(), dataId -> POPUP_MODEL.is(dataId) ? getListModel() : null);
myKey = dimensionKey;
@@ -24,6 +24,7 @@ public class CaptionPanel extends JPanel {
public CaptionPanel() {
setLayout(new BorderLayout());
setBackground(null);
}
@Override
@@ -31,8 +32,11 @@ public class CaptionPanel extends JPanel {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
g2d.setPaint(JBUI.CurrentTheme.Popup.headerBackground(myActive));
Color background = getBackground();
if (background == null) {
background = JBUI.CurrentTheme.Popup.headerBackground(myActive);
}
g2d.setColor(background);
g2d.fillRect(0, 0, getWidth(), getHeight());
}