[gimp] Fix GimpContainerView::set_view_size() implementation for actual trees
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Fix GimpContainerView::set_view_size() implementation for actual trees
- Date: Thu, 27 Aug 2009 21:22:01 +0000 (UTC)
commit 5f3721235e00ef886bbc8ae7595afbc61d40a4a8
Author: Michael Natterer <mitch gimp org>
Date: Thu Aug 27 23:20:29 2009 +0200
Fix GimpContainerView::set_view_size() implementation for actual trees
app/widgets/gimpcontainertreeview.c | 47 +++++++++++++++++++++++-----------
1 files changed, 32 insertions(+), 15 deletions(-)
---
diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c
index 18b7b5a..b8a5627 100644
--- a/app/widgets/gimpcontainertreeview.c
+++ b/app/widgets/gimpcontainertreeview.c
@@ -818,6 +818,34 @@ gimp_container_tree_view_clear_items (GimpContainerView *view)
parent_view_iface->clear_items (view);
}
+typedef struct
+{
+ gint view_size;
+ gint border_width;
+} SetSizeForeachData;
+
+static gboolean
+gimp_container_tree_view_set_view_size_foreach (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer data)
+{
+ SetSizeForeachData *size_data = data;
+ GimpViewRenderer *renderer;
+
+ gtk_tree_model_get (model, iter,
+ GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
+ -1);
+
+ gimp_view_renderer_set_size (renderer,
+ size_data->view_size,
+ size_data->border_width);
+
+ g_object_unref (renderer);
+
+ return FALSE;
+}
+
static void
gimp_container_tree_view_set_view_size (GimpContainerView *view)
{
@@ -831,22 +859,11 @@ gimp_container_tree_view_set_view_size (GimpContainerView *view)
if (tree_view->model)
{
- GtkTreeIter iter;
- gboolean iter_valid;
-
- for (iter_valid = gtk_tree_model_get_iter_first (tree_view->model, &iter);
- iter_valid;
- iter_valid = gtk_tree_model_iter_next (tree_view->model, &iter))
- {
- GimpViewRenderer *renderer;
+ SetSizeForeachData size_data = { view_size, border_width };
- gtk_tree_model_get (tree_view->model, &iter,
- GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
- -1);
-
- gimp_view_renderer_set_size (renderer, view_size, border_width);
- g_object_unref (renderer);
- }
+ gtk_tree_model_foreach (tree_view->model,
+ gimp_container_tree_view_set_view_size_foreach,
+ &size_data);
}
tree_widget = GTK_WIDGET (tree_view->view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]