[gthumb] image_viewer: use gtk_adjustment_configure when the allocated size changes
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] image_viewer: use gtk_adjustment_configure when the allocated size changes
- Date: Sat, 15 Jan 2011 16:51:45 +0000 (UTC)
commit 54e7e953abd2f10c159358cf6350c252db9a8054
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Jan 15 16:59:38 2011 +0100
image_viewer: use gtk_adjustment_configure when the allocated size changes
gthumb/gth-image-viewer.c | 61 +++++++++++++++++++++++++--------------------
1 files changed, 34 insertions(+), 27 deletions(-)
---
diff --git a/gthumb/gth-image-viewer.c b/gthumb/gth-image-viewer.c
index 351c634..be9b551 100644
--- a/gthumb/gth-image-viewer.c
+++ b/gthumb/gth-image-viewer.c
@@ -570,15 +570,15 @@ gth_image_viewer_size_allocate (GtkWidget *widget,
if (width > gdk_width)
self->x_offset = CLAMP (self->x_offset,
- 0,
- width - gdk_width);
+ 0,
+ width - gdk_width);
else
self->x_offset = 0;
if (height > gdk_height)
self->y_offset = CLAMP (self->y_offset,
- 0,
- height - gdk_height);
+ 0,
+ height - gdk_height);
else
self->y_offset = 0;
@@ -589,40 +589,48 @@ gth_image_viewer_size_allocate (GtkWidget *widget,
/* Change adjustment values. */
- gtk_adjustment_set_lower (self->hadj, 0.0);
- gtk_adjustment_set_upper (self->hadj, width);
- gtk_adjustment_set_value (self->hadj, self->x_offset);
- gtk_adjustment_set_step_increment (self->hadj, STEP_INCREMENT);
- gtk_adjustment_set_page_increment (self->hadj, gdk_width / 2);
- gtk_adjustment_set_page_size (self->hadj, gdk_width);
-
- gtk_adjustment_set_lower (self->vadj, 0.0);
- gtk_adjustment_set_upper (self->vadj, height);
- gtk_adjustment_set_value (self->vadj, self->y_offset);
- gtk_adjustment_set_step_increment (self->vadj, STEP_INCREMENT);
- gtk_adjustment_set_page_increment (self->vadj, gdk_height / 2);
- gtk_adjustment_set_page_size (self->vadj, gdk_height);
+ gtk_adjustment_configure (self->hadj,
+ self->x_offset,
+ 0.0,
+ width,
+ STEP_INCREMENT,
+ gdk_width / 2,
+ gdk_width);
+ gtk_adjustment_configure (self->vadj,
+ self->y_offset,
+ 0.0,
+ height,
+ STEP_INCREMENT,
+ gdk_height / 2,
+ gdk_height);
}
else {
- gtk_adjustment_set_lower (self->hadj, 0.0);
- gtk_adjustment_set_upper (self->hadj, 1.0);
- gtk_adjustment_set_value (self->hadj, 0.0);
- gtk_adjustment_set_page_size (self->hadj, 1.0);
-
- gtk_adjustment_set_lower (self->vadj, 0.0);
- gtk_adjustment_set_upper (self->vadj, 1.0);
- gtk_adjustment_set_value (self->vadj, 0.0);
- gtk_adjustment_set_page_size (self->vadj, 1.0);
+ gtk_adjustment_configure (self->hadj,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.1,
+ 1.0,
+ 1.0);
+ gtk_adjustment_configure (self->vadj,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.1,
+ 1.0,
+ 1.0);
}
_gth_image_viewer_update_image_area (self);
+ /* FIXME
g_signal_handlers_block_by_data (G_OBJECT (self->hadj), self);
g_signal_handlers_block_by_data (G_OBJECT (self->vadj), self);
gtk_adjustment_changed (self->hadj);
gtk_adjustment_changed (self->vadj);
g_signal_handlers_unblock_by_data (G_OBJECT (self->hadj), self);
g_signal_handlers_unblock_by_data (G_OBJECT (self->vadj), self);
+ */
/**/
@@ -740,7 +748,6 @@ gth_image_viewer_expose (GtkWidget *widget,
self = GTH_IMAGE_VIEWER (widget);
cr = gdk_cairo_create (gtk_widget_get_window (widget));
-
cairo_set_line_width (cr, 0.5);
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]