[Xfce4-commits] <parole:master> Make infobar look nicer

Sean Davis noreply at xfce.org
Fri Oct 11 11:50:45 CEST 2013


Updating branch refs/heads/master
         to 39cb913bc4085e54160bfe3aaf6ee3e8449ffbec (commit)
       from 520cd967196f6291bd5415830d49683bc64a1752 (commit)

commit 39cb913bc4085e54160bfe3aaf6ee3e8449ffbec
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Wed Aug 21 20:14:38 2013 -0400

    Make infobar look nicer

 src/parole-player.c |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/parole-player.c b/src/parole-player.c
index 9b9064e..e0faa0f 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -1629,6 +1629,12 @@ parole_player_media_state_cb (ParoleGst *gst, const ParoleStream *stream, Parole
     }
 }
 
+static void
+on_infobar_close_clicked (GtkButton *button, ParolePlayer *player)
+{
+    gtk_widget_hide(player->priv->infobar);
+}
+
 void
 parole_player_play_pause_clicked (GtkButton *button, ParolePlayer *player)
 {
@@ -2927,7 +2933,7 @@ parole_player_init (ParolePlayer *player)
     
     GtkCellRenderer *cell, *sub_cell;
     
-    GtkWidget *audiotrack_box, *audiotrack_label, *subtitle_box, *subtitle_label;
+    GtkWidget *audiotrack_box, *audiotrack_label, *subtitle_box, *subtitle_label, *infobar_close, *close_icon;
     GtkWidget *content_area;
     
     g_setenv("PULSE_PROP_media.role", "video", TRUE);
@@ -3161,13 +3167,8 @@ parole_player_init (ParolePlayer *player)
 	player->priv->infobar = gtk_info_bar_new ();
 	gtk_info_bar_set_message_type (GTK_INFO_BAR (player->priv->infobar),
                             GTK_MESSAGE_QUESTION);
-	gtk_info_bar_add_button (GTK_INFO_BAR (player->priv->infobar),
-                            GTK_STOCK_CLOSE, GTK_RESPONSE_OK);
                             
     gtk_widget_set_no_show_all (player->priv->infobar, TRUE);
-    
-	g_signal_connect (G_OBJECT(player->priv->infobar), "response",
-		              G_CALLBACK (gtk_widget_hide), NULL);
 
 	content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (player->priv->infobar));
 	g_signal_connect (content_area, "size-allocate",
@@ -3207,6 +3208,13 @@ parole_player_init (ParolePlayer *player)
 	gtk_box_pack_end(GTK_BOX(subtitle_box), player->priv->combobox_subtitles, FALSE, FALSE, 0);
 	gtk_container_add(GTK_CONTAINER(content_area), subtitle_box);
 	
+	infobar_close = gtk_button_new_with_label(_("Close"));
+	close_icon = gtk_image_new_from_icon_name("dialog-close", GTK_ICON_SIZE_BUTTON);
+	gtk_button_set_image(GTK_BUTTON(infobar_close), close_icon);
+	g_signal_connect (infobar_close, "clicked",
+		      G_CALLBACK (on_infobar_close_clicked), player);
+	gtk_box_pack_end(GTK_BOX(content_area), infobar_close, FALSE, FALSE, 0);
+	
 	gtk_widget_show_all(content_area);
 	
 	player->priv->update_languages = FALSE;


More information about the Xfce4-commits mailing list