[gnome-calculator] Close the popover after changing mode
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] Close the popover after changing mode
- Date: Mon, 7 Apr 2014 14:05:55 +0000 (UTC)
commit 0b9815a9241c87353940823dd7ee82761850a61a
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Mon Apr 7 03:55:59 2014 +0200
Close the popover after changing mode
https://bugzilla.gnome.org/show_bug.cgi?id=724480
src/math-window.vala | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/math-window.vala b/src/math-window.vala
index 8839bf3..9c15b41 100644
--- a/src/math-window.vala
+++ b/src/math-window.vala
@@ -21,6 +21,8 @@ public class MathWindow : Gtk.ApplicationWindow
public MathButtons buttons { get { return _buttons; } }
private bool right_aligned;
+ private Gtk.MenuButton menu_button;
+
private Gtk.HeaderBar headerbar;
private Gtk.Label mode_label;
@@ -67,7 +69,7 @@ public class MathWindow : Gtk.ApplicationWindow
menu_box.pack_start (arrow);
menu_box.show ();
- var menu_button = new Gtk.MenuButton ();
+ menu_button = new Gtk.MenuButton ();
menu_button.add (menu_box);
menu_button.menu_model = (MenuModel) builder.get_object ("window-menu");
menu_button.get_style_context ().add_class ("title");
@@ -221,6 +223,10 @@ public class MathWindow : Gtk.ApplicationWindow
requires (parameter != null)
requires (parameter.is_of_type (VariantType.STRING))
{
+ var popover = menu_button.get_popover ();
+ popover.hide ();
+ menu_button.set_active (false);
+
var mode = ButtonMode.BASIC;
var mode_str = parameter.get_string (null);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]