mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
GScrollBar: Keep scrolling while pushing down increment/decrement button.
This commit is contained in:
parent
0ece5fee14
commit
164742f316
2 changed files with 53 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Function.h>
|
||||
#include <LibCore/CTimer.h>
|
||||
#include <LibGUI/GWidget.h>
|
||||
|
||||
class GScrollBar final : public GWidget {
|
||||
|
@ -55,6 +56,8 @@ private:
|
|||
Rect scrubber_rect() const;
|
||||
int scrubber_size() const;
|
||||
int scrubbable_range_in_pixels() const;
|
||||
void on_automatic_scrolling_timer_fired();
|
||||
void set_automatic_scrolling_active(bool);
|
||||
|
||||
int m_min { 0 };
|
||||
int m_max { 0 };
|
||||
|
@ -68,4 +71,14 @@ private:
|
|||
|
||||
Orientation m_orientation { Orientation::Vertical };
|
||||
Component m_hovered_component { Component::Invalid };
|
||||
|
||||
enum class AutomaticScrollingDirection
|
||||
{
|
||||
None = 0,
|
||||
Decrement,
|
||||
Increment,
|
||||
};
|
||||
|
||||
AutomaticScrollingDirection m_automatic_scrolling_direction { AutomaticScrollingDirection::None };
|
||||
CTimer m_automatic_scrolling_timer;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue