summaryrefslogtreecommitdiff
path: root/testsuite/reftests
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2021-11-09 03:28:29 +0100
committerBenjamin Otte <otte@redhat.com>2021-11-09 03:41:43 +0100
commit76c46739447023368db4c3e6d008b52ff4b249e0 (patch)
tree9b4c9cac24d703c96d384c5ac6f9be33283ab828 /testsuite/reftests
parent0a31201c889a49667d7411bdafc7998a10a220ce (diff)
downloadgtk+-76c46739447023368db4c3e6d008b52ff4b249e0.tar.gz
boxlayout: Fix broken min-size-for-opposite-size
Assume a vbox with 2 wrapping labels saying Hello World Hi Ho being measured for their minimum width for 3 rows of text. This should be layouted like Hello World Hi Ho and measured accordingly. However, previously this was layouted as Hello World Hi Ho with 1.5 lines being assigned to both labels. That will obviously not compute the above wrapping which clearly results in a smaller min width. A reftest testing exactly this was included.
Diffstat (limited to 'testsuite/reftests')
-rw-r--r--testsuite/reftests/meson.build2
-rw-r--r--testsuite/reftests/vbox-with-2-wrapping-labels-where-one-should-wrap.ref.ui27
-rw-r--r--testsuite/reftests/vbox-with-2-wrapping-labels-where-one-should-wrap.ui30
3 files changed, 59 insertions, 0 deletions
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index 9f40c0f3a0..83a06c9c80 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -506,6 +506,8 @@ testdata = [
'unresolvable.css',
'unresolvable.ref.ui',
'unresolvable.ui',
+ 'vbox-with-2-wrapping-labels-where-one-should-wrap.ref.ui',
+ 'vbox-with-2-wrapping-labels-where-one-should-wrap.ui',
'vbox-with-max-width-chars-label.ref.ui',
'vbox-with-max-width-chars-label.ui',
'window-border-width.ref.ui',
diff --git a/testsuite/reftests/vbox-with-2-wrapping-labels-where-one-should-wrap.ref.ui b/testsuite/reftests/vbox-with-2-wrapping-labels-where-one-should-wrap.ref.ui
new file mode 100644
index 0000000000..ec575c07d9
--- /dev/null
+++ b/testsuite/reftests/vbox-with-2-wrapping-labels-where-one-should-wrap.ref.ui
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface domain="gtk40">
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkBox">
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">1</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello
+World</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hi Ho</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
+
diff --git a/testsuite/reftests/vbox-with-2-wrapping-labels-where-one-should-wrap.ui b/testsuite/reftests/vbox-with-2-wrapping-labels-where-one-should-wrap.ui
new file mode 100644
index 0000000000..f398308496
--- /dev/null
+++ b/testsuite/reftests/vbox-with-2-wrapping-labels-where-one-should-wrap.ui
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface domain="gtk40">
+ <object class="GtkWindow">
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkBox">
+ <child>
+ <object class="GtkBox">
+ <property name="orientation">1</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello World</property>
+ <property name="wrap">1</property>
+ <property name="max-width-chars">1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hi Ho</property>
+ <property name="wrap">1</property>
+ <property name="max-width-chars">1</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
+