Skip to content

Commit 78a12d6

Browse files
CyberShadowkaiw
authored andcommitted
findbar: Hide when pressing Escape
Connect a handler for the GTK stop-search signal, and hide the FindBar when it is received. Although there exists code in FileDiff.on_key_event to handle Escape key presses, Escape key press events are not propagated when the GtkSearchEntry has focus.
1 parent 2fa7684 commit 78a12d6

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

data/ui/findbar.ui

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@
137137
<property name="secondary_icon_activatable">False</property>
138138
<signal name="changed" handler="on_find_entry_changed" swapped="no"/>
139139
<signal name="activate" handler="on_find_next_button_clicked" swapped="no"/>
140+
<signal name="stop-search" handler="on_stop_search" swapped="no"/>
140141
</object>
141142
<packing>
142143
<property name="left_attach">1</property>

meld/ui/findbar.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ def hide(self):
4848
self.wrap_box.set_visible(False)
4949
self.widget.hide()
5050

51+
def on_stop_search(self, search_entry):
52+
self.hide()
53+
5154
def set_text_view(self, textview):
5255
self.textview = textview
5356
if textview is not None:

0 commit comments

Comments
 (0)