[Xfce4-commits] <parole:bluesabre/gtk3> Initial GtkOverlay controls... Gst overlays controls at this point

Sean Davis noreply at xfce.org
Sat Aug 31 05:28:01 CEST 2013


Updating branch refs/heads/bluesabre/gtk3
         to 4f85818fcac47d754b115d2502349baa919b5dfd (commit)
       from c2f47b715a6f8aafd65db4a66e3a417ac576ffa3 (commit)

commit 4f85818fcac47d754b115d2502349baa919b5dfd
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Fri Aug 30 23:27:31 2013 -0400

    Initial GtkOverlay controls... Gst overlays controls at this point

 src/parole-player.c |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/parole-player.c b/src/parole-player.c
index ebabcfc..402880a 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -2977,6 +2977,10 @@ parole_player_init (ParolePlayer *player)
     GtkWidget *audiotrack_box, *audiotrack_label, *subtitle_box, *subtitle_label, *infobar_close, *close_icon;
     GtkWidget *content_area;
     
+    GtkWidget *controls_overlay, *tmp_box;
+    GtkWidget *controls_parent;
+    GtkStyleContext *controls_style;
+    
     g_setenv("PULSE_PROP_media.role", "video", TRUE);
     
     player->priv = PAROLE_PLAYER_GET_PRIVATE (player);
@@ -3200,12 +3204,29 @@ parole_player_init (ParolePlayer *player)
             G_CALLBACK(parole_audiobox_expose_event), player);
     /* End Content Area */
     
-    
+    /* FIXME: UGLY CODE IN THE NEXT BLOCK */
     /* Media Controls */
+    controls_overlay = GTK_WIDGET(gtk_overlay_new());
     /* control is a placeholder to put the play_box as it is moved to/from the fs-window */
     player->priv->control = GTK_WIDGET (gtk_builder_get_object (builder, "control"));
     player->priv->play_box = GTK_WIDGET (gtk_builder_get_object (builder, "play-box"));
+    controls_parent = GTK_WIDGET(gtk_builder_get_object (builder, "box2"));
+    gtk_box_pack_start (GTK_BOX(controls_parent), controls_overlay, TRUE, TRUE, 0);
+    gtk_widget_reparent(GTK_WIDGET(player->priv->eventbox_output), controls_overlay);
+    tmp_box = GTK_WIDGET(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0));
+    gtk_widget_set_vexpand(GTK_WIDGET(tmp_box), FALSE);
+    gtk_widget_set_hexpand(GTK_WIDGET(tmp_box), FALSE);
+    gtk_widget_set_margin_left(tmp_box, 10);
+    gtk_widget_set_margin_right(tmp_box, 10);
+    gtk_widget_set_margin_bottom(tmp_box, 10);
+    gtk_widget_set_margin_top(tmp_box, 10);
+    gtk_widget_set_valign(tmp_box, GTK_ALIGN_END);
+    controls_style = gtk_widget_get_style_context(GTK_WIDGET(tmp_box));
+    gtk_style_context_add_class (controls_style, "osd");
+    gtk_widget_reparent(GTK_WIDGET(player->priv->control), tmp_box);
+    gtk_overlay_add_overlay(GTK_OVERLAY(controls_overlay), tmp_box);
     gtk_box_set_child_packing( GTK_BOX(player->priv->control), GTK_WIDGET(player->priv->play_box), TRUE, TRUE, 2, GTK_PACK_START );
+    gtk_widget_show_all(controls_parent);
     
     /* Previous, Play/Pause, Next */
     player->priv->seekb = GTK_WIDGET (gtk_builder_get_object (builder, "media_prev"));


More information about the Xfce4-commits mailing list