[Xfce4-commits] [apps/parole] 01/01: Add hidden setting to persistently hide the menubar and make the menubar hiding per running session persistent

noreply at xfce.org noreply at xfce.org
Tue Apr 7 21:08:34 CEST 2015


This is an automated email from the git hooks/post-receive script.

ochosi pushed a commit to branch master
in repository apps/parole.

commit 770d977315b2d326dff9a96fd8bb65b9d5093939
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Tue Apr 7 21:08:24 2015 +0200

    Add hidden setting to persistently hide the menubar
    and make the menubar hiding per running session persistent
---
 src/parole-conf.c   |   19 ++++++++++++++++++-
 src/parole-player.c |   24 ++++++++++++++++++++++--
 2 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/src/parole-conf.c b/src/parole-conf.c
index 6335d33..2d86955 100644
--- a/src/parole-conf.c
+++ b/src/parole-conf.c
@@ -81,6 +81,8 @@ enum
     PROP_WINDOW_MAXIMIZED,
     PROP_WINDOW_MINIMIZED,
     PROP_WINDOW_WIDTH,
+    PROP_HIDE_CONTROLS_TIMEOUT,
+    PROP_ALWAYS_HIDE_MENUBAR,
     N_PROP
 };
 
@@ -885,7 +887,7 @@ parole_conf_class_init (ParoleConfClass *klass)
      * Control the timeout for the playback controls to hide.
      **/
     g_object_class_install_property (object_class,
-                                     PROP_WINDOW_WIDTH,
+                                     PROP_HIDE_CONTROLS_TIMEOUT,
                                      g_param_spec_int ("hide-controls-timeout",
                                             "/hide-controls-timeout",
                                             NULL,
@@ -894,6 +896,21 @@ parole_conf_class_init (ParoleConfClass *klass)
                                             4,
                                             G_PARAM_READWRITE));
 
+    /**
+     * ParoleConf:always-hide-menubar:
+     *
+     * Xfconf property: /always-hide-menubar
+     *
+     * Persistently hide the menubar.
+     **/
+    g_object_class_install_property (object_class,
+                                     PROP_ALWAYS_HIDE_MENUBAR,
+                                     g_param_spec_boolean ("always-hide-menubar",
+                                            "/always-hide-menubar",
+                                            NULL,
+                                            FALSE,
+                                            G_PARAM_READWRITE));
+
 }
 
 /**
diff --git a/src/parole-player.c b/src/parole-player.c
index c771efb..ce14358 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -374,6 +374,7 @@ struct ParolePlayerPrivate
     GtkWidget          *dvd_menu;
     GtkWidget          *chapters_menu;
     GtkWidget          *goto_position;
+    gboolean            show_menubar;
 
     /* Media Controls */
     GtkWidget          *control;
@@ -2014,13 +2015,22 @@ parole_player_reset_controls (ParolePlayer *player, gboolean fullscreen)
     static gint current_page = 0;
 
     gboolean show_playlist;
+    gboolean always_hide_menubar = FALSE;
+
+    g_object_get (G_OBJECT (player->priv->conf),
+              "always-hide-menubar", &always_hide_menubar,
+              NULL);
 
     if ( player->priv->full_screen != fullscreen )
     {
         /* If the player is in fullscreen mode, change to windowed mode. */
         if ( player->priv->full_screen )
         {
-            gtk_widget_show (player->priv->menu_bar);
+            if (player->priv->show_menubar == TRUE)
+                gtk_widget_show (player->priv->menu_bar);
+            else if (always_hide_menubar == TRUE)
+                gtk_widget_hide (player->priv->menu_bar);
+
             show_playlist = g_simple_toggle_action_get_active (player->priv->toggle_playlist_action);
             gtk_widget_show (player->priv->playlist_nt);
             parole_player_set_playlist_visible(player, show_playlist);
@@ -2087,8 +2097,9 @@ void parole_player_fullscreen_action_cb (GSimpleAction *action)
 
 static void parole_player_hide_menubar_cb (GtkWidget *widget, ParolePlayer *player)
 {
+    player->priv->show_menubar = !gtk_widget_get_visible (player->priv->menu_bar);
     if (!player->priv->full_screen)
-        gtk_widget_set_visible(player->priv->menu_bar, !gtk_widget_get_visible(player->priv->menu_bar));
+        gtk_widget_set_visible (player->priv->menu_bar, player->priv->show_menubar);
 }
 
 static void
@@ -3162,6 +3173,7 @@ parole_player_init (ParolePlayer *player)
     gint w, h;
     gboolean maximized;
     gboolean showhide;
+    gboolean always_hide_menubar = FALSE;
     gint volume;
 
 
@@ -3331,6 +3343,8 @@ parole_player_init (ParolePlayer *player)
 
     g_signal_connect (gtk_builder_get_object (builder, "playback-menu"), "select",
             G_CALLBACK (parole_player_playback_menu_select_cb), player);
+
+    player->priv->show_menubar = TRUE;
     /* End Menu Bar */
 
 
@@ -3782,6 +3796,12 @@ parole_player_init (ParolePlayer *player)
 
     gtk_widget_show_all (player->priv->window);
 
+    g_object_get (G_OBJECT (player->priv->conf),
+              "always-hide-menubar", &always_hide_menubar,
+              NULL);
+    if (always_hide_menubar == TRUE)
+        parole_player_hide_menubar_cb (NULL, player);
+
     parole_player_set_wm_opacity_hint (player->priv->window);
 }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list