From: Darren S. <ds...@us...> - 2004-12-15 19:20:40
|
Update of /cvsroot/xine/gnome-xine/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6643/src Modified Files: noskin_window.c Log Message: Updated/new speaker icons. Speaker button now shows a crossed-out speaker when audio is muted. Fix toolbar close button (wasn't setting closed state properly). Index: noskin_window.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/noskin_window.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- noskin_window.c 9 Dec 2004 00:50:27 -0000 1.32 +++ noskin_window.c 15 Dec 2004 19:20:29 -0000 1.33 @@ -40,6 +40,7 @@ #include "menu.h" #include "drag_drop.h" #include "gtkvideo.h" +#include "gtkflipbutton.h" #include "infobar.h" #include "time_widget.h" #include "vis.h" @@ -49,6 +50,7 @@ #include "pause.xpm" #include "stop.xpm" #include "speaker.xpm" +#include "nospeaker.xpm" #include "sliders.xpm" #include "fast_forward.xpm" @@ -91,14 +93,38 @@ ui_set_status (UI_CURRENT_STATE); } -static GtkWidget *add_pix_button (GtkWidget *box, gchar **pixmap_array, - char * cmd, char *tip, gboolean toggle, - gboolean start) +static GtkWidget *add_pix_button_common (GtkWidget *box, GtkWidget *button, + char *cmd, char *tip, gboolean start) +{ + gtk_button_set_relief (GTK_BUTTON(button), GTK_RELIEF_NONE); + if (start) + gtk_box_pack_start (GTK_BOX(box), button, FALSE, FALSE, 2); + else + gtk_box_pack_end (GTK_BOX(box), button, FALSE, FALSE, 2); + + g_signal_connect (GTK_OBJECT(button), "clicked", + G_CALLBACK(control_cb), cmd); + gtk_tooltips_set_tip (GTK_TOOLTIPS(tips), button, tip, NULL); + gtk_widget_show_all (button); + return button; +} + +static GtkWidget *new_pixmap (gchar **xpm) { - GtkWidget *button, *icon; GdkPixmap *image; GdkBitmap *transparent; + image = gdk_pixmap_colormap_create_from_xpm_d + (NULL, gdk_colormap_get_system(), &transparent, NULL, xpm); + return gtk_pixmap_new (image, transparent); +} + +static GtkWidget *add_pix_button (GtkWidget *box, gchar **pixmap_array, + char *cmd, char *tip, gboolean toggle, + gboolean start) +{ + GtkWidget *button; + if (toggle) { button = gtk_toggle_button_new (); @@ -107,29 +133,19 @@ } else button = gtk_button_new (); - gtk_button_set_relief (GTK_BUTTON(button), GTK_RELIEF_NONE); - image = gdk_pixmap_colormap_create_from_xpm_d(NULL, gdk_colormap_get_system(), - &transparent, NULL, pixmap_array); - icon = gtk_pixmap_new(image, transparent); - gtk_container_add(GTK_CONTAINER(button), icon); - /* gtk_container_add(GTK_CONTAINER(box), button); */ - - if (start) - gtk_box_pack_start (GTK_BOX(box), button, FALSE, FALSE, 2); - else - gtk_box_pack_end (GTK_BOX(box), button, FALSE, FALSE, 2); - - g_signal_connect (GTK_OBJECT(button), "clicked", - G_CALLBACK(control_cb), - cmd); - - gtk_tooltips_set_tip(GTK_TOOLTIPS (tips), button, - tip, NULL); - - gtk_widget_show(icon); - gtk_widget_show(button); + gtk_container_add (GTK_CONTAINER(button), new_pixmap (pixmap_array)); + return add_pix_button_common (box, button, cmd, tip, start); +} - return button; +static GtkWidget *add_pix_flip_button (GtkWidget *box, gchar **inactive, + gchar **active, char * cmd, char *tip, + gboolean start) +{ + GtkWidget *button = gtk_flip_button_new (new_pixmap (inactive), + new_pixmap (active)); + g_signal_connect (GTK_OBJECT(button), "toggled", + G_CALLBACK(toggle_cb), NULL); + return add_pix_button_common (box, button, cmd, tip, start); } /* @@ -325,15 +341,15 @@ vbox = gtk_vbox_new (0, 2); gtk_box_pack_end (GTK_BOX(ctrl), vbox, FALSE, FALSE, 2); - w = button_icon_new (GTK_STOCK_CLOSE, _("Hide control bar")); + w = button_icon_new (GTK_STOCK_CLOSE, _("Hide toolbar")); gtk_box_pack_start_defaults (GTK_BOX(vbox), w); g_signal_connect_swapped (GTK_OBJECT(w), "clicked", - G_CALLBACK(gtk_widget_hide), controlwindow); + G_CALLBACK(ui_toolbar_toggle), NULL); - cw_top = button_icon_new (GTK_STOCK_GO_UP, _("Move control bar to top")); + cw_top = button_icon_new (GTK_STOCK_GO_UP, _("Move toolbar to top")); gtk_box_pack_start_defaults (GTK_BOX(vbox), cw_top); cw_bottom = button_icon_new (GTK_STOCK_GO_DOWN, - _("Move control bar to bottom")); + _("Move toolbar to bottom")); gtk_box_pack_start_defaults (GTK_BOX(vbox), cw_bottom); g_signal_connect (GTK_OBJECT(cw_top), "clicked", G_CALLBACK(cw_top_bottom_cb), cw_bottom); @@ -480,8 +496,8 @@ ui_register_control_button (Control_MUTE, - add_pix_button (ctrl, speaker_xpm, - "set_mute ();", _("Mute/unmute"), TRUE, FALSE)); + add_pix_flip_button (ctrl, nospeaker_xpm, speaker_xpm, + "set_mute ();", _("Mute/unmute"), FALSE)); gtk_box_pack_end (GTK_BOX(sliderbox), ctrl, FALSE, FALSE, 4); |