[rhythmbox] notification: set button arrow icons according to locale's text direction



commit eb4641a127828a0fa567eb19c26c66ff7f3b2f52
Author: Yosef Or Boczko <yoseforb gmail com>
Date:   Wed Aug 28 09:23:40 2013 +1000

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

 plugins/notification/rb-notification-plugin.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/plugins/notification/rb-notification-plugin.c b/plugins/notification/rb-notification-plugin.c
index 8f531de..5e527e6 100644
--- a/plugins/notification/rb-notification-plugin.c
+++ b/plugins/notification/rb-notification-plugin.c
@@ -209,18 +209,24 @@ do_notify (RBNotificationPlugin *plugin,
 
        notify_notification_clear_actions (notification);
        if (playback && plugin->notify_supports_actions) {
+               gboolean rtl;
+               const char *play_icon;
+
+               rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL);
+               play_icon = rtl ? "media-playback-start-rtl" : "media-playback-start";
+
                if (plugin->notify_supports_icon_buttons) {
                        gboolean playing = FALSE;
                        rb_shell_player_get_playing (plugin->shell_player, &playing, NULL);
 
                        notify_notification_add_action (notification,
-                                                       "media-skip-backward",
+                                                       rtl ? "media-skip-backward-rtl" : 
"media-skip-backward",
                                                        _("Previous"),
                                                        (NotifyActionCallback) notification_previous_cb,
                                                        plugin,
                                                        NULL);
                        notify_notification_add_action (notification,
-                                                       playing ? "media-playback-pause" : 
"media-playback-start",
+                                                       playing ? "media-playback-pause" : play_icon,
                                                        playing ? _("Pause") : _("Play"),
                                                        (NotifyActionCallback) notification_playpause_cb,
                                                        plugin,
@@ -229,7 +235,7 @@ do_notify (RBNotificationPlugin *plugin,
                }
 
                notify_notification_add_action (notification,
-                                               "media-skip-forward",
+                                               rtl ? "media-skip-forward-rtl" : "media-skip-forward",
                                                _("Next"),
                                                (NotifyActionCallback) notification_next_cb,
                                                plugin,


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