You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Make ThemeTypeDialog List navigatable when the LineEdit selected
This behavior is the same as in the CreateDialog. The arrow keys or page up/page down navigate the List while the LineEdit has focus.
This commit is contained in:
@@ -2174,8 +2174,26 @@ void ThemeTypeDialog::_add_type_filter_cbk(const String &p_value) {
|
|||||||
_update_add_type_options(p_value);
|
_update_add_type_options(p_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ThemeTypeDialog::_type_filter_input(const Ref<InputEvent> &p_ie) {
|
||||||
|
Ref<InputEventKey> k = p_ie;
|
||||||
|
if (k.is_valid() && k->is_pressed()) {
|
||||||
|
switch (k->get_keycode()) {
|
||||||
|
case Key::UP:
|
||||||
|
case Key::DOWN:
|
||||||
|
case Key::PAGEUP:
|
||||||
|
case Key::PAGEDOWN: {
|
||||||
|
add_type_options->gui_input(k);
|
||||||
|
add_type_filter->accept_event();
|
||||||
|
} break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ThemeTypeDialog::_add_type_options_cbk(int p_index) {
|
void ThemeTypeDialog::_add_type_options_cbk(int p_index) {
|
||||||
add_type_filter->set_text(add_type_options->get_item_text(p_index));
|
add_type_filter->set_text(add_type_options->get_item_text(p_index));
|
||||||
|
add_type_filter->set_caret_column(add_type_filter->get_text().length());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThemeTypeDialog::_add_type_dialog_entered(const String &p_value) {
|
void ThemeTypeDialog::_add_type_dialog_entered(const String &p_value) {
|
||||||
@@ -2245,6 +2263,7 @@ ThemeTypeDialog::ThemeTypeDialog() {
|
|||||||
add_type_vb->add_child(add_type_filter);
|
add_type_vb->add_child(add_type_filter);
|
||||||
add_type_filter->connect(SceneStringName(text_changed), callable_mp(this, &ThemeTypeDialog::_add_type_filter_cbk));
|
add_type_filter->connect(SceneStringName(text_changed), callable_mp(this, &ThemeTypeDialog::_add_type_filter_cbk));
|
||||||
add_type_filter->connect("text_submitted", callable_mp(this, &ThemeTypeDialog::_add_type_dialog_entered));
|
add_type_filter->connect("text_submitted", callable_mp(this, &ThemeTypeDialog::_add_type_dialog_entered));
|
||||||
|
add_type_filter->connect(SceneStringName(gui_input), callable_mp(this, &ThemeTypeDialog::_type_filter_input));
|
||||||
|
|
||||||
Label *add_type_options_label = memnew(Label);
|
Label *add_type_options_label = memnew(Label);
|
||||||
add_type_options_label->set_text(TTR("Available Node-based types:"));
|
add_type_options_label->set_text(TTR("Available Node-based types:"));
|
||||||
|
|||||||
@@ -303,6 +303,7 @@ class ThemeTypeDialog : public ConfirmationDialog {
|
|||||||
void _update_add_type_options(const String &p_filter = "");
|
void _update_add_type_options(const String &p_filter = "");
|
||||||
|
|
||||||
void _add_type_filter_cbk(const String &p_value);
|
void _add_type_filter_cbk(const String &p_value);
|
||||||
|
void _type_filter_input(const Ref<InputEvent> &p_ie);
|
||||||
void _add_type_options_cbk(int p_index);
|
void _add_type_options_cbk(int p_index);
|
||||||
void _add_type_dialog_entered(const String &p_value);
|
void _add_type_dialog_entered(const String &p_value);
|
||||||
void _add_type_dialog_activated(int p_index);
|
void _add_type_dialog_activated(int p_index);
|
||||||
|
|||||||
Reference in New Issue
Block a user