[gnome-sound-recorder/drop-appmenu] application, window: Drop AppMenu
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sound-recorder/drop-appmenu] application, window: Drop AppMenu
- Date: Thu, 1 Nov 2018 10:47:01 +0000 (UTC)
commit 233d3819ef9af525ee3e149d696bc908a50cdb05
Author: Felipe Borges <felipeborges gnome org>
Date: Thu Nov 1 11:46:39 2018 +0100
application, window: Drop AppMenu
This is part of the GNOME Initiative of removing app-menus.
See https://gitlab.gnome.org/GNOME/Initiatives/wikis/App-Menu-Retirement
Fixes #38
src/application.js | 9 ---------
src/mainWindow.js | 16 ++++++++++++++++
2 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 671b085..dc2982e 100644
--- a/src/application.js
+++ b/src/application.js
@@ -44,15 +44,6 @@ const Application = new Lang.Class({
},
_initAppMenu: function() {
- let menu = new Gio.Menu();
- let section = new Gio.Menu();
- menu.append_section(null, section);
- section.append(_("Preferences"), 'app.preferences');
- section = new Gio.Menu();
- menu.append_section(null, section);
- section.append(_("About"), 'app.about');
- section.append(_("Quit"),'app.quit');
- this.set_app_menu(menu);
let preferences = new Gio.SimpleAction({ name: 'preferences' });
preferences.connect('activate', Lang.bind(this,
function() {
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 9657bc5..9abe024 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -52,6 +52,7 @@ let play = null;
let previousSelRow = null;
let recordPipeline = null;
let recordButton = null;
+let appMenuButton = null;
let selectable = null;
let setVisibleID = null;
let UpperBoundVal = 182;
@@ -114,8 +115,23 @@ const MainWindow = new Lang.Class({
recordButton.get_style_context().add_class('destructive-action');
header.pack_start(recordButton);
+ this._addAppMenu();
+
this.add(view);
this.show_all();
+ },
+
+ _addAppMenu: function() {
+ let menu = new Gio.Menu();
+ menu.append(_("Preferences"), 'app.preferences');
+ menu.append(_("About"), 'app.about');
+ menu.append(_("Quit"),'app.quit');
+
+ appMenuButton = new Gtk.MenuButton({
+ image: new Gtk.Image({ icon_name: 'open-menu-symbolic' }),
+ menu_model: menu
+ });
+ header.pack_end(appMenuButton);
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]