mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-05 16:09:07 -04:00
language: Fix some issues with menus
Blueprint's handling of menus didn't line up with how GtkBuilder handles them. The root <menu> element must have an ID and may not have attributes, and menus may not be used inline in a property.
This commit is contained in:
parent
93f2a27e35
commit
bbad6988fa
18 changed files with 52 additions and 53 deletions
|
@ -1,5 +0,0 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
MenuButton {
|
||||
menu-model: menu primary_menu {};
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="menu-model">
|
||||
<menu id="primary_menu"></menu>
|
||||
</property>
|
||||
</object>
|
||||
</interface>
|
|
@ -1,13 +1,12 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
menu {
|
||||
label: _("menu label");
|
||||
test-custom-attribute: 3.1415;
|
||||
menu my_menu {
|
||||
section {
|
||||
label: "test section";
|
||||
}
|
||||
|
||||
submenu {
|
||||
section {
|
||||
label: "test section";
|
||||
}
|
||||
label: "test submenu";
|
||||
|
||||
item {
|
||||
label: "test item";
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<menu>
|
||||
<attribute name="label" translatable="true">menu label</attribute>
|
||||
<attribute name="test-custom-attribute">3.1415</attribute>
|
||||
<menu id="my_menu">
|
||||
<section>
|
||||
<attribute name="label">test section</attribute>
|
||||
</section>
|
||||
<submenu>
|
||||
<section>
|
||||
<attribute name="label">test section</attribute>
|
||||
</section>
|
||||
<attribute name="label">test submenu</attribute>
|
||||
<item>
|
||||
<attribute name="label">test item</attribute>
|
||||
</item>
|
||||
|
@ -25,4 +24,4 @@
|
|||
</item>
|
||||
</submenu>
|
||||
</menu>
|
||||
</interface>
|
||||
</interface>
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
menu {
|
||||
label: _("menu label");
|
||||
test-custom-attribute: "3.1415";
|
||||
menu my_menu {
|
||||
section {
|
||||
label: "test section";
|
||||
}
|
||||
|
||||
submenu {
|
||||
section {
|
||||
label: "test section";
|
||||
}
|
||||
label: "test submenu";
|
||||
|
||||
item {
|
||||
label: "test item";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue