[totem/gnome-3-10] main: Set button arrow icons according to locale's text direction
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/gnome-3-10] main: Set button arrow icons according to locale's text direction
- Date: Wed, 18 Sep 2013 12:57:44 +0000 (UTC)
commit 3ff23cf41e0192860ee2ad5c70c99c3c4d024196
Author: Yosef Or Boczko <yoseforb gmail com>
Date: Thu Aug 1 02:57:25 2013 +0300
main: Set button arrow icons according to locale's text direction
media-playback-start-symbolic in LTR,
media-playback-start-rtl-symbolic in RTL.
media-seek-forward-symbolic in LTR,
media-seek-forward-rtl-symbolic in RTL.
media-seek-backward-symbolic in LTR,
media-seek-backward-rtl-symbolic in RTL.
media-skip-forward-symbolic in LTR,
media-skip-forward-rtl-symbolic in RTL.
media-skip-backward-symbolic in LTR,
media-skip-backward-rtl-symbolic in RTL.
https://bugzilla.gnome.org/show_bug.cgi?id=702631
data/totem.ui | 5 -----
src/totem-dnd-menu.c | 3 ++-
src/totem-object.c | 31 ++++++++++++++++---------------
src/totem-playlist.c | 3 ++-
src/totem.c | 8 ++++++++
5 files changed, 28 insertions(+), 22 deletions(-)
---
diff --git a/data/totem.ui b/data/totem.ui
index 01337dc..f709191 100644
--- a/data/totem.ui
+++ b/data/totem.ui
@@ -78,7 +78,6 @@
<child>
<object class="GtkAction" id="play">
<property name="label" translatable="yes">Play / P_ause</property>
- <property name="icon-name">media-playback-start-symbolic</property>
<property name="tooltip" translatable="yes">Play or pause the movie</property>
<signal name="activate" handler="play_action_callback"/>
</object>
@@ -198,7 +197,6 @@
<child>
<object class="GtkAction" id="next-chapter">
<property name="label" translatable="yes">_Next Chapter/Movie</property>
- <property name="icon-name">media-skip-forward-symbolic</property>
<property name="tooltip" translatable="yes">Next chapter or movie</property>
<signal name="activate" handler="next_chapter_action_callback"/>
</object>
@@ -207,7 +205,6 @@
<child>
<object class="GtkAction" id="previous-chapter">
<property name="label" translatable="yes">_Previous Chapter/Movie</property>
- <property name="icon-name">media-skip-backward-symbolic</property>
<property name="tooltip" translatable="yes">Previous chapter or movie</property>
<signal name="activate" handler="previous_chapter_action_callback"/>
</object>
@@ -366,7 +363,6 @@
<object class="GtkAction" id="skip-forward">
<property name="label" translatable="yes">Skip _Forward</property>
<property name="tooltip" translatable="yes">Skip forward</property>
- <property name="icon-name">media-seek-forward-symbolic</property>
<signal name="activate" handler="skip_forward_action_callback"/>
</object>
<accelerator key="Right"/>
@@ -375,7 +371,6 @@
<object class="GtkAction" id="skip-backwards">
<property name="label" translatable="yes">Skip _Backwards</property>
<property name="tooltip" translatable="yes">Skip backwards</property>
- <property name="icon-name">media-seek-backward-symbolic</property>
<signal name="activate" handler="skip_backwards_action_callback"/>
</object>
<accelerator key="Left"/>
diff --git a/src/totem-dnd-menu.c b/src/totem-dnd-menu.c
index ffa6878..fbfba92 100644
--- a/src/totem-dnd-menu.c
+++ b/src/totem-dnd-menu.c
@@ -27,6 +27,7 @@
#include <gdk/gdkkeysyms.h>
#include "totem-dnd-menu.h"
+#include "totem-rtl-helpers.h"
typedef struct
{
@@ -91,7 +92,7 @@ totem_drag_ask (gboolean show_add_to)
menu = gtk_menu_new ();
- drag_append_drop_action_menu_item (menu, _("_Play Now"), "media-playback-start-symbolic",
GDK_ACTION_MOVE, &dt);
+ drag_append_drop_action_menu_item (menu, _("_Play Now"), totem_get_rtl_icon_name
("media-playback-start"), GDK_ACTION_MOVE, &dt);
if (show_add_to != FALSE)
drag_append_drop_action_menu_item (menu, _("_Add to Playlist"), "gtk-add", GDK_ACTION_COPY,
&dt);
diff --git a/src/totem-object.c b/src/totem-object.c
index e50c1aa..c1baae0 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -62,6 +62,7 @@
#include "video-utils.h"
#include "totem-dnd-menu.h"
#include "totem-preferences.h"
+#include "totem-rtl-helpers.h"
#include "totem-mime-types.h"
#include "totem-uri-schemes.h"
@@ -1171,7 +1172,7 @@ play_pause_set_label (TotemObject *totem, TotemStates state)
case STATE_PAUSED:
totem_statusbar_set_text (TOTEM_STATUSBAR (totem->statusbar),
_("Paused"));
- id = "media-playback-start-symbolic";
+ id = totem_get_rtl_icon_name ("media-playback-start");
tip = N_("Play");
totem_playlist_set_playing (totem->playlist, TOTEM_PLAYLIST_STATUS_PAUSED);
break;
@@ -1180,7 +1181,7 @@ play_pause_set_label (TotemObject *totem, TotemStates state)
_("Stopped"));
totem_statusbar_set_time_and_length
(TOTEM_STATUSBAR (totem->statusbar), 0, 0);
- id = "media-playback-start-symbolic";
+ id = totem_get_rtl_icon_name ("media-playback-start");
totem_playlist_set_playing (totem->playlist, TOTEM_PLAYLIST_STATUS_NONE);
tip = N_("Play");
break;
@@ -2962,11 +2963,11 @@ totem_object_action_remote (TotemObject *totem, TotemRemoteCommand cmd, const ch
switch (cmd) {
case TOTEM_REMOTE_COMMAND_PLAY:
totem_action_play (totem);
- icon_name = "media-playback-start-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-playback-start");
break;
case TOTEM_REMOTE_COMMAND_PLAYPAUSE:
if (bacon_video_widget_is_playing (totem->bvw) == FALSE)
- icon_name = "media-playback-start-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-playback-start");
else
icon_name = "media-playback-pause-symbolic";
totem_action_play_pause (totem);
@@ -3001,7 +3002,7 @@ totem_object_action_remote (TotemObject *totem, TotemRemoteCommand cmd, const ch
} else {
totem_action_seek_relative (totem, offset * 1000, FALSE);
}
- icon_name = "media-seek-forward-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-seek-forward");
break;
}
case TOTEM_REMOTE_COMMAND_SEEK_BACKWARD: {
@@ -3013,7 +3014,7 @@ totem_object_action_remote (TotemObject *totem, TotemRemoteCommand cmd, const ch
totem_action_seek_relative (totem, SEEK_BACKWARD_OFFSET * 1000, FALSE);
else
totem_action_seek_relative (totem, - (offset * 1000), FALSE);
- icon_name = "media-seek-backward-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-seek-backward");
break;
}
case TOTEM_REMOTE_COMMAND_VOLUME_UP:
@@ -3024,11 +3025,11 @@ totem_object_action_remote (TotemObject *totem, TotemRemoteCommand cmd, const ch
break;
case TOTEM_REMOTE_COMMAND_NEXT:
totem_action_next (totem);
- icon_name = "media-skip-forward-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-skip-forward");
break;
case TOTEM_REMOTE_COMMAND_PREVIOUS:
totem_action_previous (totem);
- icon_name = "media-skip-backward-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-skip-backward");
break;
case TOTEM_REMOTE_COMMAND_FULLSCREEN:
totem_action_fullscreen_toggle (totem);
@@ -3352,7 +3353,7 @@ on_video_button_press_event (BaconVideoWidget *bvw, GdkEventButton *event,
} else if (event->type == GDK_BUTTON_PRESS && event->button == 2) {
const char *icon_name;
if (bacon_video_widget_is_playing (totem->bvw) == FALSE)
- icon_name = "media-playback-start-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-playback-start");
else
icon_name = "media-playback-pause-symbolic";
totem_fullscreen_show_popups_or_osd (totem->fs, icon_name, FALSE);
@@ -3464,7 +3465,7 @@ totem_action_handle_key_press (TotemObject *totem, GdkEventKey *event)
case GDK_KEY_B:
case GDK_KEY_b:
totem_action_previous (totem);
- icon_name = "media-skip-backward-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-skip-backward");
break;
case GDK_KEY_C:
case GDK_KEY_c:
@@ -3494,7 +3495,7 @@ totem_action_handle_key_press (TotemObject *totem, GdkEventKey *event)
case GDK_KEY_n:
case GDK_KEY_End:
totem_action_next (totem);
- icon_name = "media-skip-forward-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-skip-forward");
break;
case GDK_KEY_OpenURL:
totem_action_fullscreen (totem, FALSE);
@@ -3513,7 +3514,7 @@ totem_action_handle_key_press (TotemObject *totem, GdkEventKey *event)
totem_action_show_properties (totem);
} else {
if (bacon_video_widget_is_playing (totem->bvw) == FALSE)
- icon_name = "media-playback-start-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-playback-start");
else
icon_name = "media-playback-pause-symbolic";
totem_action_play_pause (totem);
@@ -3565,7 +3566,7 @@ totem_action_handle_key_press (TotemObject *totem, GdkEventKey *event)
focus == GTK_WIDGET (totem->bvw) || focus == totem->seek) {
if (event->keyval == GDK_KEY_space) {
if (bacon_video_widget_is_playing (totem->bvw) == FALSE)
- icon_name = "media-playback-start-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-playback-start");
else
icon_name = "media-playback-pause-symbolic";
totem_action_play_pause (totem);
@@ -3585,7 +3586,7 @@ totem_action_handle_key_press (TotemObject *totem, GdkEventKey *event)
/* Switch direction in RTL environment */
if (gtk_widget_get_direction (totem->win) == GTK_TEXT_DIR_RTL)
is_forward = !is_forward;
- icon_name = is_forward ? "media-seek-forward-symbolic" :
"media-seek-backward-symbolic";
+ icon_name = totem_get_rtl_icon_name (is_forward ? "media-seek-forward" :
"media-seek-backward");
totem_action_handle_seek (totem, event, is_forward);
} else {
@@ -3597,7 +3598,7 @@ totem_action_handle_key_press (TotemObject *totem, GdkEventKey *event)
break;
case GDK_KEY_Home:
totem_action_seek (totem, 0);
- icon_name = "media-seek-backward-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-seek-backward");
break;
case GDK_KEY_Up:
if (bacon_video_widget_has_menus (totem->bvw) != FALSE)
diff --git a/src/totem-playlist.c b/src/totem-playlist.c
index 89cf2af..f49b2c7 100644
--- a/src/totem-playlist.c
+++ b/src/totem-playlist.c
@@ -34,6 +34,7 @@
#include "totem-dnd-menu.h"
#include "totem-uri.h"
#include "totem-interface.h"
+#include "totem-rtl-helpers.h"
#include "video-utils.h"
#define PL_LEN (gtk_tree_model_iter_n_children (playlist->priv->model, NULL))
@@ -1237,7 +1238,7 @@ set_playing_icon (GtkTreeViewColumn *column, GtkCellRenderer *renderer,
switch (playing) {
case TOTEM_PLAYLIST_STATUS_PLAYING:
- icon_name = "media-playback-start-symbolic";
+ icon_name = totem_get_rtl_icon_name ("media-playback-start");
break;
case TOTEM_PLAYLIST_STATUS_PAUSED:
icon_name = "media-playback-pause-symbolic";
diff --git a/src/totem.c b/src/totem.c
index 428b336..bf82c04 100644
--- a/src/totem.c
+++ b/src/totem.c
@@ -48,6 +48,7 @@
#include "totem-session.h"
#include "totem-uri.h"
#include "totem-preferences.h"
+#include "totem-rtl-helpers.h"
#include "totem-sidebar.h"
#include "video-utils.h"
@@ -86,6 +87,7 @@ app_init (Totem *totem, char **argv)
{
GtkSettings *gtk_settings;
char *sidebar_pageid;
+ GtkAction *action;
if (gtk_clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
g_warning ("gtk-clutter failed to initialise, expect problems from here on.");
@@ -101,6 +103,12 @@ app_init (Totem *totem, char **argv)
if (totem->xml == NULL)
totem_action_exit (NULL);
+ set_rtl_icon_name (totem, "play", "media-playback-start");
+ set_rtl_icon_name (totem, "next-chapter", "media-skip-forward");
+ set_rtl_icon_name (totem, "previous-chapter", "media-skip-backward");
+ set_rtl_icon_name (totem, "skip-forward", "media-seek-forward");
+ set_rtl_icon_name (totem, "skip-backward", "media-seek-backward");
+
totem->win = GTK_WIDGET (gtk_builder_get_object (totem->xml, "totem_main_window"));
g_object_bind_property (G_OBJECT (totem), "fullscreen",
G_OBJECT (totem->win), "show-menubar",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]