[maemo-commits] [maemo-commits] r13622 - in projects/haf/trunk/sapwood: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Sep 5 18:53:32 EEST 2007
Author: tko
Date: 2007-09-05 18:53:30 +0300 (Wed, 05 Sep 2007)
New Revision: 13622

Modified:
   projects/haf/trunk/sapwood/ChangeLog
   projects/haf/trunk/sapwood/src/sapwood-draw.c
Log:
Override draw_layout to draw the layout without any fancy effects

2007-09-05  Tommi Komulainen  <tommi.komulainen at nokia.com>

	* src/sapwood-draw.c (draw_layout, sapwood_style_class_init): Override
	draw_layout to draw the layout without any fancy effects for
	insensitive state. (NB#66054)


Modified: projects/haf/trunk/sapwood/ChangeLog
===================================================================
--- projects/haf/trunk/sapwood/ChangeLog	2007-09-05 15:26:40 UTC (rev 13621)
+++ projects/haf/trunk/sapwood/ChangeLog	2007-09-05 15:53:30 UTC (rev 13622)
@@ -1,4 +1,10 @@
 2007-09-05  Tommi Komulainen  <tommi.komulainen at nokia.com>
+
+	* src/sapwood-draw.c (draw_layout, sapwood_style_class_init): Override
+	draw_layout to draw the layout without any fancy effects for
+	insensitive state. (NB#66054)
+
+2007-09-05  Tommi Komulainen  <tommi.komulainen at nokia.com>
 	
 	* === Release 2.91.8 ===
 

Modified: projects/haf/trunk/sapwood/src/sapwood-draw.c
===================================================================
--- projects/haf/trunk/sapwood/src/sapwood-draw.c	2007-09-05 15:26:40 UTC (rev 13621)
+++ projects/haf/trunk/sapwood/src/sapwood-draw.c	2007-09-05 15:53:30 UTC (rev 13622)
@@ -1339,7 +1339,33 @@
     return parent_class->render_icon (style, source, direction, state, size, widget, detail);
 }
 
+static void
+draw_layout (GtkStyle     *style,
+	     GdkWindow    *window,
+	     GtkStateType  state_type,
+	     gboolean      use_text,
+	     GdkRectangle *area,
+	     GtkWidget    *widget,
+	     const char   *detail,
+	     gint          x,
+	     gint          y,
+	     PangoLayout  *layout)
+{
+  /* Simply draw the text, without any of the fancy effects for insensitive
+   * state in the default theme engine */
+  GdkGC *gc;
 
+  gc = use_text ? style->text_gc[state_type] : style->fg_gc[state_type];
+
+  if (area)
+    gdk_gc_set_clip_rectangle (gc, area);
+
+  gdk_draw_layout (window, gc, x, y, layout);
+
+  if (area)
+    gdk_gc_set_clip_rectangle (gc, NULL);
+}
+
 GType sapwood_type_style = 0;
 
 void
@@ -1395,4 +1421,5 @@
   style_class->draw_handle = draw_handle;
   style_class->render_icon = render_icon;
   style_class->draw_expander = draw_expander;
+  style_class->draw_layout = draw_layout;
 }


More information about the maemo-commits mailing list