forked from AuroraMiddleware/gtk
Merge branch 'wip/otte/for-main' into 'main'
listview: Measure children only, not self See merge request GNOME/gtk!5535
This commit is contained in:
commit
d553f6941d
@ -606,9 +606,9 @@ gtk_list_view_size_allocate (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* step 1: determine width of the list */
|
/* step 1: determine width of the list */
|
||||||
gtk_widget_measure (widget, opposite_orientation,
|
gtk_list_view_measure_across (widget, opposite_orientation,
|
||||||
-1,
|
-1,
|
||||||
&min, &nat, NULL, NULL);
|
&min, &nat);
|
||||||
self->list_width = orientation == GTK_ORIENTATION_VERTICAL ? width : height;
|
self->list_width = orientation == GTK_ORIENTATION_VERTICAL ? width : height;
|
||||||
if (opposite_scroll_policy == GTK_SCROLL_MINIMUM)
|
if (opposite_scroll_policy == GTK_SCROLL_MINIMUM)
|
||||||
self->list_width = MAX (min, self->list_width);
|
self->list_width = MAX (min, self->list_width);
|
||||||
|
8
testsuite/reftests/listview-margin.css
Normal file
8
testsuite/reftests/listview-margin.css
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
listview, box {
|
||||||
|
margin: 50px;
|
||||||
|
padding: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
row {
|
||||||
|
all: unset;
|
||||||
|
}
|
32
testsuite/reftests/listview-margin.ref.ui
Normal file
32
testsuite/reftests/listview-margin.ref.ui
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<object class="GtkWindow">
|
||||||
|
<property name="decorated">0</property>
|
||||||
|
<property name="child">
|
||||||
|
<object class="GtkBox">
|
||||||
|
<style>
|
||||||
|
<class name="view"/>
|
||||||
|
</style>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
<property name="label">One</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
<property name="label">Two</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
<property name="label">Three</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
|
</interface>
|
44
testsuite/reftests/listview-margin.ui
Normal file
44
testsuite/reftests/listview-margin.ui
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<object class="GtkWindow">
|
||||||
|
<property name="decorated">0</property>
|
||||||
|
<property name="child">
|
||||||
|
<object class="GtkListView">
|
||||||
|
<property name="model">
|
||||||
|
<object class="GtkNoSelection">
|
||||||
|
<property name="model">
|
||||||
|
<object class="GtkStringList">
|
||||||
|
<items>
|
||||||
|
<item translatable="yes">One</item>
|
||||||
|
<item translatable="yes">Two</item>
|
||||||
|
<item translatable="yes">Three</item>
|
||||||
|
</items>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
<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">1</property>
|
||||||
|
<binding name="label">
|
||||||
|
<lookup name="string" type="GtkStringObject">
|
||||||
|
<lookup name="item">GtkListItem</lookup>
|
||||||
|
</lookup>
|
||||||
|
</binding>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</template>
|
||||||
|
</interface>
|
||||||
|
]]></property>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
|
</interface>
|
@ -446,6 +446,9 @@ testdata = [
|
|||||||
'link-coloring.css',
|
'link-coloring.css',
|
||||||
'link-coloring.ref.ui',
|
'link-coloring.ref.ui',
|
||||||
'link-coloring.ui',
|
'link-coloring.ui',
|
||||||
|
'listview-margin.css',
|
||||||
|
'listview-margin.ref.ui',
|
||||||
|
'listview-margin.ui',
|
||||||
'listview-with-wrapped-labels.ref.ui',
|
'listview-with-wrapped-labels.ref.ui',
|
||||||
'listview-with-wrapped-labels.ui',
|
'listview-with-wrapped-labels.ui',
|
||||||
'marble.xpm',
|
'marble.xpm',
|
||||||
|
Loading…
Reference in New Issue
Block a user