gimp r28204 - in trunk: . libgimp



Author: mitch
Date: Sun Mar 22 22:36:43 2009
New Revision: 28204
URL: http://svn.gnome.org/viewvc/gimp?rev=28204&view=rev

Log:
2009-03-22  Michael Natterer  <mitch gimp org>

	* libgimp/gimpzoompreview.c: use GtkAdjustment's accessors.

	* libgimp/gimpprocbrowserdialog.c: use accessors instead of
	dialog->vbox and widget->parent.



Modified:
   trunk/ChangeLog
   trunk/libgimp/gimpprocbrowserdialog.c
   trunk/libgimp/gimpzoompreview.c

Modified: trunk/libgimp/gimpprocbrowserdialog.c
==============================================================================
--- trunk/libgimp/gimpprocbrowserdialog.c	(original)
+++ trunk/libgimp/gimpprocbrowserdialog.c	Sun Mar 22 22:36:43 2009
@@ -133,6 +133,7 @@
   GtkWidget        *scrolled_window;
   GtkCellRenderer  *renderer;
   GtkTreeSelection *selection;
+  GtkWidget        *parent;
 
   dialog->browser = gimp_browser_new ();
   gimp_browser_add_search_types (GIMP_BROWSER (dialog->browser),
@@ -145,7 +146,7 @@
                                  _("by type"),        SEARCH_TYPE_PROC_TYPE,
                                  NULL);
   gtk_container_set_border_width (GTK_CONTAINER (dialog->browser), 12);
-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
+  gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
                      dialog->browser);
   gtk_widget_show (dialog->browser);
 
@@ -192,8 +193,10 @@
                     G_CALLBACK (browser_selection_changed),
                     dialog);
 
-  gtk_widget_set_size_request (GIMP_BROWSER (dialog->browser)->right_vbox->parent->parent,
-                               DBL_WIDTH - DBL_LIST_WIDTH, -1);
+  parent = gtk_widget_get_parent (GIMP_BROWSER (dialog->browser)->right_vbox);
+  parent = gtk_widget_get_parent (parent);
+
+    gtk_widget_set_size_request (parent, DBL_WIDTH - DBL_LIST_WIDTH, -1);
 }
 
 

Modified: trunk/libgimp/gimpzoompreview.c
==============================================================================
--- trunk/libgimp/gimpzoompreview.c	(original)
+++ trunk/libgimp/gimpzoompreview.c	Sun Mar 22 22:36:43 2009
@@ -337,28 +337,24 @@
   ratio = new_factor / old_factor;
 
   adj = gtk_range_get_adjustment (GTK_RANGE (scrolled_preview->hscr));
-  adj->lower          = 0;
-  adj->page_size      = width;
-  adj->upper          = width * new_factor;
-  adj->step_increment = new_factor;
-  adj->page_increment = MAX (width / 2.0, adj->step_increment);
-  adj->value          = CLAMP ((adj->value + width / 2.0) * ratio
-                               - width / 2.0,
-                               adj->lower, adj->upper - width);
-  gtk_adjustment_changed (adj);
-  gtk_adjustment_value_changed (adj);
+  gtk_adjustment_configure (adj,
+                            (gtk_adjustment_get_value (adj) + width / 2.0) * ratio
+                            - width / 2.0,
+                            0,
+                            width * new_factor,
+                            new_factor,
+                            MAX (width / 2.0, new_factor),
+                            width);
 
   adj = gtk_range_get_adjustment (GTK_RANGE (scrolled_preview->vscr));
-  adj->lower          = 0;
-  adj->page_size      = height;
-  adj->upper          = height * new_factor;
-  adj->step_increment = new_factor;
-  adj->page_increment = MAX (height / 2.0, adj->step_increment);
-  adj->value          = CLAMP ((adj->value + height / 2.0) * ratio
-                               - height / 2.0,
-                               adj->lower, adj->upper - height);
-  gtk_adjustment_changed (adj);
-  gtk_adjustment_value_changed (adj);
+  gtk_adjustment_configure (adj,
+                            (gtk_adjustment_get_value (adj) + height / 2.0) * ratio
+                            - height / 2.0,
+                            0,
+                            height * new_factor,
+                            new_factor,
+                            MAX (height / 2.0, new_factor),
+                            height);
 
   gimp_scrolled_preview_thaw (scrolled_preview);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]