[polari] ui: Move app menu into window
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] ui: Move app menu into window
- Date: Thu, 24 Jan 2019 18:35:29 +0000 (UTC)
commit 140369fd5646d706bad0161ee07cf18d91567c72
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jun 28 21:09:47 2018 +0200
ui: Move app menu into window
GNOME is phasing out the app menu[0], so move its actions into a
hamburger menu inside the headerbar. Eventually we will remove
the app menu altogether, but for now we keep the 'quit' action
to mimic GNOME Shell's fallback menu, so that the action behaves
as expected (namely, quit the application instead of sending it
to the background if the corresponding option is set).
[0] https://wiki.gnome.org/Design/Whiteboards/AppMenuMigration
https://gitlab.gnome.org/GNOME/polari/merge_requests/53
data/resources/main-window.ui | 47 +++++++++++++++++++++++++++++++++++++++++++
data/resources/menus.ui | 18 -----------------
2 files changed, 47 insertions(+), 18 deletions(-)
---
diff --git a/data/resources/main-window.ui b/data/resources/main-window.ui
index 4d8d142..d534947 100644
--- a/data/resources/main-window.ui
+++ b/data/resources/main-window.ui
@@ -9,6 +9,32 @@
<class name="polari-user-list"/>
</style>
</object>
+ <menu id="hamburgerMenu">
+ <section>
+ <item>
+ <attribute name="action">app.run-in-background</attribute>
+ <attribute name="label" translatable="yes">Run in Background</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="action">win.show-help-overlay</attribute>
+ <attribute name="label" translatable="yes">Keyboard Shortcuts</attribute>
+ </item>
+ <item>
+ <attribute name="action">app.help</attribute>
+ <attribute name="label" translatable="yes">Help</attribute>
+ </item>
+ <item>
+ <attribute name="action">app.about</attribute>
+ <attribute name="label" translatable="yes">About</attribute>
+ </item>
+ <item>
+ <attribute name="action">app.quit</attribute>
+ <attribute name="label" translatable="yes">Quit</attribute>
+ </item>
+ </section>
+ </menu>
<template class="Gjs_MainWindow">
<property name="title" translatable="yes">Polari</property>
<property name="icon-name">org.gnome.Polari</property>
@@ -48,6 +74,27 @@
<property name="pack-type">start</property>
</packing>
</child>
+ <child>
+ <object class="GtkMenuButton">
+ <property name="visible">True</property>
+ <property name="halign">end</property>
+ <property name="valign">center</property>
+ <property name="menu-model">hamburgerMenu</property>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="icon-name">open-menu-symbolic</property>
+ <property name="icon-size">1</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="pack-type">end</property>
+ </packing>
+ </child>
</object>
</child>
<child>
diff --git a/data/resources/menus.ui b/data/resources/menus.ui
index eff8d78..be135ad 100644
--- a/data/resources/menus.ui
+++ b/data/resources/menus.ui
@@ -1,24 +1,6 @@
<interface>
<menu id="app-menu">
<section>
- <item>
- <attribute name="action">app.run-in-background</attribute>
- <attribute name="label" translatable="yes">Run in Background</attribute>
- </item>
- </section>
- <section>
- <item>
- <attribute name="action">win.show-help-overlay</attribute>
- <attribute name="label" translatable="yes">Keyboard Shortcuts</attribute>
- </item>
- <item>
- <attribute name="action">app.help</attribute>
- <attribute name="label" translatable="yes">Help</attribute>
- </item>
- <item>
- <attribute name="action">app.about</attribute>
- <attribute name="label" translatable="yes">About</attribute>
- </item>
<item>
<attribute name="action">app.quit</attribute>
<attribute name="label" translatable="yes">Quit</attribute>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]