mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 06:18:59 +00:00
LibGUI: Brighten icons when hovering items in item views
View classes now track their hovered item and paint them in a slightly brighter shade to liven up the user interface. :^)
This commit is contained in:
parent
add93bf593
commit
b4fde72013
Notes:
sideshowbarker
2024-07-19 08:02:45 +09:00
Author: https://github.com/awesomekling
Commit: b4fde72013
6 changed files with 40 additions and 11 deletions
|
@ -193,7 +193,16 @@ void AbstractView::mousedown_event(MouseEvent& event)
|
|||
|
||||
void AbstractView::mousemove_event(MouseEvent& event)
|
||||
{
|
||||
if (!model() || !m_might_drag)
|
||||
if (!model())
|
||||
return ScrollableWidget::mousemove_event(event);
|
||||
|
||||
auto hovered_index = index_at_event_position(event.position());
|
||||
if (m_hovered_index != hovered_index) {
|
||||
m_hovered_index = hovered_index;
|
||||
update();
|
||||
}
|
||||
|
||||
if (!m_might_drag)
|
||||
return ScrollableWidget::mousemove_event(event);
|
||||
|
||||
if (!(event.buttons() & MouseButton::Left) || m_selection.is_empty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue