summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2019-04-12 22:29:11 +0200
committerBenjamin Otte <otte@redhat.com>2019-04-12 22:29:11 +0200
commit519b6c542cfcfbda205d6aecdd950f194457388f (patch)
tree39112669c4f8bea82cd785e97a2f63d9cf985d9f
parentc6471ee874702d4c4c2ec49d7a299926606461e9 (diff)
downloadgtk+-testcase-for-libhandy.tar.gz
reftests: Add a test demonstrating unfortunate headerbar behaviortestcase-for-libhandy
When centering a widget with a size between minimum and natural size, the headerbar will always expand it as much as possible instead of keeping it centered.
-rw-r--r--testsuite/reftests/headerbar-centering.ref.ui42
-rw-r--r--testsuite/reftests/headerbar-centering.ui36
-rw-r--r--testsuite/reftests/meson.build2
3 files changed, 80 insertions, 0 deletions
diff --git a/testsuite/reftests/headerbar-centering.ref.ui b/testsuite/reftests/headerbar-centering.ref.ui
new file mode 100644
index 0000000000..b45209518a
--- /dev/null
+++ b/testsuite/reftests/headerbar-centering.ref.ui
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="type">popup</property>
+ <property name="default-width">400</property>
+ <child>
+ <object class="GtkHeaderBar">
+ <property name="title" translatable="yes">Join Chat Room</property>
+ <child type="start">
+ <object class="GtkButton">
+ <property name="label" translatable="yes">Hello World</property>
+ <property name="opacity">0</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton" id="back_button">
+ <property name="visible">0</property>
+ <property name="can_focus">1</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage" id="back_icon"/>
+ </child>
+ </object>
+ </child>
+ <child type="title">
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">This is a very long label that should be centered in the headerbar but unfortunately the headerbar scres this up and gives it all the available space instead and there's nothing we can do about it and now we're sad developers.</property>
+ <property name="ellipsize">end</property>
+ </object>
+ </child>
+ <child type="end">
+ <object class="GtkButton">
+ <property name="label" translatable="yes">Hello World</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/headerbar-centering.ui b/testsuite/reftests/headerbar-centering.ui
new file mode 100644
index 0000000000..4ab7e2987d
--- /dev/null
+++ b/testsuite/reftests/headerbar-centering.ui
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="type">popup</property>
+ <property name="default-width">400</property>
+ <child>
+ <object class="GtkHeaderBar">
+ <property name="title" translatable="yes">Join Chat Room</property>
+ <child>
+ <object class="GtkButton" id="back_button">
+ <property name="visible">0</property>
+ <property name="can_focus">1</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage" id="back_icon"/>
+ </child>
+ </object>
+ </child>
+ <child type="title">
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">This is a very long label that should be centered in the headerbar but unfortunately the headerbar scres this up and gives it all the available space instead and there's nothing we can do about it and now we're sad developers.</property>
+ <property name="ellipsize">end</property>
+ </object>
+ </child>
+ <child type="end">
+ <object class="GtkButton">
+ <property name="label" translatable="yes">Hello World</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index 3bafca4fad..ca9010b768 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -225,6 +225,8 @@ testdata = [
'gtk-icontheme-sizing.css',
'gtk-icontheme-sizing.ref.ui',
'gtk-icontheme-sizing.ui',
+ 'headerbar-centering.ui',
+ 'headerbar-centering.ref.ui',
'icon-effect-missing.css',
'icon-effect-missing.ref.ui',
'icon-effect-missing.ui',