mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
boreders. font is larger.
This commit is contained in:
@@ -58,13 +58,10 @@ public class IdeBorderFactory {
|
||||
}
|
||||
|
||||
public static IdeaTitledBorder createTitledBorder(String title, boolean hasBoldFont, boolean hasIndent, boolean hasSmallFont) {
|
||||
Font font = UIUtil.getBorderFont();
|
||||
Font font = UIUtil.getBorderFont(hasSmallFont ? UIUtil.FontSize.SMALL : UIUtil.FontSize.NORMAL);
|
||||
if (hasBoldFont) {
|
||||
font = font.deriveFont(Font.BOLD);
|
||||
}
|
||||
if (hasSmallFont) {
|
||||
font = UIUtil.getFont(UIUtil.FontSize.SMALL, font);
|
||||
}
|
||||
int indent = hasIndent ? (hasBoldFont ? 18 : 15) : 0;
|
||||
Insets insets = hasBoldFont ? new Insets(5,0,10,0) : new Insets(3,0,6,0);
|
||||
return new IdeaTitledBorder(title, font, UIUtil.getBorderColor(), indent, 1, insets);
|
||||
|
||||
@@ -51,9 +51,8 @@ public class TitledSeparator extends JPanel {
|
||||
setBorder(IdeBorderFactory.createEmptyBorder(3, 0, 5, 5));
|
||||
|
||||
setText(text);
|
||||
setTitleFont(UIUtil.getBorderFont());
|
||||
setBoldFont(boldFont);
|
||||
setSmallFont(smallFont);
|
||||
setBoldFont(boldFont);
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
@@ -87,7 +86,7 @@ public class TitledSeparator extends JPanel {
|
||||
|
||||
public void setSmallFont(boolean smallFont) {
|
||||
this.smallFont = smallFont;
|
||||
this.setTitleFont(UIUtil.getFont(smallFont ? UIUtil.FontSize.SMALL : UIUtil.FontSize.NORMAL, this.getTitleFont()));
|
||||
this.setTitleFont(UIUtil.getBorderFont(smallFont ? UIUtil.FontSize.SMALL : UIUtil.FontSize.NORMAL));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -289,6 +289,15 @@ public class UIUtil {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Font getBorderFont(@NotNull FontSize size) {
|
||||
Font defFont = getBorderFont();
|
||||
if (size == FontSize.SMALL) {
|
||||
return defFont.deriveFont(defFont.getSize() * 0.9f);
|
||||
}
|
||||
return defFont;
|
||||
}
|
||||
|
||||
public static Font getLabelFont() {
|
||||
return UIManager.getFont("Label.font");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user