[gtk/wip/otte/center-center-center: 1/3] reftests: Add tests for label sizing




commit f6ec97f9eac52ee6bb4cfa65ff270db3c7696218
Author: Benjamin Otte <otte redhat com>
Date:   Wed Oct 20 22:23:25 2021 +0200

    reftests: Add tests for label sizing

 .../center-center-long-label-max-width-chars.ref.ui | 19 +++++++++++++++++++
 .../center-center-long-label-max-width-chars.ui     | 21 +++++++++++++++++++++
 testsuite/reftests/center-center-long-label.ref.ui  | 16 ++++++++++++++++
 testsuite/reftests/center-center-long-label.ui      | 20 ++++++++++++++++++++
 testsuite/reftests/meson.build                      |  4 ++++
 5 files changed, 80 insertions(+)
---
diff --git a/testsuite/reftests/center-center-long-label-max-width-chars.ref.ui 
b/testsuite/reftests/center-center-long-label-max-width-chars.ref.ui
new file mode 100644
index 0000000000..5a1f2153ed
--- /dev/null
+++ b/testsuite/reftests/center-center-long-label-max-width-chars.ref.ui
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow">
+    <property name="width_request">1200</property>
+    <property name="height_request">500</property>
+    <property name="decorated">0</property>
+    <child>
+      <object class="GtkLabel">
+        <property name="label">12345678901234567890123456789012345678901234567890
+Lorem ipsum dolor sit amet, consectetur adipiscing
+elit, sed do eiusmod tempor incididunt ut labore
+et dolore magna aliqua.</property>
+        <attributes>
+          <attribute name="font-desc" value="Monospace"></attribute>
+        </attributes>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/center-center-long-label-max-width-chars.ui 
b/testsuite/reftests/center-center-long-label-max-width-chars.ui
new file mode 100644
index 0000000000..5fec78feb2
--- /dev/null
+++ b/testsuite/reftests/center-center-long-label-max-width-chars.ui
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow">
+    <property name="width_request">1200</property>
+    <property name="height_request">500</property>
+    <property name="decorated">0</property>
+    <child>
+      <object class="GtkLabel">
+        <!-- long label, but shorter than 1200px -->
+        <property 
name="label">1234567890&#8203;1234567890&#8203;1234567890&#8203;1234567890&#8203;1234567890 Lorem ipsum dolor 
sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna 
aliqua.</property>
+        <property name="max-width-chars">50</property>
+        <property name="wrap">1</property>
+        <property name="halign">center</property>
+        <property name="valign">center</property>
+        <attributes>
+          <attribute name="font-desc" value="Monospace"></attribute>
+        </attributes>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/center-center-long-label.ref.ui 
b/testsuite/reftests/center-center-long-label.ref.ui
new file mode 100644
index 0000000000..b1f237b53e
--- /dev/null
+++ b/testsuite/reftests/center-center-long-label.ref.ui
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow">
+    <property name="width_request">1200</property>
+    <property name="height_request">500</property>
+    <property name="decorated">0</property>
+    <child>
+      <object class="GtkLabel">
+        <property name="label">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod 
tempor incididunt ut labore et dolore magna aliqua.</property>
+        <attributes>
+          <attribute name="font-desc" value="Monospace"></attribute>
+        </attributes>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/center-center-long-label.ui b/testsuite/reftests/center-center-long-label.ui
new file mode 100644
index 0000000000..8cf8b12da2
--- /dev/null
+++ b/testsuite/reftests/center-center-long-label.ui
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow">
+    <property name="width_request">1200</property>
+    <property name="height_request">500</property>
+    <property name="decorated">0</property>
+    <child>
+      <object class="GtkLabel">
+        <!-- long label, but shorter than 1200px -->
+        <property name="label">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod 
tempor incididunt ut labore et dolore magna aliqua.</property>
+        <property name="wrap">1</property>
+        <property name="halign">center</property>
+        <property name="valign">center</property>
+        <attributes>
+          <attribute name="font-desc" value="Monospace"></attribute>
+        </attributes>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index 4a84e1de72..93cc87c440 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -170,6 +170,10 @@ testdata = [
   'box-shadow-with-blend-mode.ui',
   'button-wrapping.ui',
   'button-wrapping.ref.ui',
+  'center-center-long-label.ui',
+  'center-center-long-label.ref.ui',
+  'center-center-long-label-max-width-chars.ref.ui',
+  'center-center-long-label-max-width-chars.ui',
   'centerlayout-invisible-child.css',
   'centerlayout-invisible-child.ref.ui',
   'centerlayout-invisible-child.ui',


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