[totem] browser-plugin: Set button arrow icons according to locale's text direction
- From: Yosef Or Boczko <yoseforb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] browser-plugin: Set button arrow icons according to locale's text direction
- Date: Mon, 1 Jul 2013 14:23:00 +0000 (UTC)
commit b7c0417aef9f8fe01df50df4000e4b794d5b9c57
Author: Yosef Or Boczko <yoseforb gmail com>
Date: Mon Jul 1 17:18:52 2013 +0300
browser-plugin: Set button arrow icons according to locale's text direction
media-playback-start-symbolic in LTR,
media-playback-start-rtl-symbolic in RTL.
https://bugzilla.gnome.org/show_bug.cgi?id=702631
browser-plugin/totem-plugin-viewer.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/browser-plugin/totem-plugin-viewer.c b/browser-plugin/totem-plugin-viewer.c
index 3075350..42a81ae 100644
--- a/browser-plugin/totem-plugin-viewer.c
+++ b/browser-plugin/totem-plugin-viewer.c
@@ -286,6 +286,7 @@ totem_embedded_set_state (TotemEmbedded *emb, TotemStates state)
{
GtkWidget *image;
const gchar *id;
+ const gchar *icon_start;
if (state == emb->state)
return;
@@ -294,9 +295,14 @@ totem_embedded_set_state (TotemEmbedded *emb, TotemStates state)
image = gtk_button_get_image (GTK_BUTTON (emb->pp_button));
+ if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)
+ icon_start = "media-playback-start-rtl-symbolic";
+ else
+ icon_start = "media-playback-start-symbolic";
+
switch (state) {
case TOTEM_STATE_STOPPED:
- id = "media-playback-start-symbolic";
+ id = icon_start;
if (emb->href_uri != NULL && emb->hidden == FALSE) {
gdk_window_set_cursor
(gtk_widget_get_window (GTK_WIDGET (emb->bvw)),
@@ -304,7 +310,7 @@ totem_embedded_set_state (TotemEmbedded *emb, TotemStates state)
}
break;
case TOTEM_STATE_PAUSED:
- id = "media-playback-start-symbolic";
+ id = icon_start;
break;
case TOTEM_STATE_PLAYING:
id = "media-playback-pause-symbolic";
@@ -1628,11 +1634,14 @@ totem_embedded_construct (TotemEmbedded *emb,
GtkWidget *child, *container, *image;
GtkWidget *popup_button;
GError *err = NULL;
+ gboolean rtl;
emb->xml = totem_interface_load ("mozilla-viewer.ui", TRUE,
GTK_WINDOW (emb->window), emb);
g_assert (emb->xml);
+ rtl = gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL;
+
if (xid != 0) {
g_assert (!emb->hidden);
@@ -1745,7 +1754,7 @@ totem_embedded_construct (TotemEmbedded *emb,
// G_CALLBACK (cb_on_seek), emb);
emb->pp_button = GTK_WIDGET (gtk_builder_get_object (emb->xml, "pp_button"));
- image = gtk_image_new_from_icon_name ("media-playback-start-symbolic", GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_icon_name (rtl ? "media-playback-start-rtl-symbolic" :
"media-playback-start-symbolic", GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (emb->pp_button), image);
g_signal_connect (G_OBJECT (emb->pp_button), "clicked",
G_CALLBACK (on_play_pause), emb);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]