App icon is not colorized with skin - matches site logo

This commit is contained in:
Jindra Petřík
2016-01-30 21:56:17 +01:00
parent 28d9273d95
commit 1465a463a6
2 changed files with 44 additions and 19 deletions
@@ -87,11 +87,11 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
Color darkColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED).getUltraDarkColor();
Color lightColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ENABLED).shiftBackground(Color.white, 0.5).getUltraLightColor();
Color midColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getMidColor();
g2.setPaint(new LinearGradientPaint(0, 0, 0, getIconHeight(), new float[]{0f, 0.5f, 1f}, new Color[]{lightColor, midColor, darkColor}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
g2.setPaint(new LinearGradientPaint(0, 0, 0, getIconHeight(), new float[]{0f, 1f}, new Color[]{
Color.white,
Color.black
}, MultipleGradientPaint.CycleMethod.NO_CYCLE
));
Shape s = new Ellipse2D.Double(x, y, getIconWidth(), getIconHeight());
g2.fill(s);
@@ -99,11 +99,17 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
float border = (0.0625f * getIconWidth());
float wborder = (0.00625f * getIconWidth());
g2.setPaint(lightColor);
g2.setPaint(Color.white);
s = new Ellipse2D.Double(x + border, y + border, getIconWidth() - 2 * border, getIconHeight() - 2 * border);
g2.fill(s);
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2.0f, getIconHeight() / 2.0f, getIconWidth() / 2.0f - border - wborder, new float[]{0.2f, 1f}, new Color[]{lightColor, midColor}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2.0f, getIconHeight() / 2.0f, getIconWidth() / 2.0f - border - wborder, new float[]{0f, 0.42236024f, 0.69565213f, 0.97722566f, 1f}, new Color[]{
new Color(0xff, 0xff, 0xff),
new Color(0xff, 0xff, 0xff),
new Color(0xec, 0xec, 0xec),
new Color(0xb6, 0xb6, 0xb6),
new Color(0xff, 0xff, 0xff)
}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
s = new Ellipse2D.Double(x + border + wborder, y + border + wborder, getIconWidth() - 2 * border - 2 * wborder, getIconHeight() - 2 * border - 2 * wborder);
g2.fill(s);
@@ -121,11 +127,15 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
Color lightColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ROLLOVER_UNSELECTED)/*.shiftBackground(Color.white, 0.8)*/.getUltraLightColor();
/*Color lightColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.HIGHLIGHT, ComponentState.ROLLOVER_UNSELECTED).
getUltraLightColor();
Color midColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_UNSELECTED).getMidColor();
Color darkColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ROLLOVER_UNSELECTED)/*.shiftBackground(new Color(0x7c, 0x7c, 0x7c), 0.8)*/.getUltraDarkColor();
g2.setPaint(new LinearGradientPaint(0, 0, 0, getIconHeight(), new float[]{0f, 0.5f, 1f}, new Color[]{lightColor, midColor, darkColor}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
Color darkColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.BORDER, ComponentState.ROLLOVER_UNSELECTED).getUltraDarkColor();
*/
g2.setPaint(new LinearGradientPaint(0, 0, 0, getIconHeight(), new float[]{0f, 1f}, new Color[]{
Color.white,
Color.black
}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
Shape s = new Ellipse2D.Double(x, y, getIconWidth(), getIconHeight());
g2.fill(s);
@@ -133,11 +143,17 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
float border = (0.0625f * getIconWidth());
float wborder = (0.00625f * getIconWidth());
g2.setPaint(lightColor);
g2.setPaint(Color.white);
s = new Ellipse2D.Double(x + border, y + border, getIconWidth() - 2 * border, getIconHeight() - 2 * border);
g2.fill(s);
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2.0f, getIconHeight() / 2.0f, getIconWidth() / 2.0f - border - wborder, new float[]{0.2f, 1f}, new Color[]{lightColor, midColor}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2.0f, getIconHeight() / 2.0f, getIconWidth() / 2.0f - border - wborder, new float[]{0f, 0.42236024f, 0.69565213f, 0.97722566f, 1f}, new Color[]{
new Color(0xff, 0xff, 0xff),
new Color(0xff, 0xff, 0xff),
new Color(0xec, 0xec, 0xec),
new Color(0xb6, 0xb6, 0xb6),
new Color(0xff, 0xff, 0xff)
}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
s = new Ellipse2D.Double(x + border + wborder, y + border + wborder, getIconWidth() - 2 * border - 2 * wborder, getIconHeight() - 2 * border - 2 * wborder);
g2.fill(s);
super.paintIcon(c, g, x, y);
@@ -154,11 +170,14 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
Color lightColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getUltraLightColor();
/*Color lightColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getUltraLightColor();
Color midColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getMidColor();
Color darkColor = skin.getColorScheme(DecorationAreaType.SECONDARY_TITLE_PANE, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).shiftBackground(Color.black, 0.7).getUltraDarkColor();
g2.setPaint(new LinearGradientPaint(0, 0, 0, getIconHeight(), new float[]{0f, 0.5f, 1f}, new Color[]{lightColor, midColor, darkColor}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
*/
g2.setPaint(new LinearGradientPaint(0, 0, 0, getIconHeight(), new float[]{0f, 1f}, new Color[]{
Color.white,
Color.black
}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
Shape s = new Ellipse2D.Double(x, y, getIconWidth(), getIconHeight());
g2.fill(s);
@@ -166,11 +185,17 @@ public class MyRibbonApplicationMenuButtonUI extends BasicRibbonApplicationMenuB
float border = (0.0625f * getIconWidth());
float wborder = (0.00625f * getIconWidth());
g2.setPaint(lightColor);
g2.setPaint(Color.white);
s = new Ellipse2D.Double(x + border, y + border, getIconWidth() - 2 * border, getIconHeight() - 2 * border);
g2.fill(s);
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2.0f, getIconHeight() / 2.0f, getIconWidth() / 2.0f - border - wborder, new float[]{0.2f, 1f}, new Color[]{lightColor, midColor}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
g2.setPaint(new RadialGradientPaint(getIconWidth() / 2.0f, getIconHeight() / 2.0f, getIconWidth() / 2.0f - border - wborder, new float[]{0f, 0.1f, 0.5f, 0.97722566f, 1f}, new Color[]{
new Color(0xff, 0xff, 0xff),
new Color(0xff, 0xff, 0xff),
new Color(0xec, 0xec, 0xec),
new Color(0xb6, 0xb6, 0xb6),
new Color(0xff, 0xff, 0xff)
}, MultipleGradientPaint.CycleMethod.NO_CYCLE));
s = new Ellipse2D.Double(x + border + wborder, y + border + wborder, getIconWidth() - 2 * border - 2 * wborder, getIconHeight() - 2 * border - 2 * wborder);
g2.fill(s);