[gthumb] save and restore the window maximized state



commit 3afd1cccc4aee28d3c5a7a5695f4f28ccbee2896
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun May 6 11:10:53 2012 +0200

    save and restore the window maximized state
    
    [new feature]

 data/org.gnome.gthumb.gschema.xml.in |    3 +++
 gthumb/gth-browser.c                 |    5 ++++-
 gthumb/gth-preferences.h             |    1 +
 3 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/data/org.gnome.gthumb.gschema.xml.in b/data/org.gnome.gthumb.gschema.xml.in
index 63f6b92..3083545 100644
--- a/data/org.gnome.gthumb.gschema.xml.in
+++ b/data/org.gnome.gthumb.gschema.xml.in
@@ -98,6 +98,9 @@
     <key name="window-height" type="i">
       <default>0</default>
     </key>
+    <key name="maximized" type="b">
+      <default>false</default>
+    </key>
     <key name="image-pane-visible" type="b">
       <default>true</default>
     </key>
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 544d530..2f1597b 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -2131,6 +2131,8 @@ _gth_browser_close_final_step (gpointer user_data)
 			}
 		}
 
+		g_settings_set_boolean (browser->priv->browser_settings, PREF_BROWSER_WINDOW_MAXIMIZED, maximized);
+
 		gtk_widget_get_allocation (browser->priv->browser_sidebar, &allocation);
 		if (allocation.width > MIN_SIDEBAR_SIZE)
 			g_settings_set_int (browser->priv->browser_settings, PREF_BROWSER_BROWSER_SIDEBAR_WIDTH, allocation.width);
@@ -4198,7 +4200,8 @@ gth_browser_init (GthBrowser *browser)
 		window_height = max_height;
 	}
 	gtk_window_set_default_size (GTK_WINDOW (browser), window_width, window_height);
-
+	if (g_settings_get_boolean (browser->priv->browser_settings, PREF_BROWSER_WINDOW_MAXIMIZED))
+		gtk_window_maximize(GTK_WINDOW (browser));
 	gtk_window_set_has_resize_grip (GTK_WINDOW (browser), TRUE);
 
 	/* realize the widget before adding the ui to get the icons from the icon theme */
diff --git a/gthumb/gth-preferences.h b/gthumb/gth-preferences.h
index 3a542e8..08702fe 100644
--- a/gthumb/gth-preferences.h
+++ b/gthumb/gth-preferences.h
@@ -67,6 +67,7 @@ G_BEGIN_DECLS
 #define PREF_BROWSER_TOOLBAR_STYLE            "toolbar-style"
 #define PREF_BROWSER_WINDOW_WIDTH             "window-width"
 #define PREF_BROWSER_WINDOW_HEIGHT            "window-height"
+#define PREF_BROWSER_WINDOW_MAXIMIZED         "maximized"
 #define PREF_BROWSER_TOOLBAR_VISIBLE          "toolbar-visible"
 #define PREF_BROWSER_STATUSBAR_VISIBLE        "statusbar-visible"
 #define PREF_BROWSER_FILTERBAR_VISIBLE        "filterbar-visible"



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