[gtk-theme-engine-clearlooks] Port gnome3 skin to GtkThemingEngine.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-theme-engine-clearlooks] Port gnome3 skin to GtkThemingEngine.
- Date: Mon, 6 Dec 2010 21:22:17 +0000 (UTC)
commit 0ffc61d8d42807841960e619d77b6d7629d91a11
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Nov 16 13:22:53 2010 +0100
Port gnome3 skin to GtkThemingEngine.
src/Makefile.am | 10 +-
src/clearlooks_draw_gnome3.c | 343 ++++++++++++++++++++++++++----------------
src/clearlooks_engine.c | 8 +
3 files changed, 225 insertions(+), 136 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index b08bb7e..0b95e3d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@
INCLUDES = $(GTK_CFLAGS) $(DEVELOPMENT_CFLAGS)
-enginedir = $(libdir)/gtk-3.0/$(GTK_VERSION)/engines
+enginedir = $(libdir)/gtk-3.0/$(GTK_VERSION)/theming-engines
engine_LTLIBRARIES = libclearlooks.la
BUILT_SOURCES = \
@@ -25,12 +25,12 @@ libclearlooks_la_SOURCES = \
support.h \
clearlooks_draw.c \
clearlooks_draw.h \
+ clearlooks_draw_gnome3.c \
clearlooks_types.h
-# clearlooks_draw_glossy.c \
-# clearlooks_draw_inverted.c \
-# clearlooks_draw_gummy.c \
-# clearlooks_draw_gnome3.c
+# clearlooks_draw_glossy.c
+# clearlooks_draw_inverted.c
+# clearlooks_draw_gummy.c
libclearlooks_la_LDFLAGS = -module -avoid-version -no-undefined -export-symbols $(top_srcdir)/src/engine.symbols
libclearlooks_la_LIBADD = $(GTK_LIBS)
diff --git a/src/clearlooks_draw_gnome3.c b/src/clearlooks_draw_gnome3.c
index b5dbf91..04df4ae 100644
--- a/src/clearlooks_draw_gnome3.c
+++ b/src/clearlooks_draw_gnome3.c
@@ -34,61 +34,91 @@
static void
clearlooks_gnome3_draw_entry (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *params,
+ GtkThemingEngine *engine,
const FocusParameters *focus,
int x, int y, int width, int height)
{
- const CairoColor *fg_color = &colors->text[params->state_type];
- const CairoColor *bg_color = &colors->base[params->state_type];
- CairoColor top_color;
-
- if (params->focus) {
- fg_color = &colors->base[GTK_STATE_SELECTED];
+ CairoColor *bg_color, *fg_color;
+ const CairoColor *top_color;
+ GtkStateFlags state;
+ gint radius;
+
+ state = gtk_theming_engine_get_state (engine);
+ gtk_theming_engine_get (engine, state,
+ "border-radius", &radius,
+ "background-color", &bg_color,
+ "color", &fg_color,
+ NULL);
+
+ if (state & GTK_STATE_FLAG_FOCUSED) {
+ gdk_rgba_free ((GdkRGBA *) fg_color);
+
+ gtk_theming_engine_get (engine, GTK_STATE_FLAG_SELECTED,
+ "color", fg_color,
+ NULL);
}
- top_color = *fg_color;
+
+ top_color = fg_color;
cairo_save (cr);
cairo_set_line_width (cr, 1.0);
ge_cairo_rounded_rectangle (cr, x + 0.5, y + 0.5, width - 1,
- height - 1, MAX(0, params->radius - 0.5),
- params->corners);
+ height - 1, MAX(0, radius - 0.5),
+ clearlooks_get_corners (engine));
ge_cairo_set_color (cr, bg_color);
cairo_fill_preserve (cr);
- if (params->focus || params->disabled || params->prelight || params->active) {
+ if ((state & GTK_STATE_FLAG_FOCUSED) ||
+ (state & GTK_STATE_FLAG_INSENSITIVE) ||
+ (state & GTK_STATE_FLAG_PRELIGHT) ||
+ (state & GTK_STATE_FLAG_ACTIVE)) {
ge_cairo_set_color (cr, fg_color);
cairo_stroke (cr);
} else {
cairo_pattern_t *pattern;
- CairoColor bottom_color = colors->text[GTK_STATE_INSENSITIVE];
+ CairoColor *bottom_color;
+ CairoColor mix;
- ge_mix_color (&top_color, &bottom_color, 0.86, &top_color);
+ gtk_theming_engine_get (engine, GTK_STATE_FLAG_INSENSITIVE,
+ "color", &bottom_color,
+ NULL);
+
+ ge_mix_color (top_color, bottom_color, 0.86, &mix);
/* Top/bottom pixel lines are outside of the gradient, there is
* no point. */
pattern = cairo_pattern_create_linear (x, y + 1, x, height - 1);
- cairo_pattern_add_color_stop_rgb (pattern, 0.0, top_color.r, top_color.g, top_color.b);
- cairo_pattern_add_color_stop_rgb (pattern, 1.0, bottom_color.r, bottom_color.g, bottom_color.b);
+ cairo_pattern_add_color_stop_rgb (pattern, 0.0, mix.r, mix.g, mix.b);
+ cairo_pattern_add_color_stop_rgb (pattern, 1.0, bottom_color->r, bottom_color->g, bottom_color->b);
cairo_set_source (cr, pattern);
cairo_stroke (cr);
cairo_pattern_destroy (pattern);
+
+ gdk_rgba_free ((GdkRGBA *) bottom_color);
}
- if (!params->disabled) {
+ if ((state & GTK_STATE_FLAG_INSENSITIVE) != 0) {
+ CairoColor color;
+
ge_cairo_rounded_rectangle (cr, x + 1.0, y + 1.0, width - 2,
- height - 2, MAX(0, params->radius - 1.0),
- params->corners);
+ height - 2, MAX(0, radius - 1.0),
+ clearlooks_get_corners (engine));
cairo_clip (cr);
cairo_move_to (cr, x, y + 1.5);
cairo_line_to (cr, x + width, y + 1.5);
- top_color.a = 0.1;
- ge_cairo_set_color (cr, &top_color);
+
+ color = *top_color;
+ color.a = 0.1;
+
+ ge_cairo_set_color (cr, &color);
cairo_stroke (cr);
}
cairo_restore (cr);
+
+ gdk_rgba_free ((GdkRGBA *) fg_color);
+ gdk_rgba_free ((GdkRGBA *) bg_color);
}
static void
@@ -122,51 +152,69 @@ draw_gradient (cairo_t *cr,
static void
clearlooks_gnome3_draw_button (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *params,
- int x, int y, int width, int height)
+ GtkThemingEngine *engine,
+ int x, int y, int width, int height)
{
- CairoColor bg_color = colors->bg[params->state_type];
- CairoColor fg_color = colors->fg[params->state_type];
+ CairoColor *bg_color, *fg_color;
CairoColor stroke_top_color, stroke_bottom_color;
CairoColor fill_top_color, fill_bottom_color;
CairoColor border_color;
cairo_pattern_t *pattern;
-
- if (params->is_default && !params->disabled) {
- if (params->state_type == GTK_STATE_PRELIGHT)
- ge_shade_color (&colors->bg[GTK_STATE_SELECTED], 1.06, &bg_color);
+ GtkStateFlags state;
+ gint radius;
+
+ state = gtk_theming_engine_get_state (engine);
+ gtk_theming_engine_get (engine, state,
+ "border-radius", &radius,
+ "background-color", &bg_color,
+ "color", &fg_color,
+ NULL);
+
+ if ((state & GTK_STATE_FLAG_INSENSITIVE) != 0 &&
+ gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_DEFAULT)) {
+ CairoColor *color;
+
+ gtk_theming_engine_get (engine, GTK_STATE_FLAG_SELECTED,
+ "background-color", &color,
+ NULL);
+
+ if (state & GTK_STATE_FLAG_PRELIGHT)
+ ge_shade_color (color, 1.06, bg_color);
else
- bg_color = colors->bg[GTK_STATE_SELECTED];
+ *bg_color = *color;
+
+ gdk_rgba_free ((GdkRGBA *) color);
}
- ge_mix_color (&bg_color, &fg_color, 0.6, &border_color);
+ ge_mix_color (bg_color, fg_color, 0.6, &border_color);
cairo_save (cr);
- if (params->disabled) {
- stroke_top_color = stroke_bottom_color = bg_color;
- fill_top_color = fill_bottom_color = bg_color;
- } else if (params->active) {
- ge_shade_color (&bg_color, 0.93, &stroke_top_color);
- ge_shade_color (&bg_color, 1.12, &stroke_bottom_color);
+ if (state & GTK_STATE_FLAG_INSENSITIVE) {
+ stroke_top_color = stroke_bottom_color = *bg_color;
+ fill_top_color = fill_bottom_color = *bg_color;
+ } else if (state & GTK_STATE_FLAG_ACTIVE) {
+ ge_shade_color (bg_color, 0.93, &stroke_top_color);
+ ge_shade_color (bg_color, 1.12, &stroke_bottom_color);
- ge_shade_color (&bg_color, 0.98, &fill_top_color);
- ge_shade_color (&bg_color, 1.09, &fill_bottom_color);
+ ge_shade_color (bg_color, 0.98, &fill_top_color);
+ ge_shade_color (bg_color, 1.09, &fill_bottom_color);
} else {
- ge_shade_color (&bg_color, 1.09, &stroke_top_color);
- ge_shade_color (&bg_color, 0.95, &stroke_bottom_color);
+ ge_shade_color (bg_color, 1.09, &stroke_top_color);
+ ge_shade_color (bg_color, 0.95, &stroke_bottom_color);
- ge_shade_color (&bg_color, 1.06, &fill_top_color);
- ge_shade_color (&bg_color, 0.95, &fill_bottom_color);
+ ge_shade_color (bg_color, 1.06, &fill_top_color);
+ ge_shade_color (bg_color, 0.95, &fill_bottom_color);
}
/* Border around everything */
- ge_cairo_inner_rounded_rectangle (cr, x, y, width, height, params->radius, params->corners);
+ ge_cairo_inner_rounded_rectangle (cr, x, y, width, height, radius,
+ clearlooks_get_corners (engine));
ge_cairo_set_color (cr, &border_color);
cairo_stroke (cr);
- ge_cairo_inner_rounded_rectangle (cr, x + 1, y + 1, width - 2, height - 2, MAX(0, params->radius - 1), params->corners);
+ ge_cairo_inner_rounded_rectangle (cr, x + 1, y + 1, width - 2, height - 2, MAX(0, radius - 1),
+ clearlooks_get_corners (engine));
pattern = cairo_pattern_create_linear (x, y + 2, x, y + height - 4);
ge_cairo_pattern_add_color_stop_color (pattern, 0.0, &stroke_top_color);
@@ -175,11 +223,16 @@ clearlooks_gnome3_draw_button (cairo_t *cr,
cairo_pattern_destroy (pattern);
cairo_stroke (cr);
- ge_cairo_rounded_rectangle (cr, x + 2, y + 2, width - 4, height - 4, MAX(0, params->radius - 2), params->corners);
- if (colors->gradient && params->state_type == GTK_STATE_PRELIGHT) {
+ ge_cairo_rounded_rectangle (cr, x + 2, y + 2, width - 4, height - 4, MAX(0, radius - 2),
+ clearlooks_get_corners (engine));
+#if 0
+ if (colors->gradient &&
+ (state & GTK_STATE_FLAG_PRELIGHT)) {
draw_gradient (cr, colors->gradient, x, y, width, height);
}
else {
+#endif
+ {
pattern = cairo_pattern_create_linear (x, y + 3, x, y + height - 6);
ge_cairo_pattern_add_color_stop_color (pattern, 0.0, &fill_top_color);
ge_cairo_pattern_add_color_stop_color (pattern, 1.0, &fill_bottom_color);
@@ -189,40 +242,26 @@ clearlooks_gnome3_draw_button (cairo_t *cr,
}
cairo_restore (cr);
+
+ gdk_rgba_free ((GdkRGBA *) bg_color);
+ gdk_rgba_free ((GdkRGBA *) fg_color);
}
static void
clearlooks_gnome3_draw_arrow (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const ArrowParameters *arrow,
- int x, int y, int width, int height)
+ GtkThemingEngine *engine,
+ const ArrowParameters *arrow,
+ int x, int y, int width, int height)
{
+ GtkStateFlags state;
+ CairoColor *color;
gdouble w = width, h = height;
- gdouble rotate;
cairo_matrix_t matrix;
- switch (arrow->direction) {
- case CL_DIRECTION_LEFT:
- rotate = G_PI*1.5;
- break;
- case CL_DIRECTION_RIGHT:
- rotate = G_PI*0.5;
- break;
- case CL_DIRECTION_UP:
- rotate = G_PI;
- break;
- case CL_DIRECTION_DOWN:
- rotate = 0;
- break;
- default:
- return;
- }
-
cairo_save (cr);
cairo_translate (cr, x + width / 2.0, y + height / 2.0);
- cairo_rotate (cr, -rotate);
+ cairo_rotate (cr, arrow->angle);
cairo_get_matrix (cr, &matrix);
cairo_matrix_transform_distance (&matrix, &w, &h);
@@ -233,109 +272,139 @@ clearlooks_gnome3_draw_arrow (cairo_t *cr,
cairo_line_to (cr, +w / 2 + 1, -h / 2 + 1);
cairo_set_line_width (cr, 2.0);
- ge_cairo_set_color (cr, &colors->fg[widget->state_type]);
+ state = gtk_theming_engine_get_state (engine);
+ gtk_theming_engine_get (engine, state,
+ "color", &color,
+ NULL);
+
+ ge_cairo_set_color (cr, color);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
cairo_stroke (cr);
cairo_restore (cr);
+
+ gdk_rgba_free ((GdkRGBA *) color);
}
static void
clearlooks_gnome3_draw_menubar (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *params,
+ GtkThemingEngine *engine,
const MenuBarParameters *menubar,
int x, int y, int width, int height)
{
cairo_save (cr);
+#if 0
if (colors->gradient) {
draw_gradient (cr, colors->gradient, x, y, width, height);
}
+#endif
cairo_restore (cr);
}
static void
clearlooks_gnome3_draw_scrollbar_trough (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const ScrollBarParameters *scrollbar,
+ GtkThemingEngine *engine,
+ const ScrollBarParameters *scrollbar,
int x, int y, int width, int height)
{
- const CairoColor *bg_color = &colors->bg[GTK_STATE_ACTIVE];
+ CairoColor *bg_color;
+
cairo_save (cr);
+ gtk_theming_engine_get (engine, GTK_STATE_FLAG_ACTIVE,
+ "background-color", &bg_color,
+ NULL);
+
ge_cairo_set_color (cr, bg_color);
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
cairo_restore (cr);
+
+ gdk_rgba_free ((GdkRGBA *) bg_color);
}
static void
clearlooks_gnome3_draw_scrollbar_button (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *params,
- const ScrollBarParameters *scrollbar,
+ GtkThemingEngine *engine,
+ const ScrollBarParameters *scrollbar,
int x, int y,
int width, int height)
{
- const CairoColor *bg_color = &colors->bg[params->state_type];
- const CairoColor *fg_color = &colors->fg[params->state_type];
+ CairoColor *bg_color, *fg_color;
+ GtkStateFlags state;
+ gint radius;
+
+ state = gtk_theming_engine_get_state (engine);
+ gtk_theming_engine_get (engine, state,
+ "border-radius", &radius,
+ "background-color", &bg_color,
+ "color", &fg_color,
+ NULL);
cairo_save (cr);
- ge_cairo_inner_rounded_rectangle (cr, x, y, width, height, params->radius, CR_CORNER_ALL);
+ ge_cairo_inner_rounded_rectangle (cr, x, y, width, height, radius, CR_CORNER_ALL);
ge_cairo_set_color (cr, bg_color);
cairo_fill_preserve (cr);
ge_cairo_set_color (cr, fg_color);
cairo_stroke (cr);
cairo_restore (cr);
+
+ gdk_rgba_free ((GdkRGBA *) bg_color);
+ gdk_rgba_free ((GdkRGBA *) fg_color);
}
static void
clearlooks_gnome3_draw_scrollbar_stepper (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *params,
+ GtkThemingEngine *engine,
const ScrollBarParameters *scrollbar,
const ScrollBarStepperParameters *stepper,
int x, int y, int width, int height)
{
- clearlooks_gnome3_draw_scrollbar_button (cr, colors, params, scrollbar, x + 1, y + 1, width - 2, height - 2);
+ clearlooks_gnome3_draw_scrollbar_button (cr, engine, scrollbar, x + 1, y + 1, width - 2, height - 2);
}
static void
clearlooks_gnome3_draw_scrollbar_slider (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *params,
- const ScrollBarParameters *scrollbar,
+ GtkThemingEngine *engine,
+ const ScrollBarParameters *scrollbar,
int x, int y, int width, int height)
{
if (scrollbar->horizontal) {
- clearlooks_gnome3_draw_scrollbar_button (cr, colors, params, scrollbar, x, y + 1, width, height - 2);
+ clearlooks_gnome3_draw_scrollbar_button (cr, engine, scrollbar, x, y + 1, width, height - 2);
} else {
- clearlooks_gnome3_draw_scrollbar_button (cr, colors, params, scrollbar, x + 1, y, width - 2, height);
+ clearlooks_gnome3_draw_scrollbar_button (cr, engine, scrollbar, x + 1, y, width - 2, height);
}
}
static void
clearlooks_gnome3_draw_slider_button (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *params,
+ GtkThemingEngine *engine,
const SliderParameters *slider,
int x, int y, int width, int height)
{
- CairoColor bg_color = colors->bg[params->state_type];
- CairoColor fg_color = colors->fg[params->state_type];
CairoColor border_color, tmp_color;
+ CairoColor *bg_color, *fg_color;
cairo_matrix_t matrix;
- double radius = MIN (params->radius - 0.5, MIN ((width - 1.0) / 2.0, (height - 1.0) / 2.0));
+ double radius;
double trough_width = 4;
cairo_pattern_t *fill_pattern, *stroke_pattern;
+ GtkStateFlags state;
int tmp;
+ state = gtk_theming_engine_get_state (engine);
+ gtk_theming_engine_get (engine, state,
+ "border-radius", &radius,
+ "background-color", &bg_color,
+ "color", &fg_color,
+ NULL);
+
+ radius = MIN (radius - 0.5, MIN ((width - 1.0) / 2.0, (height - 1.0) / 2.0));
+
cairo_save (cr);
cairo_get_matrix (cr, &matrix);
- ge_mix_color (&bg_color, &fg_color, 0.6, &border_color);
+ ge_mix_color (bg_color, fg_color, 0.6, &border_color);
if (slider->horizontal) {
fill_pattern = cairo_pattern_create_linear (x, y + 0.5 * height, x, y + 0.8 * height);
@@ -350,9 +419,9 @@ clearlooks_gnome3_draw_slider_button (cairo_t *cr,
ge_shade_color (&border_color, 0.9, &tmp_color);
ge_cairo_pattern_add_color_stop_color (stroke_pattern, 1.0, &tmp_color);
- ge_shade_color (&bg_color, 1.1, &tmp_color);
+ ge_shade_color (bg_color, 1.1, &tmp_color);
ge_cairo_pattern_add_color_stop_color (fill_pattern, 0.0, &tmp_color);
- ge_shade_color (&bg_color, 0.9, &tmp_color);
+ ge_shade_color (bg_color, 0.9, &tmp_color);
ge_cairo_pattern_add_color_stop_color (fill_pattern, 1.0, &tmp_color);
cairo_translate (cr, x + width / 2.0, y + height / 2.0);
@@ -391,37 +460,39 @@ clearlooks_gnome3_draw_slider_button (cairo_t *cr,
cairo_pattern_destroy (fill_pattern);
cairo_pattern_destroy (stroke_pattern);
cairo_restore (cr);
+
+ gdk_rgba_free ((GdkRGBA *) bg_color);
+ gdk_rgba_free ((GdkRGBA *) fg_color);
}
/* We can't draw transparent things here, since it will be called on the same
* surface multiple times, when placed on a handlebox_bin or dockitem_bin */
static void
clearlooks_gnome3_draw_toolbar (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *widget,
- const ToolbarParameters *toolbar,
- int x, int y, int width, int height)
+ GtkThemingEngine *engine,
+ const ToolbarParameters *toolbar,
+ int x, int y, int width, int height)
{
cairo_save (cr);
+#if 0
if (colors->gradient) {
draw_gradient (cr, colors->gradient, x, y, width, height);
}
+#endif
cairo_restore (cr);
}
static void
clearlooks_gnome3_draw_tab (cairo_t *cr,
- const ClearlooksColors *colors,
- const WidgetParameters *params,
- const TabParameters *tab,
- int x, int y, int width, int height)
+ GtkThemingEngine *engine,
+ const TabParameters *tab,
+ int x, int y, int width, int height)
{
- const CairoColor *border1 = &colors->shade[6];
- const CairoColor *border2 = &colors->shade[5];
- const CairoColor *stripe_fill = &colors->spot[1];
- const CairoColor *stripe_border = &colors->spot[2];
+ CairoColor border1, border2;
+ CairoColor stripe_fill, stripe_border;
const CairoColor *fill;
CairoColor hilight;
+ GtkStateFlags state;
cairo_pattern_t *pattern;
@@ -430,7 +501,18 @@ clearlooks_gnome3_draw_tab (cairo_t *cr,
double stripe_fill_size;
double length;
- radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
+ state = gtk_theming_engine_get_state (engine);
+ gtk_theming_engine_get (engine, state,
+ "border-radius", &radius,
+ "background-color", &fill,
+ NULL);
+
+ clearlooks_lookup_shade (engine, 6, (GdkRGBA *) &border1);
+ clearlooks_lookup_shade (engine, 5, (GdkRGBA *) &border2);
+ clearlooks_lookup_spot (engine, 1, (GdkRGBA *) &stripe_fill);
+ clearlooks_lookup_spot (engine, 2, (GdkRGBA *) &stripe_border);
+
+ radius = MIN (radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
cairo_save (cr);
@@ -465,12 +547,9 @@ clearlooks_gnome3_draw_tab (cairo_t *cr,
cairo_translate (cr, -3.0, 0.0); /* gap at the other side */
}
- /* Set the fill color */
- fill = &colors->bg[params->state_type];
-
/* Set tab shape */
ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1,
- radius, params->corners);
+ radius, clearlooks_get_corners (engine));
/* Draw fill */
ge_cairo_set_color (cr, fill);
@@ -480,16 +559,16 @@ clearlooks_gnome3_draw_tab (cairo_t *cr,
ge_shade_color (fill, 1.3, &hilight);
/* Draw highlight */
- if (!params->active)
+ if ((state & GTK_STATE_FLAG_ACTIVE) == 0)
{
ShadowParameters shadow;
shadow.shadow = CL_SHADOW_OUT;
- shadow.corners = params->corners;
+ shadow.corners = clearlooks_get_corners (engine);
}
- if (params->active)
+ if ((state & GTK_STATE_FLAG_ACTIVE) != 0)
{
CairoColor shadow;
switch (tab->gap_side)
@@ -510,7 +589,7 @@ clearlooks_gnome3_draw_tab (cairo_t *cr,
pattern = NULL;
}
- ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, radius, params->corners);
+ ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, radius, clearlooks_get_corners (engine));
ge_shade_color (fill, 0.92, &shadow);
@@ -543,10 +622,10 @@ clearlooks_gnome3_draw_tab (cairo_t *cr,
pattern = NULL;
}
- ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, radius, params->corners);
+ ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, radius, clearlooks_get_corners (engine));
- cairo_pattern_add_color_stop_rgb (pattern, 0.0, stripe_fill->r, stripe_fill->g, stripe_fill->b);
- cairo_pattern_add_color_stop_rgb (pattern, stripe_fill_size, stripe_fill->r, stripe_fill->g, stripe_fill->b);
+ cairo_pattern_add_color_stop_rgb (pattern, 0.0, stripe_fill.r, stripe_fill.g, stripe_fill.b);
+ cairo_pattern_add_color_stop_rgb (pattern, stripe_fill_size, stripe_fill.r, stripe_fill.g, stripe_fill.b);
cairo_pattern_add_color_stop_rgba (pattern, stripe_fill_size, hilight.r, hilight.g, hilight.b, 0.5);
cairo_pattern_add_color_stop_rgba (pattern, 0.8, hilight.r, hilight.g, hilight.b, 0.0);
cairo_set_source (cr, pattern);
@@ -554,11 +633,11 @@ clearlooks_gnome3_draw_tab (cairo_t *cr,
cairo_pattern_destroy (pattern);
}
- ge_cairo_inner_rounded_rectangle (cr, 0, 0, width, height, radius, params->corners);
+ ge_cairo_inner_rounded_rectangle (cr, 0, 0, width, height, radius, clearlooks_get_corners (engine));
- if (params->active)
+ if ((state & GTK_STATE_FLAG_ACTIVE) != 0)
{
- ge_cairo_set_color (cr, border2);
+ ge_cairo_set_color (cr, &border2);
cairo_stroke (cr);
}
else
@@ -581,16 +660,18 @@ clearlooks_gnome3_draw_tab (cairo_t *cr,
pattern = NULL;
}
- cairo_pattern_add_color_stop_rgb (pattern, 0.0, stripe_border->r, stripe_border->g, stripe_border->b);
- cairo_pattern_add_color_stop_rgb (pattern, stripe_fill_size, stripe_border->r, stripe_border->g, stripe_border->b);
- cairo_pattern_add_color_stop_rgb (pattern, stripe_fill_size, border1->r, border1->g, border1->b);
- cairo_pattern_add_color_stop_rgb (pattern, 1.0, border2->r, border2->g, border2->b);
+ cairo_pattern_add_color_stop_rgb (pattern, 0.0, stripe_border.r, stripe_border.g, stripe_border.b);
+ cairo_pattern_add_color_stop_rgb (pattern, stripe_fill_size, stripe_border.r, stripe_border.g, stripe_border.b);
+ cairo_pattern_add_color_stop_rgb (pattern, stripe_fill_size, border1.r, border1.g, border1.b);
+ cairo_pattern_add_color_stop_rgb (pattern, 1.0, border2.r, border2.g, border2.b);
cairo_set_source (cr, pattern);
cairo_stroke (cr);
cairo_pattern_destroy (pattern);
}
cairo_restore (cr);
+
+ gdk_rgba_free ((GdkRGBA *) fill);
}
diff --git a/src/clearlooks_engine.c b/src/clearlooks_engine.c
index 38104d8..677c0c6 100644
--- a/src/clearlooks_engine.c
+++ b/src/clearlooks_engine.c
@@ -1615,6 +1615,14 @@ clearlooks_engine_init (ClearlooksEngine *clearlooks_engine)
clearlooks_register_style_classic (&clearlooks_engine->style_functions[CLEARLOOKS_STYLE_CLASSIC],
&clearlooks_engine->style_constants[CLEARLOOKS_STYLE_CLASSIC]);
+ clearlooks_engine->style_functions[CLEARLOOKS_STYLE_GNOME3] =
+ clearlooks_engine->style_functions[CLEARLOOKS_STYLE_CLASSIC];
+ clearlooks_engine->style_constants[CLEARLOOKS_STYLE_GNOME3] =
+ clearlooks_engine->style_constants[CLEARLOOKS_STYLE_CLASSIC];
+
+ clearlooks_register_style_gnome3 (&clearlooks_engine->style_functions[CLEARLOOKS_STYLE_GNOME3],
+ &clearlooks_engine->style_constants[CLEARLOOKS_STYLE_GNOME3]);
+
#if 0
clearlooks_register_style_classic (&klass->style_functions[CL_STYLE_CLASSIC],
&klass->style_constants[CL_STYLE_CLASSIC]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]