aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/render/ScrollBar.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui/render/ScrollBar.hpp')
-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.