]> Pileus Git - aweather/commitdiff
Fix toolbar hiding bug
authorAndy Spencer <andy753421@gmail.com>
Mon, 2 Jan 2012 00:09:08 +0000 (00:09 +0000)
committerAndy Spencer <andy753421@gmail.com>
Mon, 2 Jan 2012 00:09:08 +0000 (00:09 +0000)
On Mac OS, the toolbar is hidden by default because the menus are part
of the OS menu bar. However they were incorrectly re-shown after
toggling fullscreen.

src/aweather-gui.c

index df5e84695aa9a9d265d3a7fa2e2fd9e133843301..4c234e55949b7265e90fb7dcac7a08a9ecb88a33 100644 (file)
@@ -180,7 +180,9 @@ G_MODULE_EXPORT void on_fullscreen(GtkToggleAction *action, AWeatherGui *self)
        GtkWidget *toolbar = aweather_gui_get_widget(self, "main_toolbar");
        GtkWidget *sidebar = aweather_gui_get_widget(self, "main_sidebar");
        GtkWidget *tabs    = aweather_gui_get_widget(self, "main_tabs");
+       static gboolean menushow = TRUE; // Toolbar can be always disabled
        if (gtk_toggle_action_get_active(action)) {
+               menushow = gtk_widget_get_visible(menu);
                gtk_window_fullscreen(GTK_WINDOW(self));
                gtk_widget_hide(menu);
                _gtk_widget_autohide(toolbar, GTK_WIDGET(self->viewer), GTK_POS_TOP);
@@ -188,7 +190,7 @@ G_MODULE_EXPORT void on_fullscreen(GtkToggleAction *action, AWeatherGui *self)
                _gtk_widget_autohide(tabs,    GTK_WIDGET(self->viewer), GTK_POS_BOTTOM);
        } else {
                gtk_window_unfullscreen(GTK_WINDOW(self));
-               gtk_widget_show(menu);
+               gtk_widget_set_visible(menu, menushow);
                _gtk_widget_autoshow(toolbar);
                _gtk_widget_autoshow(sidebar);
                _gtk_widget_autoshow(tabs);