Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/totem/ChangeLog,v
retrieving revision 1.1489
diff -p -u -r1.1489 ChangeLog
--- ChangeLog	31 Oct 2005 12:24:56 -0000	1.1489
+++ ChangeLog	31 Oct 2005 23:57:13 -0000
@@ -1,3 +1,12 @@
+2005-10-31  William Jon McCann  <mccann@jhu.edu>
+
+	* src/totem-private.h: 
+	* data/totem.glade: 
+	* src/totem.c (play_pause_set_label) 
+	(totem_action_set_mrl_with_warning, on_play_button_toggled) 
+	(on_pause_button_toggled, totem_callback_connect, main):
+	Use toggle buttons for play and pause.  (Closes #162949)
+
 2005-10-31  Bastien Nocera  <hadess@hadess.net>
 
 	* NEWS: upd
Index: data/totem.glade
===================================================================
RCS file: /cvs/gnome/totem/data/totem.glade,v
retrieving revision 1.112
diff -p -u -r1.112 totem.glade
--- data/totem.glade	28 Oct 2005 14:44:48 -0000	1.112
+++ data/totem.glade	31 Oct 2005 23:57:14 -0000
@@ -1605,16 +1605,17 @@ AC3 Passthrough</property>
 	  </child>
 
 	  <child>
-	    <widget class="GtkButton" id="tcw_pp_button">
+	    <widget class="GtkToggleButton" id="tcw_play_button">
 	      <property name="visible">True</property>
-	      <property name="sensitive">False</property>
-	      <property name="tooltip" translatable="yes">Play/Pause</property>
+	      <property name="tooltip" translatable="yes">Play</property>
 	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
 	      <property name="focus_on_click">True</property>
+	      <property name="active">False</property>
+	      <property name="inconsistent">False</property>
 
 	      <child>
-		<widget class="GtkImage" id="tcw_pp_button_image">
+		<widget class="GtkImage" id="image178">
 		  <property name="visible">True</property>
 		  <property name="stock">gtk-media-play</property>
 		  <property name="icon_size">4</property>
@@ -1633,6 +1634,35 @@ AC3 Passthrough</property>
 	  </child>
 
 	  <child>
+	    <widget class="GtkToggleButton" id="tcw_pause_button">
+	      <property name="visible">True</property>
+	      <property name="tooltip" translatable="yes">Pause</property>
+	      <property name="can_focus">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="active">False</property>
+	      <property name="inconsistent">False</property>
+
+	      <child>
+		<widget class="GtkImage" id="image179">
+		  <property name="visible">True</property>
+		  <property name="stock">gtk-media-pause</property>
+		  <property name="icon_size">4</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		</widget>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
 	    <widget class="GtkButton" id="tcw_next_button">
 	      <property name="visible">True</property>
 	      <property name="sensitive">False</property>
@@ -2875,18 +2905,48 @@ AC3 Passthrough</property>
 		      </child>
 
 		      <child>
-			<widget class="GtkButton" id="tmw_play_pause_button">
+			<widget class="GtkToggleButton" id="tmw_play_button">
 			  <property name="visible">True</property>
-			  <property name="sensitive">False</property>
-			  <property name="tooltip" translatable="yes">Play/Pause</property>
+			  <property name="tooltip" translatable="yes">Play</property>
 			  <property name="can_focus">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
 			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
 
 			  <child>
-			    <widget class="GtkImage" id="tmw_play_pause_button_image">
+			    <widget class="GtkImage" id="image180">
 			      <property name="visible">True</property>
 			      <property name="stock">gtk-media-play</property>
+			      <property name="icon_size">4</property>
+			      <property name="xalign">0.5</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			    </widget>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkToggleButton" id="tmw_pause_button">
+			  <property name="visible">True</property>
+			  <property name="tooltip" translatable="yes">Pause</property>
+			  <property name="can_focus">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+
+			  <child>
+			    <widget class="GtkImage" id="image181">
+			      <property name="visible">True</property>
+			      <property name="stock">gtk-media-pause</property>
 			      <property name="icon_size">4</property>
 			      <property name="xalign">0.5</property>
 			      <property name="yalign">0.5</property>
Index: src/totem-private.h
===================================================================
RCS file: /cvs/gnome/totem/src/totem-private.h,v
retrieving revision 1.35
diff -p -u -r1.35 totem-private.h
--- src/totem-private.h	22 Oct 2005 16:04:11 -0000	1.35
+++ src/totem-private.h	31 Oct 2005 23:57:14 -0000
@@ -82,9 +82,11 @@ struct Totem {
 	GtkWidget *about;
 
 	/* Play/Pause */
-	GtkWidget *pp_button;
+	GtkWidget *play_button;
+	GtkWidget *pause_button;
 	/* fullscreen Play/Pause */
-	GtkWidget *fs_pp_button;
+	GtkWidget *fs_play_button;
+	GtkWidget *fs_pause_button;
 	GtkTooltips *tooltip;
 
 	/* Seek */
Index: src/totem.c
===================================================================
RCS file: /cvs/gnome/totem/src/totem.c,v
retrieving revision 1.469
diff -p -u -r1.469 totem.c
--- src/totem.c	31 Oct 2005 12:24:57 -0000	1.469
+++ src/totem.c	31 Oct 2005 23:57:14 -0000
@@ -109,8 +109,8 @@ static gboolean popup_hide (Totem *totem
 static void update_buttons (Totem *totem);
 static void update_media_menu_items (Totem *totem);
 static void update_seekable (Totem *totem, gboolean force_false);
-static void on_play_pause_button_clicked (GtkToggleButton *button,
-		Totem *totem);
+static void on_play_button_toggled (GtkToggleButton *button, Totem *totem);
+static void on_pause_button_toggled (GtkToggleButton *button, Totem *totem);
 static void playlist_changed_cb (GtkWidget *playlist, Totem *totem);
 static void show_controls (Totem *totem, gboolean was_fullscreen);
 static gboolean totem_is_fullscreen (Totem *totem);
@@ -234,8 +234,7 @@ main_window_destroy_cb (GtkWidget *widge
 static void
 play_pause_set_label (Totem *totem, TotemStates state)
 {
-	GtkWidget *image;
-	const char *id, *tip;
+	gboolean playing = FALSE;
 
 	if (state == totem->state)
 		return;
@@ -245,37 +244,46 @@ play_pause_set_label (Totem *totem, Tote
 	case STATE_PLAYING:
 		totem_statusbar_set_text (TOTEM_STATUSBAR (totem->statusbar),
 				_("Playing"));
-		id = GTK_STOCK_MEDIA_PAUSE;
-		tip = N_("Pause");
+		playing = TRUE;
 		break;
 	case STATE_PAUSED:
 		totem_statusbar_set_text (TOTEM_STATUSBAR (totem->statusbar),
 				_("Paused"));
-		id = GTK_STOCK_MEDIA_PLAY;
-		tip = N_("Play");
 		break;
 	case STATE_STOPPED:
 		totem_statusbar_set_text (TOTEM_STATUSBAR (totem->statusbar),
 				_("Stopped"));
 		totem_statusbar_set_time_and_length
 			(TOTEM_STATUSBAR (totem->statusbar), 0, 0);
-		id = GTK_STOCK_MEDIA_PLAY;
-		tip = N_("Play");
 		break;
 	default:
 		return;
 	}
 
-	gtk_tooltips_set_tip (GTK_TOOLTIPS (totem->tooltip),
-			totem->pp_button, _(tip), NULL);
-	gtk_tooltips_set_tip (GTK_TOOLTIPS (totem->tooltip),
-			totem->fs_pp_button, _(tip), NULL);
-
-	image = glade_xml_get_widget (totem->xml,
-			"tmw_play_pause_button_image");
-	gtk_image_set_from_stock (GTK_IMAGE (image), id, GTK_ICON_SIZE_BUTTON);
-	image = glade_xml_get_widget (totem->xml, "tcw_pp_button_image");
-	gtk_image_set_from_stock (GTK_IMAGE (image), id, GTK_ICON_SIZE_BUTTON);
+	g_signal_handlers_disconnect_by_func (totem->play_button,
+					      on_play_button_toggled, totem);
+	g_signal_handlers_disconnect_by_func (totem->fs_play_button,
+					      on_play_button_toggled, totem);
+	g_signal_handlers_disconnect_by_func (totem->pause_button,
+					      on_pause_button_toggled, totem);
+	g_signal_handlers_disconnect_by_func (totem->fs_pause_button,
+					      on_pause_button_toggled, totem);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (totem->play_button),
+				      playing);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (totem->fs_play_button),
+				      playing);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (totem->pause_button),
+				      !playing);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (totem->fs_pause_button),
+				      !playing);
+	g_signal_connect (totem->play_button, "toggled",
+			  G_CALLBACK (on_play_button_toggled), totem);
+	g_signal_connect (totem->fs_play_button, "toggled",
+			  G_CALLBACK (on_play_button_toggled), totem);
+	g_signal_connect (totem->pause_button, "toggled",
+			  G_CALLBACK (on_pause_button_toggled), totem);
+	g_signal_connect (totem->fs_pause_button, "toggled",
+			  G_CALLBACK (on_pause_button_toggled), totem);
 
 	totem->state = state;
 }
@@ -717,7 +725,8 @@ totem_action_set_mrl_with_warning (Totem
 		retval = FALSE;
 
 		/* Play/Pause */
-		gtk_widget_set_sensitive (totem->pp_button, FALSE);
+		gtk_widget_set_sensitive (totem->play_button, FALSE);
+		gtk_widget_set_sensitive (totem->pause_button, FALSE);
 
 		totem_main_set_sensitivity ("tmw_play_menu_item", FALSE);
 		totem_popup_set_sensitivity ("trcm_play", FALSE);
@@ -734,7 +743,9 @@ totem_action_set_mrl_with_warning (Totem
 
 		/* Control popup */
 		gtk_widget_set_sensitive (totem->fs_seek, FALSE);
-		gtk_widget_set_sensitive (totem->fs_pp_button, FALSE);
+		gtk_widget_set_sensitive (totem->fs_play_button, FALSE);
+		gtk_widget_set_sensitive (totem->fs_pause_button, FALSE);
+
 		totem_main_set_sensitivity ("tcw_previous_button", FALSE);
 		totem_main_set_sensitivity ("tcw_next_button", FALSE);
 		totem_popup_set_sensitivity ("trcm_next_chapter", FALSE);
@@ -767,9 +778,11 @@ totem_action_set_mrl_with_warning (Totem
 
 		/* Play/Pause */
 		totem_main_set_sensitivity ("tmw_play_menu_item", TRUE);
-		gtk_widget_set_sensitive (totem->pp_button, TRUE);
+		gtk_widget_set_sensitive (totem->play_button, TRUE);
+		gtk_widget_set_sensitive (totem->pause_button, TRUE);
 		totem_popup_set_sensitivity ("trcm_play", TRUE);
-		gtk_widget_set_sensitive (totem->fs_pp_button, TRUE);
+		gtk_widget_set_sensitive (totem->fs_play_button, TRUE);
+		gtk_widget_set_sensitive (totem->fs_pause_button, TRUE);
 
 		/* Seek bar */
 		update_seekable (totem,
@@ -1158,7 +1171,13 @@ drag_video_cb (GtkWidget *widget,
 }
 
 static void
-on_play_pause_button_clicked (GtkToggleButton *button, Totem *totem)
+on_play_button_toggled (GtkToggleButton *button, Totem *totem)
+{
+	TOTEM_PROFILE (totem_action_play_pause (totem));
+}
+
+static void
+on_pause_button_toggled (GtkToggleButton *button, Totem *totem)
 {
 	TOTEM_PROFILE (totem_action_play_pause (totem));
 }
@@ -3015,10 +3034,12 @@ totem_callback_connect (Totem *totem)
 			G_CALLBACK (on_show_controls2_activate), totem);
 
 	/* Controls */
-	totem->pp_button = glade_xml_get_widget
-		(totem->xml, "tmw_play_pause_button");
-	g_signal_connect (G_OBJECT (totem->pp_button), "clicked",
-			G_CALLBACK (on_play_pause_button_clicked), totem);
+	totem->play_button = glade_xml_get_widget (totem->xml, "tmw_play_button");
+	totem->pause_button = glade_xml_get_widget (totem->xml, "tmw_pause_button");
+	g_signal_connect (G_OBJECT (totem->play_button), "toggled",
+			  G_CALLBACK (on_play_button_toggled), totem);
+	g_signal_connect (G_OBJECT (totem->pause_button), "toggled",
+			  G_CALLBACK (on_pause_button_toggled), totem);
 	item = glade_xml_get_widget (totem->xml, "tmw_previous_button");
 	g_signal_connect (G_OBJECT (item), "clicked",
 			G_CALLBACK (on_previous_button_clicked), totem);
@@ -3068,9 +3089,13 @@ totem_callback_connect (Totem *totem)
 			G_CALLBACK (on_video_motion_notify_event), totem);
 
 	/* Control Popup */
-	g_signal_connect (G_OBJECT (totem->fs_pp_button), "clicked",
-			G_CALLBACK (on_play_pause_button_clicked), totem);
-	g_signal_connect (G_OBJECT (totem->fs_pp_button), "clicked",
+	g_signal_connect (G_OBJECT (totem->fs_play_button), "toggled",
+			G_CALLBACK (on_play_button_toggled), totem);
+	g_signal_connect (G_OBJECT (totem->fs_pause_button), "toggled",
+			G_CALLBACK (on_pause_button_toggled), totem);
+	g_signal_connect (G_OBJECT (totem->fs_play_button), "toggled",
+			G_CALLBACK (on_mouse_click_fullscreen), totem);
+	g_signal_connect (G_OBJECT (totem->fs_pause_button), "toggled",
 			G_CALLBACK (on_mouse_click_fullscreen), totem);
 
 	item = glade_xml_get_widget (totem->xml, "tcw_previous_button");
@@ -3469,8 +3494,8 @@ main (int argc, char **argv)
 	totem->tooltip = gtk_tooltips_new ();
 	g_object_set_data (G_OBJECT (totem->fs_volume), "fs", GINT_TO_POINTER (1));
 	totem->volume_first_time = 1;
-	totem->fs_pp_button = glade_xml_get_widget
-		(totem->xml, "tcw_pp_button");
+	totem->fs_play_button = glade_xml_get_widget (totem->xml, "tcw_play_button");
+	totem->fs_pause_button = glade_xml_get_widget (totem->xml, "tcw_pause_button");
 	totem->statusbar = glade_xml_get_widget (totem->xml, "tmw_statusbar");
 	totem->tcw_time_label = glade_xml_get_widget (totem->xml,
 			"tcw_time_display_label");
