[gthumb] hide the viewer sidebar and thumbnail list in fullscreen mode
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] hide the viewer sidebar and thumbnail list in fullscreen mode
- Date: Wed, 31 Mar 2010 13:21:25 +0000 (UTC)
commit 30b9692437ec1451e94b930a53abd02012b64d25
Author: Paolo Bacchilega <paobac src gnome org>
Date: Wed Mar 31 12:23:59 2010 +0200
hide the viewer sidebar and thumbnail list in fullscreen mode
and restore the previous state when exiting fullscreen mode
gthumb/gth-browser.c | 42 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 39 insertions(+), 3 deletions(-)
---
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 91f5347..b566b01 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -161,7 +161,12 @@ struct _GthBrowserPrivateData {
guint motion_signal;
gdouble last_mouse_x;
gdouble last_mouse_y;
- int page_before_fullscreen;
+ struct {
+ int page;
+ gboolean viewer_properties;
+ gboolean viewer_tools;
+ gboolean thumbnail_list;
+ } before_fullscreen;
/* history */
@@ -251,6 +256,20 @@ _gth_browser_set_action_active (GthBrowser *browser,
}
+static gboolean
+_gth_browser_get_action_active (GthBrowser *browser,
+ const char *action_name)
+{
+ GtkAction *action;
+ gboolean active;
+
+ action = gtk_action_group_get_action (browser->priv->actions, action_name);
+ g_object_get (action, "active", &active, NULL);
+
+ return active;
+}
+
+
static void
activate_go_back_menu_item (GtkMenuItem *menuitem,
gpointer data)
@@ -5104,8 +5123,15 @@ gth_browser_fullscreen (GthBrowser *browser)
g_list_free (browser->priv->fullscreen_controls);
browser->priv->fullscreen_controls = g_list_append (NULL, browser->priv->fullscreen_toolbar);
+ browser->priv->before_fullscreen.page = gth_window_get_current_page (GTH_WINDOW (browser));
+ browser->priv->before_fullscreen.viewer_properties = _gth_browser_get_action_active (browser, "Viewer_Properties");
+ browser->priv->before_fullscreen.viewer_tools = _gth_browser_get_action_active (browser, "Viewer_Tools");
+ browser->priv->before_fullscreen.thumbnail_list = _gth_browser_get_action_active (browser, "View_Thumbnail_List");
+
gth_browser_show_viewer_properties (browser, FALSE);
- browser->priv->page_before_fullscreen = gth_window_get_current_page (GTH_WINDOW (browser));
+ gth_browser_show_viewer_tools (browser, FALSE);
+
+ _gth_browser_set_thumbnail_list_visibility (browser, FALSE);
gth_window_set_current_page (GTH_WINDOW (browser), GTH_BROWSER_PAGE_VIEWER);
gth_window_show_only_content (GTH_WINDOW (browser), TRUE);
gtk_window_fullscreen (GTK_WINDOW (browser));
@@ -5137,8 +5163,18 @@ gth_browser_unfullscreen (GthBrowser *browser)
browser->priv->fullscreen = FALSE;
gtk_widget_hide (browser->priv->fullscreen_toolbar);
- gth_window_set_current_page (GTH_WINDOW (browser), browser->priv->page_before_fullscreen);
gth_window_show_only_content (GTH_WINDOW (browser), FALSE);
+ gth_window_set_current_page (GTH_WINDOW (browser), browser->priv->before_fullscreen.page);
+ _gth_browser_set_thumbnail_list_visibility (browser, browser->priv->before_fullscreen.thumbnail_list);
+ if (browser->priv->before_fullscreen.viewer_properties)
+ gth_browser_show_viewer_properties (browser, TRUE);
+ else if (browser->priv->before_fullscreen.viewer_tools)
+ gth_browser_show_viewer_tools (browser, TRUE);
+ else {
+ gth_browser_show_viewer_properties (browser, FALSE);
+ gth_browser_show_viewer_tools (browser, FALSE);
+ }
+
gtk_window_unfullscreen (GTK_WINDOW (browser));
if (browser->priv->viewer_page != NULL) {
gth_viewer_page_fullscreen (browser->priv->viewer_page, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]