mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
GScrollBar: highlight the scrubber while it's in use.
Originally, it would stop being highlighted if the mouse was moved away from it, even while in use. Now it will stay highlighted for the duration of usage.
This commit is contained in:
parent
b07a315736
commit
feabe6ed31
Notes:
sideshowbarker
2024-07-19 17:45:21 +09:00
Author: https://github.com/ignas-sa 🔰
Commit: feabe6ed31
Pull-request: https://github.com/SerenityOS/serenity/pull/439
Reviewed-by: https://github.com/awesomekling ✅
2 changed files with 4 additions and 1 deletions
|
@ -208,7 +208,7 @@ void GScrollBar::paint_event(GPaintEvent& event)
|
|||
}
|
||||
|
||||
if (has_scrubber())
|
||||
StylePainter::paint_button(painter, scrubber_rect(), ButtonStyle::Normal, false, m_hovered_component == Component::Scrubber);
|
||||
StylePainter::paint_button(painter, scrubber_rect(), ButtonStyle::Normal, false, m_hovered_component == Component::Scrubber || m_scrubber_in_use);
|
||||
}
|
||||
|
||||
void GScrollBar::on_automatic_scrolling_timer_fired()
|
||||
|
@ -238,6 +238,7 @@ void GScrollBar::mousedown_event(GMouseEvent& event)
|
|||
return;
|
||||
}
|
||||
if (has_scrubber() && scrubber_rect().contains(event.position())) {
|
||||
m_scrubber_in_use = true;
|
||||
m_scrubbing = true;
|
||||
m_scrub_start_value = value();
|
||||
m_scrub_origin = event.position();
|
||||
|
@ -270,6 +271,7 @@ void GScrollBar::mouseup_event(GMouseEvent& event)
|
|||
{
|
||||
if (event.button() != GMouseButton::Left)
|
||||
return;
|
||||
m_scrubber_in_use = false;
|
||||
m_automatic_scrolling_direction = AutomaticScrollingDirection::None;
|
||||
set_automatic_scrolling_active(false);
|
||||
if (!m_scrubbing)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue