[gnome-calculator] Added shortcut to close current window (bgo#755398)



commit 1bdb9e124fddd274907a47b1c66c991d5063acdc
Author: Robert Roth <robert roth off gmail com>
Date:   Fri Oct 21 02:41:01 2016 +0300

    Added shortcut to close current window (bgo#755398)

 data/math-shortcuts.ui    |    7 +++++++
 src/gnome-calculator.vala |    1 +
 src/math-window.vala      |    1 +
 3 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/data/math-shortcuts.ui b/data/math-shortcuts.ui
index 79d56b0..89a5d04 100644
--- a/data/math-shortcuts.ui
+++ b/data/math-shortcuts.ui
@@ -23,6 +23,13 @@
             <child>
               <object class="GtkShortcutsShortcut">
                 <property name="visible">1</property>
+                <property name="accelerator">&lt;ctrl&gt;w</property>
+                <property name="title" translatable="yes" context="shortcut window">Close current 
window</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
                 <property name="accelerator">F1</property>
                 <property name="title" translatable="yes" context="shortcut window">Open help</property>
               </object>
diff --git a/src/gnome-calculator.vala b/src/gnome-calculator.vala
index 231eec2..2f494f2 100644
--- a/src/gnome-calculator.vala
+++ b/src/gnome-calculator.vala
@@ -102,6 +102,7 @@ public class Calculator : Gtk.Application
         set_accels_for_action ("win.copy", {"<control>C"});
         set_accels_for_action ("win.paste", {"<control>V"});
         set_accels_for_action ("win.undo", {"<control>Z"});
+        set_accels_for_action ("win.close", {"<control>W"});
         set_accels_for_action ("win.redo", {"<control><shift>Z"});
         return current_window;
     }
diff --git a/src/math-window.vala b/src/math-window.vala
index 0be4930..53f12a1 100644
--- a/src/math-window.vala
+++ b/src/math-window.vala
@@ -38,6 +38,7 @@ public class MathWindow : Gtk.ApplicationWindow
         { "undo", undo_cb, null, null, null },
         { "redo", redo_cb, null, null, null },
         { "mode", mode_cb, "s", "\"basic\"", null },
+        { "close",close, null, null, null },
     };
 
     public MathWindow (Gtk.Application app, MathEquation equation)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]