Commit d6ddf36e authored by Yosef Or Boczko's avatar Yosef Or Boczko Committed by Paolo Bacchilega
Browse files

gstreamer: set the button arrow icons according to the locale's text direction

https://bugzilla.gnome.org/show_bug.cgi?id=711746
parent 8d000a0b
......@@ -33,7 +33,6 @@
<object class="GtkImage" id="play_button_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">media-playback-start-symbolic</property>
<property name="icon_size">2</property>
</object>
</child>
......@@ -53,7 +52,7 @@
<property name="tooltip_text" translatable="yes">Slower</property>
<property name="relief">none</property>
<child>
<object class="GtkImage" id="image1">
<object class="GtkImage" id="play_slower_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">media-seek-backward-symbolic</property>
......@@ -76,7 +75,7 @@
<property name="tooltip_text" translatable="yes">Faster</property>
<property name="relief">none</property>
<child>
<object class="GtkImage" id="image3">
<object class="GtkImage" id="play_faster_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">media-seek-forward-symbolic</property>
......
......@@ -638,8 +638,15 @@ update_play_button (GthMediaViewerPage *self,
update_playback_info (self);
}
else if (self->priv->playing && (new_state != GST_STATE_PLAYING)) {
GtkWidget *play_button = GET_WIDGET ("play_button_image");
gboolean rtl;
rtl = gtk_widget_get_direction (play_button) == GTK_TEXT_DIR_RTL;
set_playing_state (self, FALSE);
gtk_image_set_from_icon_name (GTK_IMAGE (GET_WIDGET ("play_button_image")), "media-playback-start-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_image_set_from_icon_name (GTK_IMAGE (play_button),
rtl ? "media-playback-start-rtl-symbolic" : "media-playback-start-symbolic",
GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_widget_set_tooltip_text (GET_WIDGET ("play_button_image"), _("Play"));
if (self->priv->update_progress_id != 0) {
......@@ -659,6 +666,7 @@ gth_media_viewer_page_real_activate (GthViewerPage *base,
GthBrowser *browser)
{
GthMediaViewerPage *self;
gboolean rtl;
if (! gstreamer_init ())
return;
......@@ -678,6 +686,8 @@ gth_media_viewer_page_real_activate (GthViewerPage *base,
"win.video-screenshot",
NULL);
rtl = gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL;
/* video area */
self->priv->area = gtk_drawing_area_new ();
......@@ -738,6 +748,13 @@ gth_media_viewer_page_real_activate (GthViewerPage *base,
gtk_widget_set_halign (self->priv->mediabar, GTK_ALIGN_FILL);
gtk_widget_set_valign (self->priv->mediabar, GTK_ALIGN_END);
gtk_image_set_from_icon_name (GTK_IMAGE (GET_WIDGET ("play_slower_image")),
rtl ? "media-seek-backward-rtl-symbolic" : "media-seek-backward-symbolic",
GTK_ICON_SIZE_MENU);
gtk_image_set_from_icon_name (GTK_IMAGE (GET_WIDGET ("play_faster_image")),
rtl ? "media-seek-forward-rtl-symbolic" : "media-seek-forward-symbolic",
GTK_ICON_SIZE_MENU);
g_signal_connect (GET_WIDGET ("volume_adjustment"),
"value-changed",
G_CALLBACK (volume_value_changed_cb),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment