Skip to content
Snippets Groups Projects
Verified Commit 3c40185b authored by Bruce Cowan's avatar Bruce Cowan :airplane:
Browse files

Embed item template within main UI file

parent 4a555647
No related branches found
No related tags found
No related merge requests found
Pipeline #4030 passed
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: 2021 Bruce Cowan <bruce@bcowan.me.uk>
SPDX-License-Identifier: GPL-3.0-or-later
-->
<interface>
<requires lib="gtk" version="4.0"/>
<template class="GtkListItem">
<property name="child">
<object class="RugbyPossibilityWidget">
<binding name="possibility">
<lookup name="item">GtkListItem</lookup>
</binding>
<binding name="tooltip-text">
<closure type="gchararray" function="item_tooltip_cb">
<lookup name="item">GtkListItem</lookup>
</closure>
</binding>
</object>
</property>
</template>
</interface>
...@@ -82,7 +82,12 @@ template $RugbyAppWindow : Adw.ApplicationWindow { ...@@ -82,7 +82,12 @@ template $RugbyAppWindow : Adw.ApplicationWindow {
styles ["rich-list", "card"] styles ["rich-list", "card"]
factory: BuilderListItemFactory { factory: BuilderListItemFactory {
resource: "/uk/me/bcowan/Rugby/gtk/score-item.ui"; template ListItem {
child: $RugbyPossibilityWidget {
possibility: bind template.item;
tooltip-text: bind $item_tooltip_cb(template.item) as <string>;
};
}
}; };
model: NoSelection { model: NoSelection {
model: FilterListModel { model: FilterListModel {
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
SPDX-FileCopyrightText: 2012-2022 Bruce Cowan <bruce@bcowan.me.uk> SPDX-FileCopyrightText: 2012-2023 Bruce Cowan <bruce@bcowan.me.uk>
SPDX-License-Identifier: GPL-3.0-or-later SPDX-License-Identifier: GPL-3.0-or-later
--> -->
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<gresource prefix="/uk/me/bcowan/Rugby"> <gresource prefix="/uk/me/bcowan/Rugby">
<file compressed="true" preprocess="xml-stripblanks">gtk/help-overlay.ui</file> <file compressed="true" preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
<file compressed="true" preprocess="xml-stripblanks">gtk/prefs.ui</file> <file compressed="true" preprocess="xml-stripblanks">gtk/prefs.ui</file>
<file compressed="true" preprocess="xml-stripblanks">gtk/score-item.ui</file>
<file compressed="true" preprocess="xml-stripblanks">gtk/window.ui</file> <file compressed="true" preprocess="xml-stripblanks">gtk/window.ui</file>
</gresource> </gresource>
<gresource prefix="/uk/me/bcowan/Rugby/icons/scalable/actions/"> <gresource prefix="/uk/me/bcowan/Rugby/icons/scalable/actions/">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment