mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
win10: remove bold from default buttons
This commit is contained in:
@@ -162,13 +162,19 @@ public class DarculaButtonUI extends BasicButtonUI {
|
||||
@Override
|
||||
public void update(Graphics g, JComponent c) {
|
||||
super.update(g, c);
|
||||
if (isDefaultButton(c) && !SystemInfo.isMac) {
|
||||
if (!c.getFont().isBold()) {
|
||||
c.setFont(new FontUIResource(c.getFont().deriveFont(Font.BOLD)));
|
||||
if (isDefaultButton(c)) {
|
||||
setupDefaultButton((JButton)c);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setupDefaultButton(JButton button) {
|
||||
if (!SystemInfo.isMac) {
|
||||
if (!button.getFont().isBold()) {
|
||||
button.setFont(new FontUIResource(button.getFont().deriveFont(Font.BOLD)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static boolean isHelpButton(JComponent button) {
|
||||
return (SystemInfo.isMac || (SystemInfo.isWindows && Registry.is("ide.intellij.laf.win10.ui")))
|
||||
&& button instanceof JButton
|
||||
|
||||
@@ -74,6 +74,11 @@ public class WinIntelliJButtonUI extends DarculaButtonUI {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupDefaultButton(JButton button) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintDisabledText(Graphics g, String text, JComponent c, Rectangle textRect, FontMetrics metrics) {
|
||||
g.setColor(UIManager.getColor("Button.disabledText"));
|
||||
|
||||
Reference in New Issue
Block a user