[gtk-theme-engine-clearlooks] Implement render_option()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-theme-engine-clearlooks] Implement render_option()
- Date: Mon, 6 Dec 2010 21:21:11 +0000 (UTC)
commit 48a7a5e289d69c9023e86c68caf0421ad54cc093
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Nov 16 00:53:06 2010 +0100
Implement render_option()
src/clearlooks_draw.c | 5 +++--
src/clearlooks_engine.c | 25 ++++++++++++++-----------
2 files changed, 17 insertions(+), 13 deletions(-)
---
diff --git a/src/clearlooks_draw.c b/src/clearlooks_draw.c
index db46343..09dc9a9 100644
--- a/src/clearlooks_draw.c
+++ b/src/clearlooks_draw.c
@@ -2470,7 +2470,7 @@ clearlooks_draw_radiobutton (cairo_t *cr,
CairoColor highlight;
cairo_pattern_t *pt;
gboolean inconsistent;
- gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
+ gboolean draw_bullet;
gdouble w, h, cx, cy, radius;
GtkStateFlags state;
@@ -2486,7 +2486,8 @@ clearlooks_draw_radiobutton (cairo_t *cr,
"background-color", &bg_color,
NULL);
- inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
+ inconsistent = (state & GTK_STATE_FLAG_INCONSISTENT) != 0;
+ draw_bullet = (state & GTK_STATE_FLAG_ACTIVE) != 0;
draw_bullet |= inconsistent;
if (state & GTK_STATE_FLAG_INSENSITIVE)
diff --git a/src/clearlooks_engine.c b/src/clearlooks_engine.c
index a95e386..9a7d50c 100644
--- a/src/clearlooks_engine.c
+++ b/src/clearlooks_engine.c
@@ -1119,27 +1119,29 @@ clearlooks_style_draw_slider (DRAW_ARGS, GtkOrientation orientation)
widget, detail, x, y, width, height, orientation);
}
}
+#endif
static void
-clearlooks_style_draw_option (DRAW_ARGS)
+clearlooks_engine_render_option (GtkThemingEngine *engine,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
{
- ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
- const ClearlooksColors *colors;
+ ClearlooksStyleFunctions *style_functions;
WidgetParameters params;
CheckboxParameters checkbox;
- CHECK_ARGS
-
- colors = &clearlooks_style->colors;
+ GE_CAIRO_INIT
- checkbox.shadow_type = shadow_type;
- checkbox.in_menu = (widget && GTK_IS_MENU(gtk_widget_get_parent (widget)));
+ checkbox.in_menu = gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_MENU);
- clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
+ clearlooks_lookup_functions (CLEARLOOKS_ENGINE (engine),
+ &style_functions, NULL);
- STYLE_FUNCTION(draw_radiobutton) (cr, colors, ¶ms, &checkbox, x, y, width, height);
+ style_functions->draw_radiobutton (cr, engine, &checkbox, x, y, width, height);
}
-#endif
static void
clearlooks_engine_render_check (GtkThemingEngine *engine,
@@ -1748,6 +1750,7 @@ clearlooks_engine_class_init (ClearlooksEngineClass * klass)
engine_class->render_arrow = clearlooks_engine_render_arrow;
engine_class->render_check = clearlooks_engine_render_check;
+ engine_class->render_option = clearlooks_engine_render_option;
engine_class->render_layout = clearlooks_engine_render_layout;
engine_class->render_icon_pixbuf = clearlooks_engine_render_icon_pixbuf;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]