Undo incorrect sample/frame replacements in clearlooks
This commit is contained in:
parent
46f0b75e12
commit
f4c5e21a7a
@ -1042,61 +1042,61 @@ clearlooks_draw_menubar (cairo_t *cr,
|
||||
}
|
||||
|
||||
static void
|
||||
clearlooks_get_sample_gap_clip (int x, int y, int width, int height,
|
||||
const FrameParameters *sample,
|
||||
clearlooks_get_frame_gap_clip (int x, int y, int width, int height,
|
||||
const FrameParameters *frame,
|
||||
ClearlooksRectangle *bevel,
|
||||
ClearlooksRectangle *border)
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
if (sample->gap_side == CL_GAP_TOP)
|
||||
if (frame->gap_side == CL_GAP_TOP)
|
||||
{
|
||||
CLEARLOOKS_RECTANGLE_SET ((*bevel), 1.5 + sample->gap_x, -0.5,
|
||||
sample->gap_width - 3, 2.0);
|
||||
CLEARLOOKS_RECTANGLE_SET ((*border), 0.5 + sample->gap_x, -0.5,
|
||||
sample->gap_width - 2, 2.0);
|
||||
CLEARLOOKS_RECTANGLE_SET ((*bevel), 1.5 + frame->gap_x, -0.5,
|
||||
frame->gap_width - 3, 2.0);
|
||||
CLEARLOOKS_RECTANGLE_SET ((*border), 0.5 + frame->gap_x, -0.5,
|
||||
frame->gap_width - 2, 2.0);
|
||||
}
|
||||
else if (sample->gap_side == CL_GAP_BOTTOM)
|
||||
else if (frame->gap_side == CL_GAP_BOTTOM)
|
||||
{
|
||||
CLEARLOOKS_RECTANGLE_SET ((*bevel), 1.5 + sample->gap_x, height - 2.5,
|
||||
sample->gap_width - 3, 2.0);
|
||||
CLEARLOOKS_RECTANGLE_SET ((*border), 0.5 + sample->gap_x, height - 1.5,
|
||||
sample->gap_width - 2, 2.0);
|
||||
CLEARLOOKS_RECTANGLE_SET ((*bevel), 1.5 + frame->gap_x, height - 2.5,
|
||||
frame->gap_width - 3, 2.0);
|
||||
CLEARLOOKS_RECTANGLE_SET ((*border), 0.5 + frame->gap_x, height - 1.5,
|
||||
frame->gap_width - 2, 2.0);
|
||||
}
|
||||
else if (sample->gap_side == CL_GAP_LEFT)
|
||||
else if (frame->gap_side == CL_GAP_LEFT)
|
||||
{
|
||||
CLEARLOOKS_RECTANGLE_SET ((*bevel), -0.5, 1.5 + sample->gap_x,
|
||||
2.0, sample->gap_width - 3);
|
||||
CLEARLOOKS_RECTANGLE_SET ((*border), -0.5, 0.5 + sample->gap_x,
|
||||
1.0, sample->gap_width - 2);
|
||||
CLEARLOOKS_RECTANGLE_SET ((*bevel), -0.5, 1.5 + frame->gap_x,
|
||||
2.0, frame->gap_width - 3);
|
||||
CLEARLOOKS_RECTANGLE_SET ((*border), -0.5, 0.5 + frame->gap_x,
|
||||
1.0, frame->gap_width - 2);
|
||||
}
|
||||
else if (sample->gap_side == CL_GAP_RIGHT)
|
||||
else if (frame->gap_side == CL_GAP_RIGHT)
|
||||
{
|
||||
CLEARLOOKS_RECTANGLE_SET ((*bevel), width - 2.5, 1.5 + sample->gap_x,
|
||||
2.0, sample->gap_width - 3);
|
||||
CLEARLOOKS_RECTANGLE_SET ((*border), width - 1.5, 0.5 + sample->gap_x,
|
||||
1.0, sample->gap_width - 2);
|
||||
CLEARLOOKS_RECTANGLE_SET ((*bevel), width - 2.5, 1.5 + frame->gap_x,
|
||||
2.0, frame->gap_width - 3);
|
||||
CLEARLOOKS_RECTANGLE_SET ((*border), width - 1.5, 0.5 + frame->gap_x,
|
||||
1.0, frame->gap_width - 2);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clearlooks_draw_sample (cairo_t *cr,
|
||||
clearlooks_draw_frame (cairo_t *cr,
|
||||
const ClearlooksColors *colors,
|
||||
const WidgetParameters *params,
|
||||
const FrameParameters *sample,
|
||||
const FrameParameters *frame,
|
||||
int x, int y, int width, int height)
|
||||
{
|
||||
const CairoColor *border = sample->border;
|
||||
const CairoColor *border = frame->border;
|
||||
const CairoColor *dark = (const CairoColor*)&colors->shade[4];
|
||||
ClearlooksRectangle bevel_clip = {0, 0, 0, 0};
|
||||
ClearlooksRectangle sample_clip = {0, 0, 0, 0};
|
||||
ClearlooksRectangle frame_clip = {0, 0, 0, 0};
|
||||
double radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
|
||||
CairoColor hilight;
|
||||
|
||||
ge_shade_color (&colors->bg[GTK_STATE_NORMAL], 1.05, &hilight);
|
||||
|
||||
if (sample->shadow == CL_SHADOW_NONE) {
|
||||
if (frame->shadow == CL_SHADOW_NONE) {
|
||||
const CairoColor *bg = &colors->bg[params->state_type];
|
||||
ge_cairo_set_color (cr, bg);
|
||||
cairo_rectangle (cr, x + 1.5, y + 1.5, width - 3, height - 3);
|
||||
@ -1105,9 +1105,9 @@ clearlooks_draw_sample (cairo_t *cr,
|
||||
return;
|
||||
}
|
||||
|
||||
if (sample->gap_x != -1)
|
||||
clearlooks_get_sample_gap_clip (x, y, width, height,
|
||||
sample, &bevel_clip, &sample_clip);
|
||||
if (frame->gap_x != -1)
|
||||
clearlooks_get_frame_gap_clip (x, y, width, height,
|
||||
frame, &bevel_clip, &frame_clip);
|
||||
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
cairo_translate (cr, x+0.5, y+0.5);
|
||||
@ -1115,7 +1115,7 @@ clearlooks_draw_sample (cairo_t *cr,
|
||||
/* save everything */
|
||||
cairo_save (cr);
|
||||
/* Set clip for the bevel */
|
||||
if (sample->gap_x != -1)
|
||||
if (frame->gap_x != -1)
|
||||
{
|
||||
/* Set clip for gap */
|
||||
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
|
||||
@ -1125,40 +1125,40 @@ clearlooks_draw_sample (cairo_t *cr,
|
||||
}
|
||||
|
||||
/* Draw the bevel */
|
||||
if (sample->shadow == CL_SHADOW_ETCHED_IN || sample->shadow == CL_SHADOW_ETCHED_OUT)
|
||||
if (frame->shadow == CL_SHADOW_ETCHED_IN || frame->shadow == CL_SHADOW_ETCHED_OUT)
|
||||
{
|
||||
ge_cairo_set_color (cr, &hilight);
|
||||
if (sample->shadow == CL_SHADOW_ETCHED_IN)
|
||||
if (frame->shadow == CL_SHADOW_ETCHED_IN)
|
||||
ge_cairo_rounded_rectangle (cr, 1, 1, width-2, height-2, radius, params->corners);
|
||||
else
|
||||
ge_cairo_rounded_rectangle (cr, 0, 0, width-2, height-2, radius, params->corners);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
else if (sample->shadow != CL_SHADOW_NONE)
|
||||
else if (frame->shadow != CL_SHADOW_NONE)
|
||||
{
|
||||
ShadowParameters shadow;
|
||||
shadow.corners = params->corners;
|
||||
shadow.shadow = sample->shadow;
|
||||
shadow.shadow = frame->shadow;
|
||||
clearlooks_draw_highlight_and_shade (cr, colors, &shadow, width, height, 0);
|
||||
}
|
||||
|
||||
/* restore the previous clip region */
|
||||
cairo_restore (cr);
|
||||
cairo_save (cr);
|
||||
if (sample->gap_x != -1)
|
||||
if (frame->gap_x != -1)
|
||||
{
|
||||
/* Set clip for gap */
|
||||
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
|
||||
cairo_rectangle (cr, -0.5, -0.5, width, height);
|
||||
cairo_rectangle (cr, sample_clip.x, sample_clip.y, sample_clip.width, sample_clip.height);
|
||||
cairo_rectangle (cr, frame_clip.x, frame_clip.y, frame_clip.width, frame_clip.height);
|
||||
cairo_clip (cr);
|
||||
}
|
||||
|
||||
/* Draw sample */
|
||||
if (sample->shadow == CL_SHADOW_ETCHED_IN || sample->shadow == CL_SHADOW_ETCHED_OUT)
|
||||
/* Draw frame */
|
||||
if (frame->shadow == CL_SHADOW_ETCHED_IN || frame->shadow == CL_SHADOW_ETCHED_OUT)
|
||||
{
|
||||
ge_cairo_set_color (cr, dark);
|
||||
if (sample->shadow == CL_SHADOW_ETCHED_IN)
|
||||
if (frame->shadow == CL_SHADOW_ETCHED_IN)
|
||||
ge_cairo_rounded_rectangle (cr, 0, 0, width-2, height-2, radius, params->corners);
|
||||
else
|
||||
ge_cairo_rounded_rectangle (cr, 1, 1, width-2, height-2, radius, params->corners);
|
||||
@ -1839,7 +1839,7 @@ clearlooks_draw_statusbar (cairo_t *cr,
|
||||
}
|
||||
|
||||
static void
|
||||
clearlooks_draw_menu_sample (cairo_t *cr,
|
||||
clearlooks_draw_menu_frame (cairo_t *cr,
|
||||
const ClearlooksColors *colors,
|
||||
const WidgetParameters *widget,
|
||||
int x, int y, int width, int height)
|
||||
@ -2283,7 +2283,7 @@ clearlooks_register_style_classic (ClearlooksStyleFunctions *functions)
|
||||
functions->draw_inset = clearlooks_draw_inset;
|
||||
functions->draw_menubar = clearlooks_draw_menubar;
|
||||
functions->draw_tab = clearlooks_draw_tab;
|
||||
functions->draw_sample = clearlooks_draw_sample;
|
||||
functions->draw_frame = clearlooks_draw_frame;
|
||||
functions->draw_separator = clearlooks_draw_separator;
|
||||
functions->draw_menu_item_separator = clearlooks_draw_menu_item_separator;
|
||||
functions->draw_list_view_header = clearlooks_draw_list_view_header;
|
||||
@ -2295,7 +2295,7 @@ clearlooks_register_style_classic (ClearlooksStyleFunctions *functions)
|
||||
functions->draw_scrollbar_slider = clearlooks_draw_scrollbar_slider;
|
||||
functions->draw_scrollbar_trough = clearlooks_draw_scrollbar_trough;
|
||||
functions->draw_statusbar = clearlooks_draw_statusbar;
|
||||
functions->draw_menu_sample = clearlooks_draw_menu_sample;
|
||||
functions->draw_menu_frame = clearlooks_draw_menu_frame;
|
||||
functions->draw_tooltip = clearlooks_draw_tooltip;
|
||||
functions->draw_handle = clearlooks_draw_handle;
|
||||
functions->draw_resize_grip = clearlooks_draw_resize_grip;
|
||||
|
@ -200,16 +200,16 @@ clearlooks_style_draw_shadow (DRAW_ARGS)
|
||||
else if (DETAIL ("frame"))
|
||||
{
|
||||
WidgetParameters params;
|
||||
FrameParameters sample;
|
||||
sample.shadow = shadow_type;
|
||||
sample.gap_x = -1; /* No gap will be drawn */
|
||||
sample.border = &colors->shade[4];
|
||||
FrameParameters frame;
|
||||
frame.shadow = shadow_type;
|
||||
frame.gap_x = -1; /* No gap will be drawn */
|
||||
frame.border = &colors->shade[4];
|
||||
|
||||
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
|
||||
params.corners = CR_CORNER_NONE;
|
||||
|
||||
if (widget && !g_str_equal ("XfcePanelWindow", gtk_widget_get_name (gtk_widget_get_toplevel (widget))))
|
||||
STYLE_FUNCTION(draw_sample) (cr, colors, ¶ms, &sample,
|
||||
STYLE_FUNCTION(draw_frame) (cr, colors, ¶ms, &frame,
|
||||
x, y, width, height);
|
||||
}
|
||||
else if (DETAIL ("scrolled_window") || DETAIL ("viewport") || detail == NULL)
|
||||
@ -223,15 +223,15 @@ clearlooks_style_draw_shadow (DRAW_ARGS)
|
||||
else
|
||||
{
|
||||
WidgetParameters params;
|
||||
FrameParameters sample;
|
||||
FrameParameters frame;
|
||||
|
||||
sample.shadow = shadow_type;
|
||||
sample.gap_x = -1;
|
||||
sample.border = &colors->shade[5];
|
||||
frame.shadow = shadow_type;
|
||||
frame.gap_x = -1;
|
||||
frame.border = &colors->shade[5];
|
||||
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
|
||||
params.corners = CR_CORNER_ALL;
|
||||
|
||||
STYLE_FUNCTION(draw_sample) (cr, colors, ¶ms, &sample, x, y, width, height);
|
||||
STYLE_FUNCTION(draw_frame) (cr, colors, ¶ms, &frame, x, y, width, height);
|
||||
}
|
||||
|
||||
cairo_destroy (cr);
|
||||
@ -255,14 +255,14 @@ clearlooks_style_draw_box_gap (DRAW_ARGS,
|
||||
if (DETAIL ("notebook"))
|
||||
{
|
||||
WidgetParameters params;
|
||||
FrameParameters sample;
|
||||
FrameParameters frame;
|
||||
gboolean start, end;
|
||||
|
||||
sample.shadow = shadow_type;
|
||||
sample.gap_side = gap_side;
|
||||
sample.gap_x = gap_x;
|
||||
sample.gap_width = gap_width;
|
||||
sample.border = &colors->shade[5];
|
||||
frame.shadow = shadow_type;
|
||||
frame.gap_side = gap_side;
|
||||
frame.gap_x = gap_x;
|
||||
frame.gap_width = gap_width;
|
||||
frame.border = &colors->shade[5];
|
||||
|
||||
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
|
||||
|
||||
@ -315,7 +315,7 @@ clearlooks_style_draw_box_gap (DRAW_ARGS,
|
||||
ge_cairo_set_color (cr, &colors->bg[GTK_STATE_NORMAL]);
|
||||
cairo_fill (cr);
|
||||
|
||||
STYLE_FUNCTION(draw_sample) (cr, colors, ¶ms, &sample,
|
||||
STYLE_FUNCTION(draw_frame) (cr, colors, ¶ms, &frame,
|
||||
x, y, width, height);
|
||||
}
|
||||
else
|
||||
@ -853,7 +853,7 @@ clearlooks_style_draw_box (DRAW_ARGS)
|
||||
|
||||
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
|
||||
|
||||
STYLE_FUNCTION(draw_menu_sample) (cr, colors, ¶ms, x, y, width, height);
|
||||
STYLE_FUNCTION(draw_menu_frame) (cr, colors, ¶ms, x, y, width, height);
|
||||
}
|
||||
else if (DETAIL ("hseparator") || DETAIL ("vseparator"))
|
||||
{
|
||||
@ -1101,19 +1101,19 @@ clearlooks_style_draw_shadow_gap (DRAW_ARGS,
|
||||
if (DETAIL ("frame"))
|
||||
{
|
||||
WidgetParameters params;
|
||||
FrameParameters sample;
|
||||
FrameParameters frame;
|
||||
|
||||
sample.shadow = shadow_type;
|
||||
sample.gap_side = gap_side;
|
||||
sample.gap_x = gap_x;
|
||||
sample.gap_width = gap_width;
|
||||
sample.border = &colors->shade[5];
|
||||
frame.shadow = shadow_type;
|
||||
frame.gap_side = gap_side;
|
||||
frame.gap_x = gap_x;
|
||||
frame.gap_width = gap_width;
|
||||
frame.border = &colors->shade[5];
|
||||
|
||||
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
|
||||
|
||||
params.corners = CR_CORNER_ALL;
|
||||
|
||||
STYLE_FUNCTION(draw_sample) (cr, colors, ¶ms, &sample,
|
||||
STYLE_FUNCTION(draw_frame) (cr, colors, ¶ms, &frame,
|
||||
x, y, width, height);
|
||||
}
|
||||
else
|
||||
|
@ -319,10 +319,10 @@ struct _ClearlooksStyleFunctions
|
||||
const TabParameters *tab,
|
||||
int x, int y, int width, int height);
|
||||
|
||||
void (*draw_sample) (cairo_t *cr,
|
||||
void (*draw_frame) (cairo_t *cr,
|
||||
const ClearlooksColors *colors,
|
||||
const WidgetParameters *widget,
|
||||
const FrameParameters *sample,
|
||||
const FrameParameters *frame,
|
||||
int x, int y, int width, int height);
|
||||
|
||||
void (*draw_separator) (cairo_t *cr,
|
||||
@ -388,7 +388,7 @@ struct _ClearlooksStyleFunctions
|
||||
const WidgetParameters *widget,
|
||||
int x, int y, int width, int height);
|
||||
|
||||
void (*draw_menu_sample) (cairo_t *cr,
|
||||
void (*draw_menu_frame) (cairo_t *cr,
|
||||
const ClearlooksColors *colors,
|
||||
const WidgetParameters *widget,
|
||||
int x, int y, int width, int height);
|
||||
|
Loading…
Reference in New Issue
Block a user