}
static void
-clearlooks_set_mixed_color (cairo_t *cr,
- const CairoColor *color1,
- const CairoColor *color2,
+clearlooks_set_mixed_color (cairo_t *cr,
+ const CairoColor *color1,
+ const CairoColor *color2,
gdouble mix_factor)
{
CairoColor composite;
}
static void
-clearlooks_gummy_draw_highlight_and_shade (cairo_t *cr,
+clearlooks_gummy_draw_highlight_and_shade (cairo_t *cr,
const CairoColor *bg_color,
const ShadowParameters *params,
int width, int height, gdouble radius)
cairo_set_source_rgba (cr, highlight.r, highlight.g, highlight.b, 0.5);
else
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, 0.5);
-
+
cairo_stroke (cr);
/* Bottom/Right highlight -- this includes the corners */
const WidgetParameters *params,
int width, int height, gdouble radius)
{
- CairoColor hilight;
+ CairoColor hilight;
double light_top = params->ythickness-1,
light_bottom = height - params->ythickness - 1,
cairo_translate (cr, -0.5, -0.5);
}
- clearlooks_draw_gummy_gradient (cr, xoffset+1, yoffset+1,
- width-(xoffset*2)-2, height-(yoffset*2)-2,
+ clearlooks_draw_gummy_gradient (cr, xoffset+1, yoffset+1,
+ width-(xoffset*2)-2, height-(yoffset*2)-2,
&fill, params->disabled, radius, params->corners);
/* Pressed button shadow */
cairo_save (cr);
- ge_cairo_rounded_rectangle (cr, xoffset+1, yoffset+1, width-(xoffset*2)-2, height, radius,
+ ge_cairo_rounded_rectangle (cr, xoffset+1, yoffset+1, width-(xoffset*2)-2, height, radius,
params->corners & (CR_CORNER_TOPLEFT | CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMLEFT));
cairo_clip (cr);
cairo_rectangle (cr, xoffset+1, yoffset+1, width-(xoffset*2)-2, 3);
}
else
{
- CairoColor shadow;
+ CairoColor shadow;
ge_shade_color (&border, 0.92, &shadow);
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, params->disabled ? 0.09 : 0.18);
cairo_line_to (cr, stroke_width-x_step, 0);
cairo_line_to (cr, stroke_width/2-x_step, height);
cairo_line_to (cr, -x_step, height);
-
+
cairo_translate (cr, stroke_width, 0);
tile_pos += stroke_width;
}
cairo_translate (cr, 1, 1);
if (!slider->lower && !slider->fill_level)
- clearlooks_gummy_scale_draw_gradient (cr,
+ clearlooks_gummy_scale_draw_gradient (cr,
&colors->shade[2], /* bottom */
&colors->shade[6], /* border */
0, 0, trough_width, trough_height,
slider->horizontal, TRUE);
else if (!slider->fill_level)
- clearlooks_gummy_scale_draw_gradient (cr,
+ clearlooks_gummy_scale_draw_gradient (cr,
&colors->spot[1], /* bottom */
&colors->spot[2], /* border */
0, 0, trough_width, trough_height,
c1.a = 0.25;
c2.a = 0.25;
- clearlooks_gummy_scale_draw_gradient (cr,
+ clearlooks_gummy_scale_draw_gradient (cr,
&c1, /* bottom */
&c2, /* border */
0, 0, trough_width, trough_height,
cairo_pattern_t *pattern;
double radius;
- double strip_size;
radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
if (tab->gap_side == CL_GAP_TOP || tab->gap_side == CL_GAP_BOTTOM)
{
height += 3.0;
- strip_size = 2.0/height; /* 2 pixel high strip */
if (tab->gap_side == CL_GAP_TOP)
cairo_translate (cr, 0.0, -3.0); /* gap at the other side */
else
{
width += 3.0;
- strip_size = 2.0/width;
- if (tab->gap_side == CL_GAP_LEFT)
+ if (tab->gap_side == CL_GAP_LEFT)
cairo_translate (cr, -3.0, 0.0); /* gap at the other side */
}
const SeparatorParameters *separator,
int x, int y, int width, int height)
{
- (void) widget;
-
- CairoColor color = colors->shade[3];
CairoColor hilight;
+ CairoColor color = colors->shade[3];
+
+ (void) widget;
ge_shade_color (&color, 1.3, &hilight);
cairo_save (cr);
int bar_x, i;
int shift_x;
- cairo_set_line_width (cr, 1.0);
+ cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x, y);
cairo_translate (cr, -0.5, -0.5);
CairoColor fill;
CairoColor shade1, shade2, shade3;
cairo_pattern_t *pattern;
- ShadowParameters shadow;
double radius = MIN (widget->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
if (scrollbar->horizontal)
fill = colors->bg[widget->state_type];
ge_shade_color(&fill, SHADE_TOP, &shade1);
- ge_shade_color(&fill, SHADE_CENTER_TOP, &shade2);
- ge_shade_color(&fill, SHADE_BOTTOM, &shade3);
+ ge_shade_color(&fill, SHADE_CENTER_TOP, &shade2);
+ ge_shade_color(&fill, SHADE_BOTTOM, &shade3);
cairo_pattern_add_color_stop_rgb(pattern, 0, shade1.r, shade1.g, shade1.b);
cairo_pattern_add_color_stop_rgb(pattern, 0.5, shade2.r, shade2.g, shade2.b);
cairo_stroke (cr);
cairo_translate (cr, 0.5, 0.5);
- shadow.shadow = CL_SHADOW_OUT;
- shadow.corners = corners;
}
static void
cairo_fill (cr);
cairo_pattern_destroy (pattern);
- if (scrollbar->has_color)
+ if (scrollbar->has_color)
{
cairo_set_source_rgba (cr, hilight.r, hilight.g, hilight.b, 0.2);
ge_cairo_stroke_rectangle (cr, 1.5, 1.5, width-3, height-3);
const ToolbarParameters *toolbar,
int x, int y, int width, int height)
{
- (void) widget;
-
- const CairoColor *fill = &colors->bg[GTK_STATE_NORMAL];
- const CairoColor *dark = &colors->shade[3];
CairoColor light;
+ const CairoColor *dark;
+ const CairoColor *fill = &colors->bg[GTK_STATE_NORMAL];
+
+ (void) widget;
+
+ dark = &colors->shade[3];
+
ge_shade_color (fill, toolbar->style == 1 ? 1.1 : 1.05, &light);
cairo_set_line_width (cr, 1.0);
const WidgetParameters *widget,
int x, int y, int width, int height)
{
+ CairoColor hilight;
+ const CairoColor *dark = &colors->shade[3];
+
(void) widget;
(void) height;
- const CairoColor *dark = &colors->shade[3];
- CairoColor hilight;
-
ge_shade_color (dark, 1.3, &hilight);
cairo_set_line_width (cr, 1);
const CheckboxParameters *checkbox,
int x, int y, int width, int height)
{
- (void) width;
- (void) height;
-
const CairoColor *border;
const CairoColor *dot;
CairoColor shadow;
CairoColor highlight;
cairo_pattern_t *pt;
gboolean inconsistent;
- gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
+ gboolean draw_bullet = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_IN);
- inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
+ (void) width;
+ (void) height;
+
+ inconsistent = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_ETCHED_IN);
draw_bullet |= inconsistent;
if (widget->disabled)
int x, int y, int width, int height)
{
const CairoColor *border;
- const CairoColor *dot;
+ const CairoColor *dot;
gboolean inconsistent = FALSE;
- gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
+ gboolean draw_bullet = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_IN);
- inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
+ inconsistent = (checkbox->shadow_type == (ClearlooksShadowType)GTK_SHADOW_ETCHED_IN);
draw_bullet |= inconsistent;
if (widget->disabled)
{
if (widget->prelight)
border = &colors->spot[2];
- else
+ else
border = &colors->shade[6];
dot = &colors->text[GTK_STATE_NORMAL];
}
if (widget->xthickness > 2 && widget->ythickness > 2)
{
- widget->style_functions->draw_inset (cr, &widget->parentbg, 0.5, 0.5,
+ widget->style_functions->draw_inset (cr, &widget->parentbg, 0.5, 0.5,
width-1, height-1, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
-
+
/* Draw the rectangle for the checkbox itself */
- ge_cairo_rounded_rectangle (cr, 1.5, 1.5,
+ ge_cairo_rounded_rectangle (cr, 1.5, 1.5,
width-3, height-3, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
}
else
{
/* Draw the rectangle for the checkbox itself */
- ge_cairo_rounded_rectangle (cr, 0.5, 0.5,
+ ge_cairo_rounded_rectangle (cr, 0.5, 0.5,
width-1, height-1, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
}
-
+
if (!widget->disabled)
- {
+ {
if (widget->prelight)
clearlooks_set_mixed_color (cr, &colors->base[0], &colors->spot[1], 0.5);
- else
+ else
ge_cairo_set_color (cr, &colors->base[0]);
cairo_fill_preserve (cr);
}