[maemo-commits] [maemo-commits] r9694 - in projects/haf/branches/gtk+/maemo-gtk-2-10: . gtk
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue Feb 6 18:11:42 EET 2007
- Previous message: [maemo-commits] r9693 - projects/haf/hafbuildbot
- Next message: [maemo-commits] r9695 - projects/haf/hafbuildbot
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: kris Date: 2007-02-06 18:11:40 +0200 (Tue, 06 Feb 2007) New Revision: 9694 Modified: projects/haf/branches/gtk+/maemo-gtk-2-10/ChangeLog projects/haf/branches/gtk+/maemo-gtk-2-10/gtk/gtktreeview.c Log: 2007-02-06 Kristian Rietveld <kris at imendio.com> * gtk/gtktreeview.c (gtk_tree_view_real_expand_row): Make sure the newly expanded row, and if possible its children, are visible to the user. Modified: projects/haf/branches/gtk+/maemo-gtk-2-10/ChangeLog =================================================================== --- projects/haf/branches/gtk+/maemo-gtk-2-10/ChangeLog 2007-02-06 15:11:08 UTC (rev 9693) +++ projects/haf/branches/gtk+/maemo-gtk-2-10/ChangeLog 2007-02-06 16:11:40 UTC (rev 9694) @@ -1,5 +1,11 @@ 2007-02-06 Kristian Rietveld <kris at imendio.com> + * gtk/gtktreeview.c (gtk_tree_view_real_expand_row): Make sure the + newly expanded row, and if possible its children, are visible to + the user. + +2007-02-06 Kristian Rietveld <kris at imendio.com> + * gtk/gtktreeprivate.h: set TREE_VIEW_DRAG_WIDTH to 28. 2007-02-06 Kristian Rietveld <kris at imendio.com> 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-06 15:11:08 UTC (rev 9693) +++ projects/haf/branches/gtk+/maemo-gtk-2-10/gtk/gtktreeview.c 2007-02-06 16:11:40 UTC (rev 9694) @@ -12340,6 +12340,14 @@ GtkTreeIter iter; GtkTreeIter temp; gboolean expand; +#ifdef MAEMO_CHANGES + gint dy; + GtkTreeIter tmpiter; + GtkTreePath *tmppath; + GtkRBTree *tmptree; + GtkRBNode *tmpnode; + gint branch_height; +#endif /* MAEMO_CHANGES */ if (animate) g_object_get (gtk_widget_get_settings (GTK_WIDGET (tree_view)), @@ -12431,8 +12439,54 @@ GTK_RBNODE_SET_FLAG (node, GTK_RBNODE_IS_SEMI_COLLAPSED); } +#ifdef MAEMO_CHANGES + /* We do validate new nodes ourselves below, but we still need + * somebody to take care of the actual resizing. + */ + if (GTK_WIDGET_MAPPED (tree_view)) + gtk_widget_queue_resize (GTK_WIDGET (tree_view)); +#endif /* MAEMO_CHANGES */ + install_presize_handler (tree_view); +#ifdef MAEMO_CHANGES + gtk_tree_model_get_iter (tree_view->priv->model, &tmpiter, path); + _gtk_tree_view_find_node (tree_view, path, &tmptree, &tmpnode); + + validate_row (tree_view, tmptree, tmpnode, &tmpiter, path); + branch_height = ROW_HEIGHT (tree_view, GTK_RBNODE_GET_HEIGHT (tmpnode)); + dy = _gtk_rbtree_node_find_offset (tmptree, tmpnode); + + tmppath = gtk_tree_path_copy (path); + gtk_tree_path_down (tmppath); + gtk_tree_model_get_iter (tree_view->priv->model, &tmpiter, tmppath); + + do + { + _gtk_tree_view_find_node (tree_view, tmppath, &tmptree, &tmpnode); + + validate_row (tree_view, tmptree, tmpnode, &tmpiter, tmppath); + branch_height += ROW_HEIGHT (tree_view, GTK_RBNODE_GET_HEIGHT (tmpnode)); + + gtk_tree_path_next (tmppath); + } + while (gtk_tree_model_iter_next (tree_view->priv->model, &tmpiter)); + + gtk_tree_path_prev (tmppath); + + /* We scroll to the just expanded row if the expanding row and its children + * do not fit in the view. + * Otherwise, if the last child is not visible, we scroll to it to make + * sure all children are visible. + */ + if (branch_height > GTK_WIDGET (tree_view)->allocation.height - TREE_VIEW_HEADER_HEIGHT (tree_view)) + gtk_tree_view_scroll_to_cell (tree_view, path, NULL, TRUE, 0.0, 0.0); + else if (dy + branch_height > tree_view->priv->vadjustment->value + tree_view->priv->vadjustment->page_size) + gtk_tree_view_scroll_to_cell (tree_view, tmppath, NULL, TRUE, 1.0, 0.0); + + gtk_tree_path_free (tmppath); +#endif /* MAEMO_CHANGES */ + g_signal_emit (tree_view, tree_view_signals[ROW_EXPANDED], 0, &iter, path); if (open_all) {
- Previous message: [maemo-commits] r9693 - projects/haf/hafbuildbot
- Next message: [maemo-commits] r9695 - projects/haf/hafbuildbot
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]