Commit 8011fa15 authored by Clinton Rogers's avatar Clinton Rogers

This addresses #3124; it's copied and pasted from the original fix (see r2615)

parent 0d9a2fca
......@@ -244,6 +244,7 @@ public class SearchFilterToolbar : Gtk.Toolbar {
entry.focus_out_event.connect(on_editing_canceled);
entry.changed.connect(on_text_changed);
entry.icon_release.connect(on_icon_release);
entry.key_press_event.connect(on_escape_key);
add(entry);
}
......@@ -252,6 +253,7 @@ public class SearchFilterToolbar : Gtk.Toolbar {
entry.focus_out_event.disconnect(on_editing_canceled);
entry.changed.disconnect(on_text_changed);
entry.icon_release.disconnect(on_icon_release);
entry.key_press_event.disconnect(on_escape_key);
}
private void on_text_changed() {
......@@ -290,6 +292,18 @@ public class SearchFilterToolbar : Gtk.Toolbar {
public void get_focus() {
entry.has_focus = true;
}
// Ticket #3124 - user should be able to clear
// the search textbox by typing 'Esc'.
private bool on_escape_key(Gdk.EventKey e) {
if(Gdk.keyval_name(e.keyval) == "Escape") {
this.clear();
}
// Continue processing this event, since the
// text entry functionality needs to see it too.
return false;
}
}
// Handles ratings filters.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment