WIP: List item factory syntax

This commit is contained in:
James Westman 2022-07-18 16:37:15 -05:00
parent 3416546eac
commit fdf91dc08e
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
10 changed files with 145 additions and 9 deletions

View file

@ -1,9 +1,9 @@
using Gtk 4.0;
Box {
visible: bind box2.visible inverted;
orientation: bind box2.orientation;
spacing: bind box2.spacing no-sync-create;
visible: bind-prop box2.visible inverted;
orientation: bind-prop box2.orientation;
spacing: bind-prop box2.spacing no-sync-create;
}
Box box2 {

View file

@ -0,0 +1,9 @@
using Gtk 4.0;
ListView {
factory: list_item_factory(CheckButton) {
child: Label {
label: bind item.group.label;
};
};
}

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<object class="GtkListView">
<property name="factory">
<object class="GtkBuilderListItemFactory">
<property name="bytes"><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="GtkListItem">
<property name="child">
<object class="GtkLabel">
<binding name="label">
<lookup name="label">
<lookup name="group">
<lookup name="item">GtkListItem</lookup>
</lookup>
</lookup>
</binding>
</object>
</property>
</template>
</interface>]]></property>
</object>
</property>
</object>
</interface>