Compare commits

..

1 commit

Author SHA1 Message Date
Octavian Alexandru Butiu
4a2d9ae969 port: Fix build error when building in a flatpak
If you create a project with gnome builder and port it blueprint and try to build it in flatpak you will get a compiler error that /org/gnome/Example/window.ui.
Setting the source_dir variable in meson fixes this.
2025-03-19 22:14:24 +02:00
4 changed files with 6 additions and 9 deletions

View file

@ -225,12 +225,12 @@ class Flag(AstNode):
return self.tokens["value"]
@property
def value(self) -> T.Optional[str]:
def value(self) -> T.Optional[int]:
type = self.context[ValueTypeCtx].value_type
if not isinstance(type, Enumeration):
return None
elif member := type.members.get(self.name):
return member.nick
return member.value
else:
return None

View file

@ -132,8 +132,5 @@ if __name__ == "__main__":
# print the sections to a json file
with open(outfile, "w") as f:
json.dump(
{name: section.to_json() for name, section in sections.items()},
f,
indent=2,
sort_keys=True,
{name: section.to_json() for name, section in sections.items()}, f, indent=2
)

View file

@ -26,7 +26,7 @@ Blueprint is a markup language and compiler for GTK 4 user interfaces.
using Gtk 4.0;
template $MyAppWindow: ApplicationWindow {
template MyAppWindow : ApplicationWindow {
default-width: 600;
default-height: 300;
title: _("Hello, Blueprint!");
@ -35,7 +35,7 @@ Blueprint is a markup language and compiler for GTK 4 user interfaces.
HeaderBar {}
Label {
label: bind template.main_text;
label: bind MyAppWindow.main_text;
}
}

View file

@ -7,7 +7,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<interface>
<requires lib="gtk" version="4.0"/>
<object class="GApplication">
<property name="flags">is-service|handles-open</property>
<property name="flags">1|4</property>
</object>
<object class="GtkEventControllerScroll">
<property name="flags">1</property>