[gnome-calculator] Disable the primary menu for now and return the AppMenu.
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] Disable the primary menu for now and return the AppMenu.
- Date: Tue, 10 Jul 2018 07:30:59 +0000 (UTC)
commit 0764d2a3291d11c0538aa97663bbf6afc025a52a
Author: Robert Ancell <robert ancell canonical com>
Date: Tue Jul 10 09:19:09 2018 +0200
Disable the primary menu for now and return the AppMenu.
We will enable it when https://wiki.gnome.org/Initiatives/GnomeGoals/AppMenuRetirement is confirmed.
src/gnome-calculator.vala | 3 +++
src/math-window.ui | 4 ++--
src/math-window.vala | 4 ++++
3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-calculator.vala b/src/gnome-calculator.vala
index 17a49e6e..7763528c 100644
--- a/src/gnome-calculator.vala
+++ b/src/gnome-calculator.vala
@@ -93,6 +93,9 @@ public class Calculator : Gtk.Application
buttons.programming_base = number_base;
buttons.mode = button_mode; // FIXME: We load the basic buttons even if we immediately switch to the
next type
+ /* Remove when https://wiki.gnome.org/Initiatives/GnomeGoals/AppMenuRetirement is confirmed */
+ set_app_menu (current_window.primary_menu_button.menu_model);
+
set_accels_for_action ("win.mode::basic", {"<alt>B"});
set_accels_for_action ("win.mode::advanced", {"<alt>A"});
set_accels_for_action ("win.mode::financial", {"<alt>F"});
diff --git a/src/math-window.ui b/src/math-window.ui
index bc1233d5..71948e8f 100644
--- a/src/math-window.ui
+++ b/src/math-window.ui
@@ -156,8 +156,8 @@
</object>
</child>
<child>
- <object class="GtkMenuButton">
- <property name="visible">True</property>
+ <object class="GtkMenuButton" id="primary_menu_button">
+ <property name="visible">False</property> <!-- Disabled until
https://wiki.gnome.org/Initiatives/GnomeGoals/AppMenuRetirement is confirmed -->
<property name="can_focus">False</property>
<property name="receives_default">False</property>
<property name="menu_model">primary_menu</property>
diff --git a/src/math-window.vala b/src/math-window.vala
index dc244ccf..ddb0caea 100644
--- a/src/math-window.vala
+++ b/src/math-window.vala
@@ -31,6 +31,10 @@ public class MathWindow : Gtk.ApplicationWindow
[GtkChild]
private MathConverter converter;
+ /* Remove when https://wiki.gnome.org/Initiatives/GnomeGoals/AppMenuRetirement is confirmed */
+ [GtkChild]
+ public Gtk.MenuButton primary_menu_button;
+
private const ActionEntry[] window_entries =
{
{ "copy", copy_cb, null, null, null },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]