[gtk/wip/otte/inscription: 4/4] reftests: Add an inscription xalign RTL test




commit 2d14372142c389f667ba447a0e7f5ba620722742
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jun 13 05:30:08 2022 +0200

    reftests: Add an inscription xalign RTL test
    
    This checks mainly that we do the right thing wrt PangoAlignment
    weirdness.
    
    0.25 and 0.75 are set to 0.0 and 1.0 currently because of Pango
    limitations (and no desire to manually move lines).
    But if that were to be fixed, both the ref and the test should update in
    the same way and things should just keep working.

 testsuite/reftests/inscription-xalign-rtl.ref.ui | 52 +++++++++++++++++++++++
 testsuite/reftests/inscription-xalign-rtl.ui     | 54 ++++++++++++++++++++++++
 testsuite/reftests/meson.build                   |  2 +
 3 files changed, 108 insertions(+)
---
diff --git a/testsuite/reftests/inscription-xalign-rtl.ref.ui 
b/testsuite/reftests/inscription-xalign-rtl.ref.ui
new file mode 100644
index 0000000000..5d31f893ba
--- /dev/null
+++ b/testsuite/reftests/inscription-xalign-rtl.ref.ui
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow">
+    <property name="default-width">200</property>
+    <property name="decorated">0</property>
+    <child>
+      <object class="GtkBox">
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.0</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.25</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.5</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.75</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">1.0</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/inscription-xalign-rtl.ui b/testsuite/reftests/inscription-xalign-rtl.ui
new file mode 100644
index 0000000000..a8e469f4c8
--- /dev/null
+++ b/testsuite/reftests/inscription-xalign-rtl.ui
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow">
+    <property name="default-width">200</property>
+    <property name="decorated">0</property>
+    <child>
+      <object class="GtkBox">
+        <property name="orientation">vertical</property>
+        <signal name="map" handler="reftest:set_default_direction_rtl" swapped="no"/>
+        <signal name="destroy" handler="reftest:set_default_direction_ltr" swapped="no"/>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.0</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.25</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.5</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.75</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">1.0</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index 068f98b159..25fb13ab0d 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -377,6 +377,8 @@ testdata = [
   'inscription-overflow-yalign.ui',
   'inscription-xalign.ref.ui',
   'inscription-xalign.ui',
+  'inscription-xalign-rtl.ref.ui',
+  'inscription-xalign-rtl.ui',
   'label-attribute-preference.css',
   'label-attribute-preference.ref.ui',
   'label-attribute-preference.ui',


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