mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-96584 Selected radio button glitch
(cherry picked from commit 79f74a8bf5c707f3e09967def652de502e1d914f)
This commit is contained in:
+7
-8
@@ -81,32 +81,31 @@ public class DarculaRadioButtonUI extends MetalRadioButtonUI {
|
||||
final int y = iconRect.y + 2;
|
||||
final int w = iconRect.width - 4;
|
||||
final int h = iconRect.height - 4;
|
||||
final int u = w / 16;
|
||||
|
||||
g.translate(x, y);
|
||||
|
||||
//setup AA for lines
|
||||
final GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
|
||||
g.setPaint(new GradientPaint(0, 0, ColorUtil.shift(c.getBackground(), 1.5), 0, c.getHeight(), ColorUtil.shift(c.getBackground(), 1.2)));
|
||||
g.fillOval(0, 2, w - 2, h - 2);
|
||||
g.fillOval(0, 1, w - 1, h - 1);
|
||||
|
||||
if (b.hasFocus()) {
|
||||
int sysOffX = SystemInfo.isMac ? 0 : 1;
|
||||
int sysOffY = SystemInfo.isMac ? 0 : -1;
|
||||
DarculaUIUtil.paintFocusOval(g, x-6 + sysOffX, y-3 + sysOffY, w-3, h-3);
|
||||
DarculaUIUtil.paintFocusOval(g, x-6 + sysOffX, y-3 + sysOffY, w-2, h-2);
|
||||
} else {
|
||||
g.setPaint(new GradientPaint(w / 2, 1, Gray._160.withAlpha(90), w / 2, h, Gray._100.withAlpha(90)));
|
||||
g.drawOval(0, 2, w - 2, h - 2);
|
||||
g.drawOval(0, 2, w - 1, h - 1);
|
||||
|
||||
g.setPaint(Gray._40.withAlpha(200));
|
||||
g.drawOval(0, 1, w - 2, h - 2);
|
||||
g.drawOval(0, 1, w - 1, h - 1);
|
||||
}
|
||||
|
||||
if (b.isSelected()) {
|
||||
g.setColor(Gray._0.withAlpha(50));
|
||||
g.fillOval(w/2 - 3*u+1, h/2 - 3*u + 2, 5*u, 5*u);
|
||||
g.setColor(Gray._0.withAlpha(120));
|
||||
g.fillOval(w/2 - 3, h/2 - 1, 5, 5);
|
||||
g.setColor(Gray._255.withAlpha(180));
|
||||
g.fillOval(w/2 - 3*u, h/2 - 3*u + 1, 5*u, 5*u);
|
||||
g.fillOval(w/2 - 3, h/2 - 2, 5, 5);
|
||||
}
|
||||
config.restore();
|
||||
g.translate(-x, -y);
|
||||
|
||||
Reference in New Issue
Block a user