[Xfce4-commits] [apps/parole] 02/07: Add hidden option for the timeout to hide the controls

noreply at xfce.org noreply at xfce.org
Mon Jun 9 02:49:18 CEST 2014


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

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

commit 5f54b1acb5eac2d31b4c08c7d254d6bd885c08b8
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Mar 17 18:05:13 2014 +0100

    Add hidden option for the timeout to hide the controls
---
 src/parole-conf.c   |   19 +++++++++++++++++++
 src/parole-player.c |   12 ++++++++++--
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/src/parole-conf.c b/src/parole-conf.c
index b180ddf..b8a24ea 100644
--- a/src/parole-conf.c
+++ b/src/parole-conf.c
@@ -319,6 +319,8 @@ gchar *parole_conf_map_xfconf_property_name (const gchar *prop_name)
         value = g_strdup("window-maximized");
     if (g_strcmp0(prop_name, "/window/width") == 0)
         value = g_strdup("window-width");
+    if (g_strcmp0(prop_name, "/hide-controls-timeout") == 0)
+        value = g_strdup("hide-controls-timeout");
     return value;
 }
 
@@ -875,6 +877,23 @@ parole_conf_class_init (ParoleConfClass *klass)
                                             760,
                                             G_PARAM_READWRITE));
 
+    /**
+     * ParoleConf:hide-controls-timeout:
+     * 
+     * Xfconf property: /hide-controls-timeout
+     * 
+     * Control the timeout for the playback controls to hide.
+     **/
+    g_object_class_install_property (object_class,
+                                     PROP_WINDOW_WIDTH,
+                                     g_param_spec_int ("hide-controls-timeout",
+                                            "/hide-controls-timeout", 
+                                            NULL,
+                                            1,
+                                            G_MAXINT16,
+                                            4,
+                                            G_PARAM_READWRITE));
+
 }
 
 /**
diff --git a/src/parole-player.c b/src/parole-player.c
index 3e013d1..82a4244 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -1356,6 +1356,7 @@ parole_player_playing (ParolePlayer *player, const ParoleStream *stream)
     gint64 duration;
     gboolean seekable;
     gboolean live;
+    int hide_controls_timeout;
     
     parole_media_list_set_row_playback_state (player->priv->list, player->priv->row, PAROLE_MEDIA_STATE_PLAYING);
     
@@ -1414,7 +1415,10 @@ parole_player_playing (ParolePlayer *player, const ParoleStream *stream)
     gtk_widget_grab_focus (player->priv->gst);
     parole_player_update_languages (player, PAROLE_GST(player->priv->gst));
     
-    g_timeout_add_seconds (4, (GSourceFunc) parole_player_hide_controls, player);
+    g_object_get (G_OBJECT (player->priv->conf),
+                  "hide-controls-timeout", &hide_controls_timeout,
+                  NULL);
+    g_timeout_add_seconds (hide_controls_timeout, (GSourceFunc) parole_player_hide_controls, player);
 }
 
 static void
@@ -2128,6 +2132,7 @@ gboolean
 parole_player_gst_widget_motion_notify_event (GtkWidget *widget, GdkEventMotion *ev, ParolePlayer *player)
 {
     static gulong hide_timeout = 0;
+    int hide_controls_timeout;
     GdkWindow *gdkwindow;
     
     if ( hide_timeout != 0)
@@ -2141,8 +2146,11 @@ parole_player_gst_widget_motion_notify_event (GtkWidget *widget, GdkEventMotion
     gdkwindow = gtk_widget_get_window (GTK_WIDGET(player->priv->eventbox_output));
     gdk_window_set_cursor (gdkwindow, NULL);
     
+    g_object_get (G_OBJECT (player->priv->conf),
+                  "hide-controls-timeout", &hide_controls_timeout,
+                  NULL);
     if ( player->priv->state == PAROLE_STATE_PLAYING )
-        hide_timeout = g_timeout_add_seconds (4, (GSourceFunc) parole_player_hide_controls, player);
+        hide_timeout = g_timeout_add_seconds (hide_controls_timeout, (GSourceFunc) parole_player_hide_controls, player);
 
     return FALSE;
 }

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


More information about the Xfce4-commits mailing list