mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:57:35 +00:00
LibGUI: Fix to ComboBox fields activation
This commit is contained in:
parent
3a8109d1e0
commit
82696078b0
1 changed files with 4 additions and 6 deletions
|
@ -60,10 +60,6 @@ ComboBox::ComboBox()
|
||||||
{
|
{
|
||||||
m_editor = add<ComboBoxEditor>();
|
m_editor = add<ComboBoxEditor>();
|
||||||
m_editor->set_has_open_button(true);
|
m_editor->set_has_open_button(true);
|
||||||
m_editor->on_change = [this] {
|
|
||||||
if (on_change)
|
|
||||||
on_change(m_editor->text(), m_list_view->cursor_index());
|
|
||||||
};
|
|
||||||
m_editor->on_return_pressed = [this] {
|
m_editor->on_return_pressed = [this] {
|
||||||
if (on_return_pressed)
|
if (on_return_pressed)
|
||||||
on_return_pressed();
|
on_return_pressed();
|
||||||
|
@ -121,15 +117,17 @@ ComboBox::ComboBox()
|
||||||
m_editor->set_text(new_value);
|
m_editor->set_text(new_value);
|
||||||
if (!m_only_allow_values_from_model)
|
if (!m_only_allow_values_from_model)
|
||||||
m_editor->select_all();
|
m_editor->select_all();
|
||||||
|
};
|
||||||
|
|
||||||
|
m_list_view->on_activation = [this](auto& index) {
|
||||||
deferred_invoke([this, index](auto&) {
|
deferred_invoke([this, index](auto&) {
|
||||||
if (on_change)
|
if (on_change)
|
||||||
on_change(m_editor->text(), index);
|
on_change(m_editor->text(), index);
|
||||||
});
|
});
|
||||||
};
|
|
||||||
m_list_view->on_activation = [this](auto&) {
|
|
||||||
m_list_view->set_activates_on_selection(false);
|
m_list_view->set_activates_on_selection(false);
|
||||||
close();
|
close();
|
||||||
};
|
};
|
||||||
|
|
||||||
m_list_view->on_escape_pressed = [this] {
|
m_list_view->on_escape_pressed = [this] {
|
||||||
close();
|
close();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue