]> spindle.queued.net Git - midori/commitdiff
Hide all bars in fullscreen and a menu to Unfullscreen
authorPeter Hatina <phatina@redhat.com>
Fri, 11 Nov 2011 00:22:15 +0000 (01:22 +0100)
committerChristian Dywan <christian@twotoasts.de>
Fri, 11 Nov 2011 00:22:15 +0000 (01:22 +0100)
Fixes: https://bugs.launchpad.net/midori/+bug/783675
midori/midori-browser.c
midori/midori-view.c

index e8633142cf35ecb94b137b20572d0898e0cc0e9f..a34a8352f52d7c555de5bfe2ede243c41830754b 100644 (file)
@@ -3470,9 +3470,34 @@ _action_fullscreen_activate (GtkAction*     action,
 
     state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (browser)));
     if (state & GDK_WINDOW_STATE_FULLSCREEN)
+    {
+        if (katze_object_get_boolean (G_OBJECT (browser->settings), "show-panel"))
+            gtk_widget_show (browser->panel);
+
+        if (katze_object_get_boolean (G_OBJECT (browser->settings), "show-bookmarkbar"))
+            gtk_widget_show (browser->bookmarkbar);
+
+        if (browser->show_navigationbar)
+            gtk_widget_show (browser->navigationbar);
+
+        if (browser->show_statusbar)
+            gtk_widget_show (browser->statusbar);
+
+        if (browser->show_tabs)
+            gtk_notebook_set_show_tabs (GTK_NOTEBOOK (browser->notebook), TRUE);
+
         gtk_window_unfullscreen (GTK_WINDOW (browser));
+    }
     else
+    {
+        gtk_widget_hide (browser->panel);
+        gtk_widget_hide (browser->bookmarkbar);
+        gtk_widget_hide (browser->navigationbar);
+        gtk_widget_hide (browser->statusbar);
+        gtk_notebook_set_show_tabs (GTK_NOTEBOOK (browser->notebook), FALSE);
+
         gtk_window_fullscreen (GTK_WINDOW (browser));
+    }
 }
 
 static void
@@ -3657,8 +3682,9 @@ _action_location_focus_out (GtkAction*     action,
                             MidoriBrowser* browser)
 {
     GtkWidget* view = midori_browser_get_current_tab (browser);
+    GdkWindowState state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (browser)));
 
-    if (!browser->show_navigationbar)
+    if (!browser->show_navigationbar || state & GDK_WINDOW_STATE_FULLSCREEN)
         gtk_widget_hide (browser->navigationbar);
 
     if (g_object_get_data (G_OBJECT (view), "news-feeds"))
@@ -3945,8 +3971,13 @@ static void
 _action_search_focus_out (GtkAction*     action,
                           MidoriBrowser* browser)
 {
-    if (gtk_widget_get_visible (browser->statusbar) && !browser->show_navigationbar)
+    GdkWindowState state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (browser)));
+    if ((gtk_widget_get_visible (browser->statusbar)
+            && !browser->show_navigationbar)
+            || (state & GDK_WINDOW_STATE_FULLSCREEN))
+    {
         gtk_widget_hide (browser->navigationbar);
+    }
 }
 
 static void
index ca3a975ec21d2befa6633feecaea128325d047eb..86ea575c5fab2b6801492ba75e7be72073d7d4da 100644 (file)
@@ -2625,6 +2625,17 @@ midori_view_populate_popup (MidoriView* view,
         g_object_set_data (G_OBJECT (menuitem), "y", GINT_TO_POINTER (y));
     }
 
+    GdkWindowState state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (browser)));
+    if (state & GDK_WINDOW_STATE_FULLSCREEN)
+    {
+        menuitem = sokoke_action_create_popup_menu_item (
+            gtk_action_group_get_action (actions, "Fullscreen"));
+
+        gtk_image_menu_item_set_use_stock (GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
+        gtk_menu_item_set_label (GTK_MENU_ITEM (menuitem), GTK_STOCK_LEAVE_FULLSCREEN);
+        gtk_menu_shell_append (menu_shell, menuitem);
+    }
+
     gtk_widget_show_all (menu);
 }