r4367 - in trunk/src/target/OM-2007.2/libraries/moko-gtk-engine: . data/gtk-2.0 src

thomas at sita.openmoko.org thomas at sita.openmoko.org
Wed Apr 16 16:18:39 CEST 2008


Author: thomas
Date: 2008-04-16 16:18:30 +0200 (Wed, 16 Apr 2008)
New Revision: 4367

Modified:
   trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog
   trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtk-2.0/gtkrc
   trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-draw.c
Log:
2008-04-16  Thomas Wood  <thomas at openedhand.com>

	* data/gtk-2.0/gtkrc: Add and adjust some insensitive colours
	* src/moko-draw.c: (moko_draw_layout),(moko_draw_style_class_init):
	Implement draw_layout to improve insensitive text


Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog	2008-04-16 11:55:00 UTC (rev 4366)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog	2008-04-16 14:18:30 UTC (rev 4367)
@@ -1,3 +1,9 @@
+2008-04-16  Thomas Wood  <thomas at openedhand.com>
+
+	* data/gtk-2.0/gtkrc: Add and adjust some insensitive colours
+	* src/moko-draw.c: (moko_draw_layout),(moko_draw_style_class_init):
+	Implement draw_layout to improve insensitive text
+
 2008-04-04  Thomas Wood  <thomas at openedhand.com>
 
 	* data/gtk-2.0/gtkrc: Darken "base" widgets.

Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtk-2.0/gtkrc
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtk-2.0/gtkrc	2008-04-16 11:55:00 UTC (rev 4366)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtk-2.0/gtkrc	2008-04-16 14:18:30 UTC (rev 4367)
@@ -60,7 +60,7 @@
   fg [NORMAL] = @fg_color
   fg [PRELIGHT] = @fg_color
   fg [ACTIVE] = @selected_fg_color
-  fg [INSENSITIVE] = @fg_color
+  fg [INSENSITIVE] = darker (@fg_color)
   fg [SELECTED] = @selected_fg_color
 
   bg [NORMAL] = @bg_color
@@ -73,10 +73,12 @@
   text [PRELIGHT] = @text_color
   text [SELECTED] = @text_color
   text [ACTIVE] = @text_color
+  text [INSENSITIVE] = lighter (@text_color)
 
   base [NORMAL] = @base_color
   base [SELECTED] = @selected_bg_color
   base [ACTIVE] = @base_color
+  base [INSENSITIVE] = darker (@base_color)
 
   engine "moko-engine" {
   }

Modified: trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-draw.c
===================================================================
--- trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-draw.c	2008-04-16 11:55:00 UTC (rev 4366)
+++ trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-draw.c	2008-04-16 14:18:30 UTC (rev 4367)
@@ -206,7 +206,29 @@
 }
 
 
+static void
+moko_draw_layout (GtkStyle *style,  GdkWindow *window,
+                  GtkStateType state_type, gboolean use_text,
+                  GdkRectangle *area, GtkWidget *widget,
+                  const char *detail, int x, int y, PangoLayout *layout)
+{
+  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);
+  }
+}
+
 void
 moko_draw_style_class_init (GtkStyleClass * style_class)
 {
@@ -223,5 +245,6 @@
   style_class->draw_focus = moko_draw_focus;
   style_class->draw_vline = moko_draw_vline;
   style_class->draw_hline = moko_draw_hline;
+  style_class->draw_layout = moko_draw_layout;
 
 }





More information about the commitlog mailing list