From cc971b6d9b19c31305e9ea7142c76863d1442e99 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 2 Jun 2017 18:21:31 +0200 Subject: Import Dialog is Window. Dialog Esc behavior needs to be emulated. --- gtk2_ardour/sfdb_ui.cc | 10 ++++++++++ gtk2_ardour/sfdb_ui.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index c1662515ce..bd64df19d7 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -833,6 +833,16 @@ SoundFileBrowser::on_show () start_metering (); } +bool +SoundFileBrowser::on_key_press_event (GdkEventKey* ev) +{ + if (ev->keyval == GDK_Escape) { + do_something (RESPONSE_CLOSE); + return true; + } + return ArdourWindow::on_key_press_event (ev); +} + void SoundFileBrowser::clear_selection () { diff --git a/gtk2_ardour/sfdb_ui.h b/gtk2_ardour/sfdb_ui.h index be734cfb82..fed8674e3f 100644 --- a/gtk2_ardour/sfdb_ui.h +++ b/gtk2_ardour/sfdb_ui.h @@ -252,8 +252,8 @@ class SoundFileBrowser : public ArdourWindow virtual bool reset_options () { return true; } - protected: void on_show(); + bool on_key_press_event (GdkEventKey*); virtual void do_something(int action); }; -- cgit v1.2.3