mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add type to BuilderListItemFactory extension
Makes it a little clearer how it works.
This commit is contained in:
parent
7008924afe
commit
60f9173421
7 changed files with 38 additions and 4 deletions
5
tests/sample_errors/list_factory.blp
Normal file
5
tests/sample_errors/list_factory.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
BuilderListItemFactory {
|
||||
template Label {}
|
||||
}
|
1
tests/sample_errors/list_factory.err
Normal file
1
tests/sample_errors/list_factory.err
Normal file
|
@ -0,0 +1 @@
|
|||
4,3,17,Only Gtk.ListItem is allowed as a type here
|
|
@ -1,7 +1,7 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
BuilderListItemFactory {
|
||||
template {
|
||||
template ListItem {
|
||||
child: label;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ using Gtk 4.0;
|
|||
|
||||
Gtk.ListView {
|
||||
factory: Gtk.BuilderListItemFactory list_item_factory {
|
||||
template {
|
||||
template ListItem {
|
||||
child: Label {
|
||||
label: "Hello";
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
Gtk.BuilderListItemFactory {
|
||||
template {
|
||||
template ListItem {
|
||||
child: Gtk.Label label {};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -267,6 +267,7 @@ class TestSamples(unittest.TestCase):
|
|||
self.assert_sample_error("invalid_bool")
|
||||
self.assert_sample_error("layout_in_non_widget")
|
||||
self.assert_sample_error("legacy_template")
|
||||
self.assert_sample_error("list_factory")
|
||||
self.assert_sample_error("menu_no_id")
|
||||
self.assert_sample_error("menu_toplevel_attribute")
|
||||
self.assert_sample_error("no_import_version")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue