diff options
author | Benjamin Otte <otte@redhat.com> | 2021-11-06 03:38:03 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2021-11-06 04:30:50 +0100 |
commit | 577d520006f1f70551d01f4529fffe5647cfaccb (patch) | |
tree | ad7896db4c5923ba7e1a11ad45053be546064d20 | |
parent | 222d6f1db181e97e96354a0e2312587934fec16f (diff) | |
download | gtk+-577d520006f1f70551d01f4529fffe5647cfaccb.tar.gz |
reftests: Add reftest for last 2 issues
Use a label that is long enough to require wrapping and force it into a
hardcoded width. Use a sentence where all the words have the same size
to not get unwanted wrapping behavior.
Also append a 2nd row to check that the first row gets the proper height
allocated.
Found by Marco Melorio.
-rw-r--r-- | testsuite/reftests/listview-with-wrapped-labels.ref.ui | 50 | ||||
-rw-r--r-- | testsuite/reftests/listview-with-wrapped-labels.ui | 59 | ||||
-rw-r--r-- | testsuite/reftests/meson.build | 2 |
3 files changed, 111 insertions, 0 deletions
diff --git a/testsuite/reftests/listview-with-wrapped-labels.ref.ui b/testsuite/reftests/listview-with-wrapped-labels.ref.ui new file mode 100644 index 0000000000..c64d79f0b7 --- /dev/null +++ b/testsuite/reftests/listview-with-wrapped-labels.ref.ui @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <object class="GtkWindow" id="window1"> + <property name="width_request">150</property> + <property name="height_request">300</property> + <property name="decorated">0</property> + <child> + <object class="GtkScrolledWindow"> + <child> + <object class="GtkListView" id="listview"> + <property name="factory"> + <object class="GtkBuilderListItemFactory"> + <property name="bytes"><![CDATA[ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <template class="GtkListItem"> + <property name="child"> + <object class="GtkLabel"> + <property name="xalign">0</property> + <property name="wrap">1</property> + <binding name="label"> + <lookup name="string" type="GtkStringObject"> + <lookup name="item">GtkListItem</lookup> + </lookup> + </binding> + </object> + </property> + </template> +</interface> + ]]></property> + </object> + </property> + <property name="model"> + <object class="GtkNoSelection"> + <property name="model"> + <object class="GtkStringList"> + <items> + <item>Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.</item> + <item>Hello World!</item> + </items> + </object> + </property> + </object> + </property> + </object> + </child> + </object> + </child> + </object> +</interface> diff --git a/testsuite/reftests/listview-with-wrapped-labels.ui b/testsuite/reftests/listview-with-wrapped-labels.ui new file mode 100644 index 0000000000..cbbea66335 --- /dev/null +++ b/testsuite/reftests/listview-with-wrapped-labels.ui @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <object class="GtkWindow" id="window1"> + <property name="width_request">150</property> + <property name="height_request">300</property> + <property name="decorated">0</property> + <child> + <object class="GtkScrolledWindow"> + <child> + <object class="GtkListView" id="listview"> + <property name="factory"> + <object class="GtkBuilderListItemFactory"> + <property name="bytes"><![CDATA[ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <template class="GtkListItem"> + <property name="child"> + <object class="GtkBox"> + <child> + <object class="GtkBox"> + <property name="orientation">vertical</property> + <child> + <object class="GtkLabel"> + <property name="xalign">0</property> + <property name="wrap">1</property> + <binding name="label"> + <lookup name="string" type="GtkStringObject"> + <lookup name="item">GtkListItem</lookup> + </lookup> + </binding> + </object> + </child> + </object> + </child> + </object> + </property> + </template> +</interface> + ]]></property> + </object> + </property> + <property name="model"> + <object class="GtkNoSelection"> + <property name="model"> + <object class="GtkStringList"> + <items> + <item>Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.</item> + <item>Hello World!</item> + </items> + </object> + </property> + </object> + </property> + </object> + </child> + </object> + </child> + </object> +</interface> diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build index 692a427438..7917c1d388 100644 --- a/testsuite/reftests/meson.build +++ b/testsuite/reftests/meson.build @@ -385,6 +385,8 @@ testdata = [ 'link-coloring.css', 'link-coloring.ref.ui', 'link-coloring.ui', + 'listview-with-wrapped-labels.ref.ui', + 'listview-with-wrapped-labels.ui', 'marble.xpm', 'messagedialog-secondarytext.ui', 'messagedialog-secondarytext.ref.ui', |