[gtk+] CSS node tests: Add a way to test rtl vs ltr



commit a519a1a9284d749356a46ec249c5fdb9dd2f641c
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jan 5 23:22:28 2016 -0500

    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.

 testsuite/css/nodes/test-css-nodes.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/testsuite/css/nodes/test-css-nodes.c b/testsuite/css/nodes/test-css-nodes.c
index d2cce05..bb0b02c 100644
--- a/testsuite/css/nodes/test-css-nodes.c
+++ b/testsuite/css/nodes/test-css-nodes.c
@@ -104,6 +104,11 @@ load_ui_file (GFile *file, gboolean generate)
 
   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);
   window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
 


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