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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Sep 10 13:04:17 EEST 2008
Author: kris
Date: 2008-09-10 13:04:14 +0300 (Wed, 10 Sep 2008)
New Revision: 16082

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtktreeview.c
   projects/haf/trunk/gtk+/tests/testhildontreeview.c
Log:
2008-09-10  Kristian Rietveld  <kris at imendio.com>

	* gtk/gtktreeview.c (gtk_tree_view_class_init): introduce
	row-height style property,
	(validate_row): enforce row-height style property.  Note that this is
	the only place that needs patching, both fixed-height and
	non-fixed-height mode go through validate_row().

	* tests/testhildontreeview.c (create_model): remove new lines
	from string,
	(main): set row-height style property in "fremantle-widget"
	style definition to test the feature.



Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2008-09-10 10:02:32 UTC (rev 16081)
+++ projects/haf/trunk/gtk+/ChangeLog	2008-09-10 10:04:14 UTC (rev 16082)
@@ -1,3 +1,16 @@
+2008-09-10  Kristian Rietveld  <kris at imendio.com>
+
+	* gtk/gtktreeview.c (gtk_tree_view_class_init): introduce
+	row-height style property,
+	(validate_row): enforce row-height style property.  Note that this is
+	the only place that needs patching, both fixed-height and
+	non-fixed-height mode go through validate_row().
+
+	* tests/testhildontreeview.c (create_model): remove new lines
+	from string,
+	(main): set row-height style property in "fremantle-widget"
+	style definition to test the feature.
+
 2008-09-10  Alberto Garcia  <agarcia at igalia.com>
 
 	* gtk/gtkdialog.c (gtk_dialog_init): Align all buttons to the

Modified: projects/haf/trunk/gtk+/gtk/gtktreeview.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtktreeview.c	2008-09-10 10:02:32 UTC (rev 16081)
+++ projects/haf/trunk/gtk+/gtk/gtktreeview.c	2008-09-10 10:04:14 UTC (rev 16082)
@@ -935,6 +935,26 @@
 							     G_MAXINT,
 							     _TREE_VIEW_SEPARATOR_HEIGHT,
 							     GTK_PARAM_READABLE));
+
+  /**
+   * GtkTreeView:row-height:
+   *
+   * Height in pixels of a row.  When set, all rows will use this height,
+   * except for row separators and row headers.  A value of -1 means this
+   * value is unset.  Setting this property does not imply fixed height
+   * mode will be turned on, so columns are still properly autosized.
+   *
+   * Since: maemo 5.0
+   * Stability: Unstable
+   */
+  gtk_widget_class_install_style_property (widget_class,
+					   g_param_spec_int ("row-height",
+							     P_("Row height"),
+							     P_("Height of a row"),
+							     -1,
+							     G_MAXINT,
+                                                             -1,
+							     GTK_PARAM_READABLE));
 #endif /* MAEMO_CHANGES */
 
   /* Signals */
@@ -6361,6 +6381,7 @@
   gint focus_pad;
   gint grid_line_width;
 #ifdef MAEMO_CHANGES
+  gint row_height;
   gint separator_height;
   HildonMode mode;
   gboolean is_header = FALSE;
@@ -6384,6 +6405,7 @@
 			"vertical-separator", &vertical_separator,
 			"grid-line-width", &grid_line_width,
 #ifdef MAEMO_CHANGES
+                        "row-height", &row_height,
 			"separator-height", &separator_height,
                         "hildon-mode", &mode,
 #endif /* MAEMO_CHANGES */
@@ -6482,6 +6504,11 @@
   if (draw_hgrid_lines)
     height += grid_line_width;
 
+#ifdef MAEMO_CHANGES
+  if (row_height != -1 && !is_separator && !is_header)
+    height = row_height;
+#endif /* MAEMO_CHANGES */
+
   if (height != GTK_RBNODE_GET_HEIGHT (node))
     {
       retval = TRUE;

Modified: projects/haf/trunk/gtk+/tests/testhildontreeview.c
===================================================================
--- projects/haf/trunk/gtk+/tests/testhildontreeview.c	2008-09-10 10:02:32 UTC (rev 16081)
+++ projects/haf/trunk/gtk+/tests/testhildontreeview.c	2008-09-10 10:04:14 UTC (rev 16082)
@@ -27,7 +27,7 @@
     {
       gchar *str;
 
-      str = g_strdup_printf ("\nRow %d\n", i);
+      str = g_strdup_printf ("Row %d", i);
       gtk_list_store_insert_with_values (store, NULL, i, 0, str, -1);
       g_free (str);
     }
@@ -175,6 +175,7 @@
 
   gtk_rc_parse_string ("style \"fremantle-widget\" {\n"
                        "  GtkWidget::hildon-mode = 1\n"
+                       "  GtkTreeView::row-height = 70\n"
                        "} widget \"*.fremantle-widget\" style \"fremantle-widget\"");
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);


More information about the maemo-commits mailing list