summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimo@endlessm.com>2016-04-07 18:13:15 -0700
committerCosimo Cecchi <cosimoc@gnome.org>2016-04-09 10:03:27 -0700
commit150732a8947c02e83f4c869c460cb91bfd3d7be5 (patch)
treefe40b8af8c6f2a6e82380dc486d1feecadeb5af4
parent75e6029206c701c32ead086d2a5f5a3c5cd239d7 (diff)
downloadmutter-150732a8947c02e83f4c869c460cb91bfd3d7be5.tar.gz
theme: set RTL/LTR flags on the style context
https://bugzilla.gnome.org/show_bug.cgi?id=764807
-rw-r--r--src/ui/theme.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 0dbfdf6e0..2f527fb24 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -992,6 +992,7 @@ create_style_context (GType widget_type,
...)
{
GtkStyleContext *style;
+ GtkStateFlags state;
GtkWidgetPath *path;
const char *name;
va_list ap;
@@ -1010,6 +1011,19 @@ create_style_context (GType widget_type,
if (object_name)
gtk_widget_path_iter_set_object_name (path, -1, object_name);
+ state = gtk_style_context_get_state (style);
+ if (meta_get_locale_direction() == META_LOCALE_DIRECTION_RTL)
+ {
+ state |= GTK_STATE_FLAG_DIR_RTL;
+ state &= ~GTK_STATE_FLAG_DIR_LTR;
+ }
+ else
+ {
+ state |= GTK_STATE_FLAG_DIR_LTR;
+ state &= ~GTK_STATE_FLAG_DIR_RTL;
+ }
+ gtk_style_context_set_state (style, state);
+
va_start (ap, first_class);
for (name = first_class; name; name = va_arg (ap, const char *))
gtk_widget_path_iter_add_class (path, -1, name);