mediacontrols: Add tooltip text to play button

This makes the button accessible.
This commit is contained in:
Maximiliano Sandoval R 2023-04-06 12:10:11 +02:00
parent 9608e4e503
commit 62865bc52d
No known key found for this signature in database
GPG Key ID: D64A8D747F6FE706
3 changed files with 12 additions and 2 deletions

View File

@ -399,6 +399,7 @@ update_playing (GtkMediaControls *controls)
{
gboolean playing;
const char *icon_name;
const char *tooltip_text;
if (controls->stream)
playing = gtk_media_stream_get_playing (controls->stream);
@ -406,11 +407,18 @@ update_playing (GtkMediaControls *controls)
playing = FALSE;
if (playing)
icon_name = "media-playback-pause-symbolic";
{
icon_name = "media-playback-pause-symbolic";
tooltip_text = C_("media controls tooltip", "Stop");
}
else
icon_name = "media-playback-start-symbolic";
{
icon_name = "media-playback-start-symbolic";
tooltip_text = C_("media controls tooltip", "Play");
}
gtk_button_set_icon_name (GTK_BUTTON (controls->play_button), icon_name);
gtk_widget_set_tooltip_text (controls->play_button, tooltip_text);
}
static void

View File

@ -25,6 +25,7 @@
<property name="valign">3</property>
<property name="has-frame">0</property>
<property name="icon-name">media-playback-start-symbolic</property>
<property name="tooltip-text" context="media controls tooltip" translatable="yes">Play</property>
<signal name="clicked" handler="play_button_clicked" object="GtkMediaControls" swapped="no"/>
</object>
</child>

View File

@ -399,6 +399,7 @@ gtk/ui/gtkfilechooserwidget.ui
gtk/ui/gtkfontchooserdialog.ui
gtk/ui/gtkfontchooserwidget.ui
gtk/ui/gtklockbutton.ui
gtk/ui/gtkmediacontrols.ui
gtk/ui/gtkmessagedialog.ui
gtk/ui/gtkpagesetupunixdialog.ui
gtk/ui/gtkplacesviewrow.ui