root/data/resources/ui/window.ui

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <menu id="primary_menu">
    <section>
      <item>
        <attribute name="label" translatable="yes">_Preferences</attribute>
        <attribute name="action">app.preferences</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
        <attribute name="action">win.show-help-overlay</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">_About GTK Rust Template</attribute>
        <attribute name="action">app.about</attribute>
      </item>
    </section>
  </menu>
  <template class="ExampleApplicationWindow" parent="GtkApplicationWindow">
    <child type="titlebar">
      <object class="GtkHeaderBar" id="headerbar">
        <child type="end">
          <object class="GtkMenuButton" id="appmenu_button">
            <property name="icon-name">open-menu-symbolic</property>
            <property name="menu-model">primary_menu</property>
          </object>
        </child>
      </object>
    </child>
    <child>
      <object class="GtkLabel" id="label">
        <property name="label" translatable="yes">Hello world!</property>
        <style>
          <class name="title-header"/>
        </style>
      </object>
    </child>
  </template>
</interface>