From 62865bc52d472450b5fc3df0469cd788849e4abf Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Thu, 6 Apr 2023 12:10:11 +0200 Subject: [PATCH] mediacontrols: Add tooltip text to play button This makes the button accessible. --- gtk/gtkmediacontrols.c | 12 ++++++++++-- gtk/ui/gtkmediacontrols.ui | 1 + po/POTFILES.in | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gtk/gtkmediacontrols.c b/gtk/gtkmediacontrols.c index 20935aa69d..e55577ffa0 100644 --- a/gtk/gtkmediacontrols.c +++ b/gtk/gtkmediacontrols.c @@ -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 diff --git a/gtk/ui/gtkmediacontrols.ui b/gtk/ui/gtkmediacontrols.ui index 08799d64e6..1c791437af 100644 --- a/gtk/ui/gtkmediacontrols.ui +++ b/gtk/ui/gtkmediacontrols.ui @@ -25,6 +25,7 @@ 3 0 media-playback-start-symbolic + Play diff --git a/po/POTFILES.in b/po/POTFILES.in index 2fe8f10bf5..6a346c0449 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -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