[mutter] theme: set RTL/LTR flags on the style context



commit 150732a8947c02e83f4c869c460cb91bfd3d7be5
Author: Cosimo Cecchi <cosimo endlessm com>
Date:   Thu Apr 7 18:13:15 2016 -0700

    theme: set RTL/LTR flags on the style context
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764807

 src/ui/theme.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 0dbfdf6..2f527fb 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);


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