close history window on ESC. fixes #3233
This commit is contained in:
		
							parent
							
								
									aff3697f06
								
							
						
					
					
						commit
						5b940a2416
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -7,6 +7,7 @@
 | 
			
		|||
    <property name="role">history</property>
 | 
			
		||||
    <property name="default_width">650</property>
 | 
			
		||||
    <property name="default_height">350</property>
 | 
			
		||||
    <signal name="key_press_event" handler="on_history_window_key_press_event"/>
 | 
			
		||||
    <signal name="destroy" handler="on_history_window_destroy"/>
 | 
			
		||||
    <child>
 | 
			
		||||
      <widget class="GtkVBox" id="vbox">
 | 
			
		||||
| 
						 | 
				
			
			@ -17,7 +18,6 @@
 | 
			
		|||
          <widget class="GtkFrame" id="frame1">
 | 
			
		||||
            <property name="visible">True</property>
 | 
			
		||||
            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 | 
			
		||||
            <property name="label_xalign">0</property>
 | 
			
		||||
            <property name="shadow_type">GTK_SHADOW_NONE</property>
 | 
			
		||||
            <child>
 | 
			
		||||
              <widget class="GtkAlignment" id="alignment1">
 | 
			
		||||
| 
						 | 
				
			
			@ -64,7 +64,6 @@ Enter the jid of a groupchat or a contact here. For online accounts you can even
 | 
			
		|||
          <widget class="GtkFrame" id="frame2">
 | 
			
		||||
            <property name="visible">True</property>
 | 
			
		||||
            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 | 
			
		||||
            <property name="label_xalign">0</property>
 | 
			
		||||
            <property name="shadow_type">GTK_SHADOW_NONE</property>
 | 
			
		||||
            <child>
 | 
			
		||||
              <widget class="GtkAlignment" id="alignment2">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -142,6 +142,10 @@ class HistoryWindow:
 | 
			
		|||
		self.history_textview.del_handlers()
 | 
			
		||||
		del gajim.interface.instances['logs']
 | 
			
		||||
 | 
			
		||||
	def on_history_window_key_press_event(self, widget, event):
 | 
			
		||||
		if event.keyval == gtk.keysyms.Escape:
 | 
			
		||||
			self.window.destroy()
 | 
			
		||||
 | 
			
		||||
	def on_close_button_clicked(self, widget):
 | 
			
		||||
		self.window.destroy()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue