Add reftests for center layout

Add a test that checks behavior with invisible children,
and another one that ensures we go back to box-like
layout if min-size is forced.
This commit is contained in:
Matthias Clasen
2020-08-24 12:02:34 -04:00
parent 08f58122d1
commit c890d5991c
7 changed files with 113 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
box {
border-spacing: 10px;
}

View File

@@ -0,0 +1,21 @@
<!-- check that an invisible child does not influence the layout -->
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window_information_collection">
<property name="decorated">0</property>
<child>
<object class="GtkCenterBox" id="box1">
<child type="start">
<object class="GtkLabel" id="label1">
<property name="label" translatable="yes">Hello, Hello</property>
</object>
</child>
<child type="end">
<object class="GtkLabel" id="label3">
<property name="label" translatable="yes">World</property>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@@ -0,0 +1,27 @@
<!-- check that an invisible child does not influence the layout -->
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window_information_collection">
<property name="decorated">0</property>
<child>
<object class="GtkCenterBox" id="box1">
<child type="start">
<object class="GtkLabel" id="label1">
<property name="label" translatable="yes">Hello, Hello</property>
</object>
</child>
<child type="center">
<object class="GtkLabel" id="label2">
<property name="visible">0</property>
<property name="label" translatable="yes">cruel</property>
</object>
</child>
<child type="end">
<object class="GtkLabel" id="label3">
<property name="label" translatable="yes">World</property>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@@ -0,0 +1,3 @@
box {
border-spacing: 10px;
}

View File

@@ -0,0 +1,26 @@
<!-- check that an invisible child does not influence the layout -->
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window_information_collection">
<property name="decorated">0</property>
<child>
<object class="GtkBox" id="box1">
<child>
<object class="GtkLabel" id="label1">
<property name="label" translatable="yes">Hello, Hello</property>
</object>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="label" translatable="yes">cruel</property>
</object>
</child>
<child>
<object class="GtkLabel" id="label3">
<property name="label" translatable="yes">World</property>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@@ -0,0 +1,27 @@
<!-- check that an invisible child does not influence the layout -->
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window_information_collection">
<property name="decorated">0</property>
<property name="default-width">20</property>
<child>
<object class="GtkCenterBox" id="box1">
<child type="start">
<object class="GtkLabel" id="label1">
<property name="label" translatable="yes">Hello, Hello</property>
</object>
</child>
<child type="center">
<object class="GtkLabel" id="label2">
<property name="label" translatable="yes">cruel</property>
</object>
</child>
<child type="end">
<object class="GtkLabel" id="label3">
<property name="label" translatable="yes">World</property>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@@ -163,6 +163,12 @@ testdata = [
'box-shadow-with-blend-mode.ui',
'button-wrapping.ui',
'button-wrapping.ref.ui',
'centerlayout-invisible-child.css',
'centerlayout-invisible-child.ref.ui',
'centerlayout-invisible-child.ui',
'centerlayout-minsize.css',
'centerlayout-minsize.ref.ui',
'centerlayout-minsize.ui',
'color-transition.css',
'color-transition.ref.ui',
'color-transition.ui',