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



commit d6ddf36ee857db97d423b6a93f5b60f7b5d5f218
Author: Yosef Or Boczko <yoseforb gmail com>
Date:   Sat Nov 9 23:39:35 2013 +0200

    gstreamer: set the button arrow icons according to the locale's text direction
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711746

 extensions/gstreamer_tools/data/ui/mediabar.ui     |    5 ++---
 extensions/gstreamer_tools/gth-media-viewer-page.c |   19 ++++++++++++++++++-
 2 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/extensions/gstreamer_tools/data/ui/mediabar.ui b/extensions/gstreamer_tools/data/ui/mediabar.ui
index 9b47cf5..44b12db 100644
--- a/extensions/gstreamer_tools/data/ui/mediabar.ui
+++ b/extensions/gstreamer_tools/data/ui/mediabar.ui
@@ -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>
diff --git a/extensions/gstreamer_tools/gth-media-viewer-page.c 
b/extensions/gstreamer_tools/gth-media-viewer-page.c
index ebe41a3..a356cfd 100644
--- a/extensions/gstreamer_tools/gth-media-viewer-page.c
+++ b/extensions/gstreamer_tools/gth-media-viewer-page.c
@@ -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),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]