[Xfce4-commits] <ristretto:ristretto-0.0> Reset adjustments when no image is loaded.
Stephan Arts
noreply at xfce.org
Sun Oct 23 19:24:52 CEST 2011
Updating branch refs/heads/ristretto-0.0
to 829b15698f827857705ac70b968dfd3af7908f66 (commit)
from 2a31e2ed23f60bd7500a74172f18011f14678c4d (commit)
commit 829b15698f827857705ac70b968dfd3af7908f66
Author: Stephan Arts <stephan at xfce.org>
Date: Tue Jan 19 01:26:34 2010 +0100
Reset adjustments when no image is loaded.
src/picture_viewer.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index f206fd6..8e7e247 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -765,6 +765,22 @@ rstto_picture_viewer_set_scale (RsttoPictureViewer *viewer, gdouble scale)
rstto_picture_viewer_queued_repaint (viewer, TRUE);
}
+ else
+ {
+ /* If there is no image, set the adjustments to 0 */
+ viewer->hadjustment->upper = 0;
+ viewer->hadjustment->lower = 0;
+ viewer->hadjustment->value = 0;
+ viewer->vadjustment->upper = 0;
+ viewer->vadjustment->lower = 0;
+ viewer->vadjustment->value = 0;
+
+ gtk_adjustment_changed(viewer->hadjustment);
+ gtk_adjustment_changed(viewer->vadjustment);
+
+ gtk_adjustment_value_changed(viewer->hadjustment);
+ gtk_adjustment_value_changed(viewer->vadjustment);
+ }
}
}
@@ -1638,6 +1654,18 @@ rstto_picture_viewer_set_image (RsttoPictureViewer *viewer, RsttoImage *image)
else
{
rstto_picture_viewer_queued_repaint (viewer, TRUE);
+ viewer->hadjustment->upper = 0;
+ viewer->hadjustment->lower = 0;
+ viewer->hadjustment->value = 0;
+ viewer->vadjustment->upper = 0;
+ viewer->vadjustment->lower = 0;
+ viewer->vadjustment->value = 0;
+
+ gtk_adjustment_changed(viewer->hadjustment);
+ gtk_adjustment_changed(viewer->vadjustment);
+
+ gtk_adjustment_value_changed(viewer->hadjustment);
+ gtk_adjustment_value_changed(viewer->vadjustment);
}
}
More information about the Xfce4-commits
mailing list