aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-05-10 20:00:43 +0800
committercrupest <crupest@outlook.com>2021-05-10 20:00:43 +0800
commit32e7c37fdf831de5b3c7f2acbbadd697989f0fab (patch)
tree02b297c7b7cdb5f38c606f542e55c77f3f6679cb /include
parent43a1883ac80ce3ff4782cd74e5ad16a03887c2aa (diff)
downloadcru-32e7c37fdf831de5b3c7f2acbbadd697989f0fab.tar.gz
cru-32e7c37fdf831de5b3c7f2acbbadd697989f0fab.tar.bz2
cru-32e7c37fdf831de5b3c7f2acbbadd697989f0fab.zip
...
Diffstat (limited to 'include')
-rw-r--r--include/cru/ui/render/ScrollBar.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/cru/ui/render/ScrollBar.hpp b/include/cru/ui/render/ScrollBar.hpp
index 8f18c821..a271ae71 100644
--- a/include/cru/ui/render/ScrollBar.hpp
+++ b/include/cru/ui/render/ScrollBar.hpp
@@ -104,6 +104,9 @@ class ScrollBar : public Object {
virtual float CalculateNewScrollPosition(const Rect& thumb_original_rect,
const Point& mouse_offset) = 0;
+ virtual bool CanScrollUp() = 0;
+ virtual bool CanScrollDown() = 0;
+
private:
void SetCursor();
void RestoreCursor();
@@ -113,6 +116,8 @@ class ScrollBar : public Object {
void OnMouseLeave();
+ ScrollBarBrushStateKind GetState(ScrollBarAreaKind area);
+
protected:
gsl::not_null<ScrollRenderObject*> render_object_;
@@ -135,6 +140,9 @@ class ScrollBar : public Object {
Rect move_thumb_thumb_original_rect_;
std::optional<Point> move_thumb_start_;
+ std::optional<ScrollBarAreaKind> mouse_hover_;
+ std::optional<ScrollBarAreaKind> mouse_press_;
+
EventRevokerListGuard event_guard_;
Event<Scroll> scroll_attempt_event_;
@@ -172,6 +180,9 @@ class HorizontalScrollBar : public ScrollBar {
float CalculateNewScrollPosition(const Rect& thumb_original_rect,
const Point& mouse_offset) override;
+
+ bool CanScrollUp() override;
+ bool CanScrollDown() override;
};
class VerticalScrollBar : public ScrollBar {
@@ -201,6 +212,9 @@ class VerticalScrollBar : public ScrollBar {
float CalculateNewScrollPosition(const Rect& thumb_original_rect,
const Point& mouse_offset) override;
+
+ bool CanScrollUp() override;
+ bool CanScrollDown() override;
};
// A delegate to draw scrollbar and register related events.