[maemo-commits] [maemo-commits] r18459 - in projects/haf/trunk/gtk+: . gtk

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri May 22 11:32:09 EEST 2009
Author: herzi
Date: 2009-05-22 11:32:06 +0300 (Fri, 22 May 2009)
New Revision: 18459

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtktextview.c
Log:
2009-05-22  Sven Herzberg  <herzi at lanedo.com>

	Fixes: NB#105891 - Drawing lines support in text area widget

	* gtk/gtktextview.c (gtk_text_view_class_init),
	(gtk_text_view_paint): added a custom-background style property; see
	the bugs for instructions how to use it


Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2009-05-21 15:27:04 UTC (rev 18458)
+++ projects/haf/trunk/gtk+/ChangeLog	2009-05-22 08:32:06 UTC (rev 18459)
@@ -1,3 +1,11 @@
+2009-05-22  Sven Herzberg  <herzi at lanedo.com>
+
+	Fixes: NB#105891 - Drawing lines support in text area widget
+
+	* gtk/gtktextview.c (gtk_text_view_class_init),
+	(gtk_text_view_paint): added a custom-background style property; see
+	the bugs for instructions how to use it
+
 2009-05-19  Kristian Rietveld  <kris at imendio.com>
 
 	Addresses: NB#115510 - Kinetic scrolling too sensitive.

Modified: projects/haf/trunk/gtk+/gtk/gtktextview.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtktextview.c	2009-05-21 15:27:04 UTC (rev 18458)
+++ projects/haf/trunk/gtk+/gtk/gtktextview.c	2009-05-22 08:32:06 UTC (rev 18459)
@@ -704,6 +704,14 @@
 							       P_("Color with which to draw error-indication underlines"),
 							       GDK_TYPE_COLOR,
 							       GTK_PARAM_READABLE));
+#ifdef MAEMO_CHANGES
+  gtk_widget_class_install_style_property (widget_class,
+                                           g_param_spec_boolean ("custom-background",
+                                                                 P_("Render a custom background"),
+                                                                 P_("Provide a hook for theme engines to render a custom background"),
+                                                                 FALSE,
+                                                                 GTK_PARAM_READABLE));
+#endif
   
   /*
    * Signals
@@ -4523,6 +4531,9 @@
   GList *child_exposes;
   GList *tmp_list;
   GdkRegion *updates;
+#ifdef MAEMO_CHANGES
+  gboolean custom_background = FALSE;
+#endif
   
   text_view = GTK_TEXT_VIEW (widget);
 
@@ -4562,6 +4573,27 @@
           area->width, area->height);
 #endif
 
+#ifdef MAEMO_CHANGES
+  gtk_widget_style_get (widget,
+                        "custom-background", &custom_background,
+                        NULL);
+
+  if (custom_background)
+    {
+      gtk_paint_flat_box (widget->style,
+                          event->window,
+                          GTK_WIDGET_STATE (widget),
+                          GTK_SHADOW_NONE,
+                          area,
+                          widget,
+                          NULL,
+                          - text_view->xoffset,
+                          - text_view->yoffset,
+                          area->x + area->width + text_view->xoffset,
+                          area->y + area->height + text_view->yoffset);
+    }
+#endif
+
   child_exposes = NULL;
   gtk_text_layout_draw (text_view->layout,
                         widget,


More information about the maemo-commits mailing list