[gthumb] set the viewer to the browser size when "fit window" is disabled
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] set the viewer to the browser size when "fit window" is disabled
- Date: Sat, 7 Aug 2010 14:26:44 +0000 (UTC)
commit 0ab7191eea9607695f15214032827d166994dc0d
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Aug 7 12:34:10 2010 +0200
set the viewer to the browser size when "fit window" is disabled
extensions/image_viewer/gth-image-viewer-page.c | 18 +++++++++++++++++-
gthumb/gth-window.c | 12 ++++++++++++
gthumb/gth-window.h | 2 ++
3 files changed, 31 insertions(+), 1 deletions(-)
---
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index 6feb1ef..569614f 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -1179,8 +1179,24 @@ gth_image_viewer_page_shrink_wrap (GthImageViewerPage *self,
int max_height;
self->priv->shrink_wrap = activate;
- if (! self->priv->shrink_wrap)
+ if (! self->priv->shrink_wrap) {
+ int width;
+ int height;
+
+ if (gth_window_get_page_size (GTH_WINDOW (self->priv->browser),
+ GTH_BROWSER_PAGE_BROWSER,
+ &width,
+ &height))
+ {
+ gth_window_save_page_size (GTH_WINDOW (self->priv->browser), GTH_BROWSER_PAGE_VIEWER, width, height);
+ gth_window_apply_saved_size (GTH_WINDOW (self->priv->browser), GTH_BROWSER_PAGE_VIEWER);
+ }
+ else
+ gth_window_clear_saved_size (GTH_WINDOW (self->priv->browser), GTH_BROWSER_PAGE_VIEWER);
+ gth_image_viewer_set_fit_mode (GTH_IMAGE_VIEWER (self->priv->viewer), GTH_FIT_SIZE_IF_LARGER);
+
return;
+ }
pixbuf = gth_image_viewer_page_get_pixbuf (self);
if (pixbuf == NULL)
diff --git a/gthumb/gth-window.c b/gthumb/gth-window.c
index c759f03..ec5245e 100644
--- a/gthumb/gth-window.c
+++ b/gthumb/gth-window.c
@@ -451,6 +451,18 @@ gth_window_apply_saved_size (GthWindow *window,
}
+void
+gth_window_clear_saved_size (GthWindow *window,
+ int page)
+{
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (GTH_IS_WINDOW (window));
+ g_return_if_fail (page >= 0 && page < window->priv->n_pages);
+
+ window->priv->window_size[page].saved = FALSE;
+}
+
+
gboolean
gth_window_get_page_size (GthWindow *window,
int page,
diff --git a/gthumb/gth-window.h b/gthumb/gth-window.h
index d8a6d2d..3a92421 100644
--- a/gthumb/gth-window.h
+++ b/gthumb/gth-window.h
@@ -96,6 +96,8 @@ gboolean gth_window_get_page_size (GthWindow *window,
int page,
int *width,
int *height);
+void gth_window_clear_saved_size (GthWindow *window,
+ int page);
/**/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]