This repository has been archived by the owner on Jun 1, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use GResource for menu XML descriptions
Instead of a hardcoded ugly long C string, use GResource support to build the XML in the binary, with the added niceties of using resources (e.g. gtk_builder_new_from_resource(), resource:// URIs, etc).
- Loading branch information
Showing
5 changed files
with
66 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
dwt | ||
*.sw[op] | ||
*.py[co] | ||
*.gresources.[hc] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<gresources> | ||
<gresource prefix="/org/perezdecastro/dwt"> | ||
<file preprocess="xml-stripblanks" compressed="true">menus.xml</file> | ||
</gresource> | ||
</gresources> | ||
<!-- vim:fenc=utf-8 | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<interface> | ||
<menu id='app-menu'> | ||
<section> | ||
<item> | ||
<attribute name='label' translatable='yes'>New _Terminal</attribute> | ||
<attribute name='action'>app.new-terminal</attribute> | ||
</item> | ||
</section> | ||
<section> | ||
<item> | ||
<attribute name='label' translatable='yes'>_About</attribute> | ||
<attribute name='action'>app.about</attribute> | ||
</item> | ||
</section> | ||
<section> | ||
<item> | ||
<attribute name='label' translatable='yes'>_Quit</attribute> | ||
<attribute name='action'>app.quit</attribute> | ||
</item> | ||
</section> | ||
</menu> | ||
<menu id='popover-menu'> | ||
<section> | ||
<item> | ||
<attribute name='label' translatable='yes'>_Copy</attribute> | ||
<attribute name='action'>win.copy</attribute> | ||
</item> | ||
<item> | ||
<attribute name='label' translatable='yes'>_Paste</attribute> | ||
<attribute name='action'>win.paste</attribute> | ||
</item> | ||
<item> | ||
<attribute name='label' translatable='yes'>Copy _URL</attribute> | ||
<attribute name='action'>win.copy-url</attribute> | ||
</item> | ||
<item> | ||
<attribute name='label' translatable='yes'>_Open URL…</attribute> | ||
<attribute name='action'>win.open-url</attribute> | ||
</item> | ||
</section> | ||
</menu> | ||
</interface> |