1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:37:35 +00:00

LibGUI: Always activate ComboBox ListView selections on MouseUp

Fixes having to doubleclick selected items to activate them if
the selection index hasn't changed since last activation.
This commit is contained in:
thankyouverycool 2022-09-22 06:51:05 -04:00 committed by Andreas Kling
parent 7ac30f53a0
commit db2a1d3620

View file

@ -126,10 +126,10 @@ ComboBox::ComboBox()
m_list_view->set_hover_highlighting(true);
m_list_view->set_frame_thickness(1);
m_list_view->set_frame_shadow(Gfx::FrameShadow::Plain);
m_list_view->set_activates_on_selection(true);
m_list_view->on_selection_change = [this] {
VERIFY(model());
const auto& index = m_list_view->selection().first();
m_list_view->set_activates_on_selection(true);
if (m_updating_model)
selection_updated(index);
};
@ -140,7 +140,6 @@ ComboBox::ComboBox()
if (on_change)
on_change(m_editor->text(), index);
});
m_list_view->set_activates_on_selection(false);
close();
};