IDEA-169940 Get rid of gradient popup titles

* title size and insets are changed
This commit is contained in:
Mikhail Sokolov
2018-04-16 12:58:44 +03:00
parent 6784e18894
commit c4dadde49a
2 changed files with 6 additions and 1 deletions
@@ -48,7 +48,7 @@ public class TitlePanel extends CaptionPanel {
myLabel.setForeground(JBColor.foreground());
myLabel.setHorizontalAlignment(SwingConstants.CENTER);
myLabel.setVerticalAlignment(SwingConstants.CENTER);
myLabel.setBorder(JBUI.Borders.empty(1, 2, 2, 2));
myLabel.setBorder(JBUI.Borders.empty(1, 10, 2, 10));
add(myLabel, BorderLayout.CENTER);
@@ -80,6 +80,7 @@ public class TitlePanel extends CaptionPanel {
}
final Dimension preferredSize = super.getPreferredSize();
preferredSize.height = JBUI.CurrentTheme.Popup.headerHeight();
int maxWidth = JBUI.scale(350);
if (!myHtml && preferredSize.width > maxWidth) { // do not allow caption to extend parent container
return new Dimension(maxWidth, preferredSize.height);
@@ -1536,6 +1536,10 @@ public class JBUI {
: getColor("Popup.Header.inactiveBackground", 0xededed);
}
public static int headerHeight() {
return scale(24);
}
public static Color borderColor(boolean active) {
return active
? getColor("Popup.Border.color", 0x808080)