Commit 19c96dcc authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

use GtkAdjustment's accessors.

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.


svn path=/trunk/; revision=28204
parent a85bbe7f
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.
2009-03-22 Sven Neumann <sven@gimp.org>
* app/batch.c (batch_run_cmd): added a newline to the output in
......
......@@ -133,6 +133,7 @@ gimp_proc_browser_dialog_init (GimpProcBrowserDialog *dialog)
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 @@ gimp_proc_browser_dialog_init (GimpProcBrowserDialog *dialog)
_("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 @@ gimp_proc_browser_dialog_init (GimpProcBrowserDialog *dialog)
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);
}
......
......@@ -337,28 +337,24 @@ gimp_zoom_preview_set_adjustments (GimpZoomPreview *preview,
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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment