[Xfce4-commits] [apps/parole] 01/01: Open file when clicking on play logo, show replay button on media close and make it work as well

noreply at xfce.org noreply at xfce.org
Sun Feb 5 02:15:43 CET 2017


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

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

commit 85ee19ae7ca7e4df0abbd94a0c93eaa7a6b6fd39
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Feb 4 20:15:37 2017 -0500

    Open file when clicking on play logo, show replay button on media close and make it work as well
---
 data/interfaces/parole.ui |  1 +
 src/parole-player.c       | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/data/interfaces/parole.ui b/data/interfaces/parole.ui
index 53ea1eb..8ccf808 100644
--- a/data/interfaces/parole.ui
+++ b/data/interfaces/parole.ui
@@ -786,6 +786,7 @@
                             <child>
                               <object class="GtkButton" id="media_playpause">
                                 <property name="visible">True</property>
+                                <property name="sensitive">False</property>
                                 <property name="can_focus">False</property>
                                 <property name="receives_default">True</property>
                                 <property name="image">image_media_playpause</property>
diff --git a/src/parole-player.c b/src/parole-player.c
index 51476a8..1c3a4f6 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -1404,6 +1404,8 @@ parole_player_playing (ParolePlayer *player, const ParoleStream *stream)
 
     int hide_controls_timeout;
 
+    gtk_widget_set_sensitive(player->priv->playpause_button, TRUE);
+
     parole_media_list_set_row_playback_state (player->priv->list, player->priv->row, PAROLE_MEDIA_STATE_PLAYING);
 
     g_object_get (G_OBJECT (stream),
@@ -1508,6 +1510,7 @@ parole_player_quit (ParolePlayer *player)
 static void
 parole_player_stopped (ParolePlayer *player)
 {
+    GdkPixbuf *logo;
     gchar dur_text[128];
     TRACE ("Player stopped");
 
@@ -1519,6 +1522,9 @@ parole_player_stopped (ParolePlayer *player)
 
     gtk_widget_hide(player->priv->videobox);
     gtk_widget_hide(player->priv->audiobox);
+
+    logo = gdk_pixbuf_new_from_file (g_strdup_printf ("%s/replay.png", PIXMAPS_DIR), NULL);
+    gtk_image_set_from_pixbuf(GTK_IMAGE(player->priv->logo_image), logo);
     gtk_widget_show(player->priv->logo_image);
 
     get_time_string (dur_text, 0);
@@ -2261,6 +2267,7 @@ gboolean
 parole_player_gst_widget_button_press (GtkWidget *widget, GdkEventButton *ev, ParolePlayer *player)
 {
     gboolean ret_val = FALSE;
+    gboolean sensitive = FALSE;
 
     if ( ev->type == GDK_2BUTTON_PRESS )
     {
@@ -2268,6 +2275,18 @@ parole_player_gst_widget_button_press (GtkWidget *widget, GdkEventButton *ev, Pa
         ret_val = TRUE;
     }
 
+    else if ( gtk_widget_get_visible (player->priv->logo_image) )
+    {
+        g_object_get (G_OBJECT (player->priv->playpause_button),
+            "sensitive", &sensitive,
+            NULL);
+
+        if (sensitive)
+            parole_player_toggle_playpause (player);
+        else
+            parole_media_list_open (player->priv->list);
+    }
+
     return ret_val;
 }
 

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


More information about the Xfce4-commits mailing list