[gnome-calculator] Focus the input field after changing the mode



commit d2944bffb23253121840be6b961535f9ce7992d5
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Apr 6 21:38:21 2014 -0500

    Focus the input field after changing the mode
    
    Otherwise, you need to click on the input field before you can enter any
    numbers. Spotted by Arth.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724480

 src/math-display.vala |    5 +++++
 src/math-window.vala  |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/math-display.vala b/src/math-display.vala
index e5b347c..613460a 100644
--- a/src/math-display.vala
+++ b/src/math-display.vala
@@ -376,6 +376,11 @@ public class MathDisplay : Gtk.Viewport
 
         equation.select_range (start, end);
     }
+
+    public new void grab_focus ()
+    {
+        source_view.grab_focus ();
+    }
 }
 
 public class CompletionProvider : GLib.Object, Gtk.SourceCompletionProvider
diff --git a/src/math-window.vala b/src/math-window.vala
index 9c15b41..32619a4 100644
--- a/src/math-window.vala
+++ b/src/math-window.vala
@@ -227,6 +227,8 @@ public class MathWindow : Gtk.ApplicationWindow
         popover.hide ();
         menu_button.set_active (false);
 
+        display.grab_focus ();
+
         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]