[maemo-commits] [maemo-commits] r9597 - in projects/haf/branches/gtk+/maemo-gtk-2-10: . gtk

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Feb 2 18:11:47 EET 2007
Author: kris
Date: 2007-02-02 18:11:46 +0200 (Fri, 02 Feb 2007)
New Revision: 9597

Modified:
   projects/haf/branches/gtk+/maemo-gtk-2-10/ChangeLog
   projects/haf/branches/gtk+/maemo-gtk-2-10/gtk/gtktreeview.c
Log:
2007-02-02  Kristian Rietveld  <kris at imendio.com>

	* gtk/gtktreeview.c (gtk_tree_view_class_init): add row-insensitive
	signal,
	(gtk_tree_view_real_set_cursor): emit row-insensitive and return
	if the row is not selectable.



Modified: projects/haf/branches/gtk+/maemo-gtk-2-10/ChangeLog
===================================================================
--- projects/haf/branches/gtk+/maemo-gtk-2-10/ChangeLog	2007-02-02 16:09:55 UTC (rev 9596)
+++ projects/haf/branches/gtk+/maemo-gtk-2-10/ChangeLog	2007-02-02 16:11:46 UTC (rev 9597)
@@ -1,5 +1,12 @@
 2007-02-02  Kristian Rietveld  <kris at imendio.com>
 
+	* gtk/gtktreeview.c (gtk_tree_view_class_init): add row-insensitive
+	signal,
+	(gtk_tree_view_real_set_cursor): emit row-insensitive and return
+	if the row is not selectable.
+
+2007-02-02  Kristian Rietveld  <kris at imendio.com>
+
 	* gtk/gtktreeview.c (gtk_tree_view_stop_rubber_band),
 	(gtk_tree_view_update_rubber_band_selection): make the cursor
 	follow the stylus during pen dragging,

Modified: projects/haf/branches/gtk+/maemo-gtk-2-10/gtk/gtktreeview.c
===================================================================
--- projects/haf/branches/gtk+/maemo-gtk-2-10/gtk/gtktreeview.c	2007-02-02 16:09:55 UTC (rev 9596)
+++ projects/haf/branches/gtk+/maemo-gtk-2-10/gtk/gtktreeview.c	2007-02-02 16:11:46 UTC (rev 9597)
@@ -115,6 +115,9 @@
   EXPAND_COLLAPSE_CURSOR_ROW,
   SELECT_CURSOR_PARENT,
   START_INTERACTIVE_SEARCH,
+#ifdef MAEMO_CHANGES
+  ROW_INSENSITIVE,
+#endif /* MAEMO_CHANGES */
   LAST_SIGNAL
 };
 
@@ -1093,6 +1096,27 @@
 		  _gtk_marshal_BOOLEAN__NONE,
 		  G_TYPE_BOOLEAN, 0);
 
+#ifdef MAEMO_CHANGES
+  /**
+   * GtkTreeView::row-insensitive:
+   * @tree_view: the object which received the signal.
+   * @path: the path where the cursor is tried to be moved.
+   *
+   * Emitted when the user tries to move cursor to an insesitive row.
+   *
+   * Since: maemo 1.0
+   */
+  tree_view_signals[ROW_INSENSITIVE] =
+     g_signal_new ("row_insensitive",
+                  G_TYPE_FROM_CLASS (o_class),
+                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+                  G_STRUCT_OFFSET (GtkTreeViewClass, row_insensitive),
+                  NULL, NULL,
+                  _gtk_marshal_VOID__OBJECT,
+                  G_TYPE_NONE, 1,
+                  GTK_TYPE_TREE_PATH);
+#endif /* MAEMO_CHANGES */
+
   /* Key bindings */
   gtk_tree_view_add_move_binding (binding_set, GDK_Up, 0, TRUE,
 				  GTK_MOVEMENT_DISPLAY_LINES, -1);
@@ -12814,6 +12838,16 @@
   GtkRBTree *tree = NULL;
   GtkRBNode *node = NULL;
 
+#ifdef MAEMO_CHANGES
+  _gtk_tree_view_find_node (tree_view, path, &tree, &node);
+  if (!_gtk_tree_selection_row_is_selectable (tree_view->priv->selection,
+					      node, path))
+    {
+      g_signal_emit (tree_view, tree_view_signals[ROW_INSENSITIVE], 0, path);
+      return;
+    }
+#endif /* MAEMO_CHANGES */
+
   if (gtk_tree_row_reference_valid (tree_view->priv->cursor))
     {
       GtkTreePath *cursor_path;


More information about the maemo-commits mailing list