[gnome-boxes/wip/less-dialogs2: 14/14] properties-window: Go back on Alt+Left key combo



commit dc27244d4e89e982107c67508eabde89abafb8cc
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Dec 4 17:05:38 2014 +0000

    properties-window: Go back on Alt+Left key combo
    
    Go back to main page on Alt+Left key combo.

 src/properties-window.vala |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/properties-window.vala b/src/properties-window.vala
index 2cb9ab5..898f52e 100644
--- a/src/properties-window.vala
+++ b/src/properties-window.vala
@@ -78,9 +78,19 @@ private class Boxes.PropertiesWindow: Gtk.Window, Boxes.UI {
 
     [GtkCallback]
     private bool on_key_pressed (Widget widget, Gdk.EventKey event) {
-        if (event.keyval == Gdk.Key.Escape) // ESC -> back
+        var default_modifiers = Gtk.accelerator_get_default_mod_mask ();
+
+        if (event.keyval == Gdk.Key.Left && // ALT + Left -> back
+            (event.state & default_modifiers) == Gdk.ModifierType.MOD1_MASK) {
+            topbar.click_back_button ();
+
+            return true;
+        } else if (event.keyval == Gdk.Key.Escape) { // ESC -> back
             revert_state ();
 
+            return true;
+        }
+
         return false;
     }
 


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