Close Feature Window with ESC
This commit is contained in:
parent
a7c833f777
commit
05566a635c
2 changed files with 9 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.18.3 -->
|
<!-- Generated with glade 3.20.0 -->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.12"/>
|
<requires lib="gtk+" version="3.12"/>
|
||||||
<object class="GtkWindow" id="features_window">
|
<object class="GtkWindow" id="features_window">
|
||||||
|
@ -10,6 +10,7 @@
|
||||||
<property name="default_width">300</property>
|
<property name="default_width">300</property>
|
||||||
<property name="default_height">530</property>
|
<property name="default_height">530</property>
|
||||||
<property name="type_hint">dialog</property>
|
<property name="type_hint">dialog</property>
|
||||||
|
<signal name="key-press-event" handler="on_key_press_event" swapped="no"/>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="vbox1">
|
<object class="GtkBox" id="vbox1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
@ -22,9 +23,9 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes"><b>List of possible features in Gajim:</b></property>
|
<property name="label" translatable="yes"><b>List of possible features in Gajim:</b></property>
|
||||||
<property name="use_markup">True</property>
|
<property name="use_markup">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -98,9 +99,9 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="margin_left">12</property>
|
<property name="margin_left">12</property>
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="wrap">True</property>
|
<property name="wrap">True</property>
|
||||||
<property name="selectable">True</property>
|
<property name="selectable">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child type="label">
|
<child type="label">
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import gi
|
import gi
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk, Gdk
|
||||||
import gtkgui_helpers
|
import gtkgui_helpers
|
||||||
|
|
||||||
from common import gajim
|
from common import gajim
|
||||||
|
@ -133,6 +133,10 @@ class FeaturesWindow:
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
self.xml.get_object('close_button').grab_focus()
|
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):
|
def on_close_button_clicked(self, widget):
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue