From 1028be06dab2318f8c571d9af7dc827de1382a63 Mon Sep 17 00:00:00 2001 From: Reuben Rakete Date: Mon, 3 Dec 2018 21:23:56 -0800 Subject: [PATCH] Update hotkey filter to work with multi menu toggles --- changelog.md | 1 + data/core/about.cfg | 3 + data/gui/window/preferences/02_hotkeys.cfg | 2 +- src/gui/dialogs/preferences_dialog.cpp | 69 +++++++++------------- src/gui/dialogs/preferences_dialog.hpp | 3 +- 5 files changed, 35 insertions(+), 43 deletions(-) diff --git a/changelog.md b/changelog.md index c3571c9abb78..16e76a2f7cf7 100644 --- a/changelog.md +++ b/changelog.md @@ -72,6 +72,7 @@ * The "Attack Enemy" dialog now shows inactive weapon specials in gray. (PR #3686) * Taking screenshots in title screen is possible again (issue #3235) * The "Recruit Unit" dialog is searchable by unit type name. (PR #3787) + * Add text filter to hotkeys preferences. (PR #3759) ## Version 1.14.5 ### AI diff --git a/data/core/about.cfg b/data/core/about.cfg index 6616635203b1..d914b92730fc 100644 --- a/data/core/about.cfg +++ b/data/core/about.cfg @@ -1547,6 +1547,9 @@ [entry] name = "RatArmy (fujimo-t)" [/entry] + [entry] + name = "Reuben Rakete (rocketbang)" + [/entry] [entry] name = "Richard Yao (srk9)" comment = "Bug fixes" diff --git a/data/gui/window/preferences/02_hotkeys.cfg b/data/gui/window/preferences/02_hotkeys.cfg index 6abfba3de404..107924456c82 100644 --- a/data/gui/window/preferences/02_hotkeys.cfg +++ b/data/gui/window/preferences/02_hotkeys.cfg @@ -50,7 +50,7 @@ [label] definition = "default" - label = _ "Search:" + label = _ "Filter:" [/label] [/column] diff --git a/src/gui/dialogs/preferences_dialog.cpp b/src/gui/dialogs/preferences_dialog.cpp index e2f59319aa3e..fde2fff89498 100644 --- a/src/gui/dialogs/preferences_dialog.cpp +++ b/src/gui/dialogs/preferences_dialog.cpp @@ -143,7 +143,7 @@ preferences_dialog::preferences_dialog(const config& game_cfg, const PREFERENCE_ void preferences_dialog::on_filtertext_changed(text_box_base* textbox) { - hotkey_name_filter_callback(*textbox->get_window()); + hotkey_filter_callback(*textbox->get_window()); } // Helper function to refresh resolution list @@ -752,7 +752,7 @@ void preferences_dialog::post_build(window& window) hotkey_menu.set_values(hotkey_category_entries); connect_signal_notify_modified(hotkey_menu, - std::bind(&preferences_dialog::hotkey_type_filter_callback, this, std::ref(window))); + std::bind(&preferences_dialog::hotkey_filter_callback, this, std::ref(window))); listbox& hotkey_list = setup_hotkey_list(window); @@ -916,61 +916,50 @@ void preferences_dialog::remove_hotkey_callback(listbox& hotkeys) find_widget