From 05566a635c223ce0b6573f3466ff766373fdc31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Mon, 6 Feb 2017 22:28:07 +0100 Subject: [PATCH] Close Feature Window with ESC --- data/gui/features_window.ui | 7 ++++--- src/features_window.py | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/data/gui/features_window.ui b/data/gui/features_window.ui index 55ab9c91e..a09677ce4 100644 --- a/data/gui/features_window.ui +++ b/data/gui/features_window.ui @@ -1,5 +1,5 @@ - + @@ -10,6 +10,7 @@ 300 530 dialog + True @@ -22,9 +23,9 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 <b>List of possible features in Gajim:</b> True + 0 False @@ -98,9 +99,9 @@ True False 12 - 0 True True + 0 diff --git a/src/features_window.py b/src/features_window.py index f28f5ab3c..d26eaade7 100644 --- a/src/features_window.py +++ b/src/features_window.py @@ -25,7 +25,7 @@ import os import gi -from gi.repository import Gtk +from gi.repository import Gtk, Gdk import gtkgui_helpers from common import gajim @@ -133,6 +133,10 @@ class FeaturesWindow: self.window.show_all() self.xml.get_object('close_button').grab_focus() + def on_key_press_event(self, widget, event): + if event.keyval == Gdk.KEY_Escape: + self.window.destroy() + def on_close_button_clicked(self, widget): self.window.destroy()