theme: set RTL/LTR flags on the style context

https://bugzilla.gnome.org/show_bug.cgi?id=764807
This commit is contained in:
Cosimo Cecchi 2016-04-07 18:13:15 -07:00 committed by Cosimo Cecchi
parent 75e6029206
commit 150732a894

View File

@ -992,6 +992,7 @@ create_style_context (GType widget_type,
...) ...)
{ {
GtkStyleContext *style; GtkStyleContext *style;
GtkStateFlags state;
GtkWidgetPath *path; GtkWidgetPath *path;
const char *name; const char *name;
va_list ap; va_list ap;
@ -1010,6 +1011,19 @@ create_style_context (GType widget_type,
if (object_name) if (object_name)
gtk_widget_path_iter_set_object_name (path, -1, 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); va_start (ap, first_class);
for (name = first_class; name; name = va_arg (ap, const char *)) for (name = first_class; name; name = va_arg (ap, const char *))
gtk_widget_path_iter_add_class (path, -1, name); gtk_widget_path_iter_add_class (path, -1, name);