13
0

allow <PRIMARY>-w to close the preferences window, just other dialogs

Preferences is a tabbable, a leftover artifact of when it was, in fact, intended to be a tabbable. Rather than
re-engineer this right now, add a key event handler so that Primary-w works for this just like other dialogs
This commit is contained in:
Paul Davis 2021-04-26 10:50:30 -06:00
parent cce41ee15b
commit fc9a4754bc
2 changed files with 16 additions and 0 deletions

View File

@ -37,6 +37,7 @@
#include <gtkmm/stock.h>
#include <gtkmm/scale.h>
#include "gtkmm2ext/keyboard.h"
#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/window_title.h"
@ -4461,6 +4462,19 @@ These settings will only take effect after %1 is restarted.\n\
set_current_page (_("General"));
}
bool
RCOptionEditor::on_key_release_event (GdkEventKey* event)
{
if (Keyboard::modifier_state_equals (event->state, Keyboard::close_window_modifier)) {
if (event->keyval == Keyboard::close_window_key) {
WindowProxy::hide ();
return true;
}
}
return false;
}
void
RCOptionEditor::set_session (Session *s)
{

View File

@ -46,6 +46,8 @@ public:
Gtk::Window* use_own_window (bool and_fill_it);
XMLNode& get_state ();
bool on_key_release_event (GdkEventKey*);
private:
void parameter_changed (std::string const &);
void ltc_generator_volume_changed ();