Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adrien Plazas
libhandy
Commits
342ac783
Commit
342ac783
authored
Jan 28, 2020
by
Alexander Mikhaylenko
Committed by
Adrien Plazas
Jan 29, 2020
Browse files
example: Use a menu model for primary menu
Signed-off-by:
Alexander Mikhaylenko
<
alexm@gnome.org
>
parent
b9a36848
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/hdy-demo-window.ui
View file @
342ac783
...
...
@@ -3,25 +3,14 @@
<interface>
<requires
lib=
"gtk+"
version=
"3.16"
/>
<requires
lib=
"libhandy"
version=
"1.0"
/>
<object
class=
"GtkPopover"
id=
"menu_popover"
>
<child>
<object
class=
"GtkBox"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"spacing"
>
6
</property>
<property
name=
"margin"
>
18
</property>
<property
name=
"orientation"
>
vertical
</property>
<property
name=
"width_request"
>
200
</property>
<child>
<object
class=
"GtkModelButton"
>
<property
name=
"action-name"
>
app.preferences
</property>
<property
name=
"can-focus"
>
True
</property>
<property
name=
"text"
translatable=
"yes"
>
Preferences
</property>
<property
name=
"visible"
>
True
</property>
</object>
</child>
</object>
</child>
</object>
<menu
id=
"primary_menu"
>
<section>
<item>
<attribute
name=
"label"
translatable=
"yes"
>
Preferences
</attribute>
<attribute
name=
"action"
>
app.preferences
</attribute>
</item>
</section>
</menu>
<template
class=
"HdyDemoWindow"
parent=
"GtkApplicationWindow"
>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"title"
>
Handy Demo
</property>
...
...
@@ -48,7 +37,8 @@
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"focus_on_click"
>
False
</property>
<property
name=
"popover"
>
menu_popover
</property>
<property
name=
"menu_model"
>
primary_menu
</property>
<property
name=
"use_popover"
>
True
</property>
<child>
<object
class=
"GtkImage"
>
<property
name=
"visible"
>
True
</property>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment