diff options
Diffstat (limited to 'editor/settings_config_dialog.cpp')
-rw-r--r-- | editor/settings_config_dialog.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index a38c6b98cc..44962323e5 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,9 @@ #include "core/os/keyboard.h" #include "core/project_settings.h" #include "editor_file_system.h" +#include "editor_log.h" #include "editor_node.h" +#include "editor_scale.h" #include "editor_settings.h" #include "scene/gui/margin_container.h" #include "script_editor_debugger.h" @@ -233,14 +235,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()); |