mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Set font to Graphics in DarculaButtonUI
GitOrigin-RevId: f4687ae2db958d56995604e1410e9bbfa2d03de4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
56d7011548
commit
5ac4802e3b
@@ -260,16 +260,14 @@ public class DarculaButtonUI extends BasicButtonUI {
|
||||
|
||||
@Override
|
||||
public void update(Graphics g, JComponent c) {
|
||||
setupDefaultButton(c, g);
|
||||
super.update(g, c);
|
||||
setupDefaultButton((JButton)c);
|
||||
}
|
||||
|
||||
protected void setupDefaultButton(JButton button) {
|
||||
if (!SystemInfo.isMac) {
|
||||
Font f = new FontUIResource(isDefaultButton(button) ?
|
||||
button.getFont().deriveFont(Font.BOLD) :
|
||||
button.getFont().deriveFont(Font.PLAIN));
|
||||
button.setFont(f);
|
||||
protected void setupDefaultButton(JComponent button, Graphics g) {
|
||||
Font f = button.getFont();
|
||||
if (!SystemInfo.isMac && f instanceof FontUIResource) {
|
||||
g.setFont(isDefaultButton(button) ? f.deriveFont(Font.BOLD) : f.deriveFont(Font.PLAIN));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ public class WinIntelliJButtonUI extends DarculaButtonUI {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupDefaultButton(JButton button) {}
|
||||
protected void setupDefaultButton(JComponent button, Graphics g) {}
|
||||
|
||||
@Override
|
||||
protected void paintDisabledText(Graphics g, String text, JComponent c, Rectangle textRect, FontMetrics metrics) {
|
||||
|
||||
Reference in New Issue
Block a user