linux about: fix window close keyboard shortcuts

This commit is contained in:
Hylke Bons 2013-03-11 17:25:04 +00:00
parent f302f34c9b
commit f24abb797d
2 changed files with 14 additions and 7 deletions

View file

@ -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 ();

View file

@ -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 ();
}