mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-05 16:09:07 -04:00
WIP: List item factory syntax
This commit is contained in:
parent
3416546eac
commit
fdf91dc08e
10 changed files with 145 additions and 9 deletions
|
@ -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 {
|
||||
|
|
9
tests/samples/list_item_factory.blp
Normal file
9
tests/samples/list_item_factory.blp
Normal file
|
@ -0,0 +1,9 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
ListView {
|
||||
factory: list_item_factory(CheckButton) {
|
||||
child: Label {
|
||||
label: bind item.group.label;
|
||||
};
|
||||
};
|
||||
}
|
28
tests/samples/list_item_factory.ui
Normal file
28
tests/samples/list_item_factory.ui
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue