Merge pull request #96400 from Maran23/inputmap-usage-for-filter-and-corresponding-refactor
Use InputMap actions consistently across all LineEdit's that filter an underlying Tree or ItemList.
This commit is contained in:
@ -816,13 +816,14 @@ void GridMapEditor::_text_changed(const String &p_text) {
|
||||
update_palette();
|
||||
}
|
||||
|
||||
void GridMapEditor::_sbox_input(const Ref<InputEvent> &p_ie) {
|
||||
const Ref<InputEventKey> k = p_ie;
|
||||
|
||||
if (k.is_valid() && (k->get_keycode() == Key::UP || k->get_keycode() == Key::DOWN || k->get_keycode() == Key::PAGEUP || k->get_keycode() == Key::PAGEDOWN)) {
|
||||
// Forward the key input to the ItemList so it can be scrolled
|
||||
mesh_library_palette->gui_input(k);
|
||||
search_box->accept_event();
|
||||
void GridMapEditor::_sbox_input(const Ref<InputEvent> &p_event) {
|
||||
// Redirect navigational key events to the item list.
|
||||
Ref<InputEventKey> key = p_event;
|
||||
if (key.is_valid()) {
|
||||
if (key->is_action("ui_up", true) || key->is_action("ui_down", true) || key->is_action("ui_page_up") || key->is_action("ui_page_down")) {
|
||||
mesh_library_palette->gui_input(key);
|
||||
search_box->accept_event();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -199,7 +199,7 @@ class GridMapEditor : public VBoxContainer {
|
||||
void _update_theme();
|
||||
|
||||
void _text_changed(const String &p_text);
|
||||
void _sbox_input(const Ref<InputEvent> &p_ie);
|
||||
void _sbox_input(const Ref<InputEvent> &p_event);
|
||||
void _mesh_library_palette_input(const Ref<InputEvent> &p_ie);
|
||||
|
||||
void _icon_size_changed(float p_value);
|
||||
|
||||
Reference in New Issue
Block a user