From f24abb797da3cfc74fffe5ccf07ae809978433fa Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 11 Mar 2013 17:25:04 +0000 Subject: [PATCH] linux about: fix window close keyboard shortcuts --- SparkleShare/Linux/SparkleAbout.cs | 18 +++++++++++++----- SparkleShare/Linux/SparkleEventLog.cs | 3 +-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/SparkleShare/Linux/SparkleAbout.cs b/SparkleShare/Linux/SparkleAbout.cs index 5ec2aa24..37ea660b 100755 --- a/SparkleShare/Linux/SparkleAbout.cs +++ b/SparkleShare/Linux/SparkleAbout.cs @@ -32,11 +32,6 @@ namespace SparkleShare { public SparkleAbout () : base ("") { - DeleteEvent += delegate (object o, DeleteEventArgs args) { - Controller.WindowClosed (); - args.RetVal = true; - }; - DefaultSize = new Gdk.Size (600, 260); Resizable = false; BorderWidth = 0; @@ -56,6 +51,19 @@ namespace SparkleShare { CreateAbout (); + DeleteEvent += delegate (object o, DeleteEventArgs args) { + Controller.WindowClosed (); + args.RetVal = true; + }; + + KeyPressEvent += delegate (object o, KeyPressEventArgs args) { + if (args.Event.Key == Gdk.Key.Escape || + (args.Event.State == Gdk.ModifierType.ControlMask && args.Event.Key == Gdk.Key.w)) { + + Controller.WindowClosed (); + } + }; + Controller.HideWindowEvent += delegate { Application.Invoke (delegate { HideAll (); diff --git a/SparkleShare/Linux/SparkleEventLog.cs b/SparkleShare/Linux/SparkleEventLog.cs index 85b3ebbe..c7d9ffa5 100755 --- a/SparkleShare/Linux/SparkleEventLog.cs +++ b/SparkleShare/Linux/SparkleEventLog.cs @@ -64,8 +64,7 @@ namespace SparkleShare { KeyPressEvent += delegate (object o, KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Escape || - (args.Event.State == Gdk.ModifierType.ControlMask) && - args.Event.Key == Gdk.Key.w) { + (args.Event.State == Gdk.ModifierType.ControlMask && args.Event.Key == Gdk.Key.w)) { Controller.WindowClosed (); }