CSS node tests: Add a way to test rtl vs ltr

CSS nodes have a linear sibling relationship; this is supposed
to correspond to left-to-right placement in horizontal arrangements.
This commit explicitly sets the text direction to rtl if the
filename ends in .rtl.ui, so we can test differences in node
tree layout between text directions.
This commit is contained in:
Matthias Clasen
2016-01-05 23:22:28 -05:00
parent 47afccb41b
commit a519a1a928

View File

@ -104,6 +104,11 @@ load_ui_file (GFile *file, gboolean generate)
ui_file = g_file_get_path (file); ui_file = g_file_get_path (file);
if (g_str_has_suffix (ui_file, ".rtl.ui"))
gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
else
gtk_widget_set_default_direction (GTK_TEXT_DIR_LTR);
builder = gtk_builder_new_from_file (ui_file); builder = gtk_builder_new_from_file (ui_file);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1")); window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));