float[] point = new float[2];
float[] bounds = new float[4];
path.getBounds(bounds);
point[0] = (bounds[0] + bounds[0] + bounds[2]) / 2f;
point[1] = (bounds[1] + bounds[1] + bounds[3]) / 2f;
GCExtension extension = new GCExtension(gc);
extension.fillGradientPath(path, point, glowColor, 255, new Color[] { glowColor },
new int[] { 0 });
path.dispose();
gc.setClipping((Region) null);
gc.setAdvanced(false);
return;
}
if (!(selected && tracked)) pattern = new Pattern(null, 0, glossy.y, 0, glossy.y
+ glossy.height, themeRender.getTool_item_bg_glossy_track1(), themeRender
.getTool_item_bg_glossy_track1_alpha(), themeRender
.getTool_item_bg_glossy_track2(), themeRender
.getTool_item_bg_glossy_track2_alpha());
else
pattern = new Pattern(null, 0, glossy.y, 0, glossy.y + glossy.height, themeRender
.getTool_item_bg_glossy_selected1(), themeRender
.getTool_item_bg_glossy_selected1_alpha(), themeRender
.getTool_item_bg_glossy_selected2(), themeRender
.getTool_item_bg_glossy_selected2_alpha());
path = GraphicsUtil.createTopRoundRectangle(glossy, 2);
gc.setBackgroundPattern(pattern);
gc.fillPath(path);
path.dispose();
Color innerBorderColor = (selected && tracked)
|| (dc.getToolItem() != null && (dc.getToolItem().getStyle() & SWT.CHECK) != 0 && dc
.getToolItem().getSelection()) ? themeRender
.getTool_item_inner_border_selected() : themeRender
.getTool_item_inner_border_track();
path = GraphicsUtil.createRoundRectangle(innerBorder, 2);
gc.setForeground(innerBorderColor);
gc.drawPath(path);
path.dispose();
if (!((menuTracked || (dc.getToolItem() != null && dc.getToolItem().getMenu() != null && !dc
.getToolItem().canSelected()))
&& selected && tracked))
{
path = GraphicsUtil.createRoundRectangle(glow, 2);
gc.setClipping(path);
path.dispose();
Color glowColor = themeRender.getTool_item_bg_glow_track();
if (dc.getToolItem() != null && (dc.getToolItem().getStyle() & SWT.CHECK) != 0
&& dc.getToolItem().getSelection())
{
if (tracked)
{
glowColor = themeRender.getTool_item_bg_checked_glow_track();
}
else
{
glowColor = themeRender.getTool_item_bg_checked_glow();
}
}
path = createBottomRadialPath(glow);
float[] point = new float[2];
float[] bounds = new float[4];
path.getBounds(bounds);
point[0] = (bounds[0] + bounds[0] + bounds[2]) / 2f;
point[1] = (bounds[1] + bounds[1] + bounds[3]) / 2f;
GCExtension extension = new GCExtension(gc);
extension.fillGradientPath(path, point, glowColor, 255, new Color[] { glowColor },
new int[] { 0 });
path.dispose();
gc.setClipping((Region) null);
}
gc.setAdvanced(false);