mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 08:48:49 +00:00
LibGUI: Add hover highlighting and keyboard controls to ComboBox
Adds a new highlighting effect to the actively selected row in ComboBox ListView. ComboBoxEditor can now be controlled with page up, page down, and the up and down arrow keys. ESC and loss of focus now cause comboboxes to close. Now activates on mouseup as well as return.
This commit is contained in:
parent
b2783a234a
commit
6a78db07f1
Notes:
sideshowbarker
2024-07-19 04:48:58 +09:00
Author: https://github.com/thankyouverycool
Commit: 6a78db07f1
Pull-request: https://github.com/SerenityOS/serenity/pull/2794
Reviewed-by: https://github.com/awesomekling
7 changed files with 142 additions and 15 deletions
|
@ -225,6 +225,16 @@ void AbstractView::set_hovered_index(const ModelIndex& index)
|
|||
if (m_hovered_index == index)
|
||||
return;
|
||||
m_hovered_index = index;
|
||||
if (m_hovered_index.is_valid())
|
||||
m_last_valid_hovered_index = m_hovered_index;
|
||||
update();
|
||||
}
|
||||
|
||||
void AbstractView::set_last_valid_hovered_index(const ModelIndex& index)
|
||||
{
|
||||
if (m_last_valid_hovered_index == index)
|
||||
return;
|
||||
m_last_valid_hovered_index = index;
|
||||
update();
|
||||
}
|
||||
|
||||
|
@ -325,6 +335,9 @@ void AbstractView::mouseup_event(MouseEvent& event)
|
|||
m_might_drag = false;
|
||||
update();
|
||||
}
|
||||
|
||||
if (activates_on_selection())
|
||||
activate_selected();
|
||||
}
|
||||
|
||||
void AbstractView::doubleclick_event(MouseEvent& event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue