summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-12-13 08:48:37 +0100
committerGitHub <noreply@github.com>2019-12-13 08:48:37 +0100
commit01f34255940cac5143901b7e64170c636436c274 (patch)
tree7ab2d46152d9e291ed7e7a5ad4cff311c5b78cd5
parentd39284a65fec4d62d56972e03e7aa7042ad673ea (diff)
parent75e82417a64c29ae54db7c620a314da622aa2def (diff)
Merge pull request #34304 from Calinou/improve-editor-shortcuts-search
Don't search in unassigned shortcut labels in the editor shortcuts
-rw-r--r--editor/settings_config_dialog.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index a38c6b98cc..a780b117e1 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -233,14 +233,23 @@ void EditorSettingsDialog::_update_shortcuts() {
section->set_custom_bg_color(1, get_color("prop_subsection", "Editor"));
}
- if (shortcut_filter.is_subsequence_ofi(sc->get_name()) || shortcut_filter.is_subsequence_ofi(sc->get_as_text())) {
+ // Don't match unassigned shortcuts when searching for assigned keys in search results.
+ // This prevents all unassigned shortcuts from appearing when searching a string like "no".
+ if (shortcut_filter.is_subsequence_ofi(sc->get_name()) || (sc->get_as_text() != "None" && shortcut_filter.is_subsequence_ofi(sc->get_as_text()))) {
TreeItem *item = shortcuts->create_item(section);
item->set_text(0, sc->get_name());
item->set_text(1, sc->get_as_text());
+
if (!sc->is_shortcut(original) && !(sc->get_shortcut().is_null() && original.is_null())) {
item->add_button(1, get_icon("Reload", "EditorIcons"), 2);
}
+
+ if (sc->get_as_text() == "None") {
+ // Fade out unassigned shortcut labels for easier visual grepping.
+ item->set_custom_color(1, get_color("font_color", "Label") * Color(1, 1, 1, 0.5));
+ }
+
item->add_button(1, get_icon("Edit", "EditorIcons"), 0);
item->add_button(1, get_icon("Close", "EditorIcons"), 1);
item->set_tooltip(0, E->get());