diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-06-07 18:42:50 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-06-07 18:42:50 +0200 |
| commit | 7d753ae2d82592e09e04e4ecf11df976a2d187fd (patch) | |
| tree | 4bee36d2432bef8793c366c96e4a7a5ed905df06 /src/components/Scrollbar.hpp | |
| parent | 3594a12bb4a4bc8724a6c3d592487a66f586df20 (diff) | |
Diffstat (limited to 'src/components/Scrollbar.hpp')
| -rw-r--r-- | src/components/Scrollbar.hpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/components/Scrollbar.hpp b/src/components/Scrollbar.hpp index c313c69..5caba75 100644 --- a/src/components/Scrollbar.hpp +++ b/src/components/Scrollbar.hpp @@ -8,13 +8,19 @@ class Scrollbar : public Component { bool IsHorizontal; Element bg,bar; double DragY,DragX; + double FocusX,FocusY; + /// @brief Should focus be applied on the next draw + bool ShouldApplyFocus; + /// @brief Use to detect scrollbar drags bool Trigger; - /// @brief Canvas size cache used to reset on resize - double CanvasWidth, CanvasHeight; + /// @brief Goto a given graphical coordinate (if possible using current scroll range) + void ApplyFocus(); public: Scrollbar(Status* s,bool IsHorizontal); void Refresh(); - /// @brief Goto a given graphical coordinate (if possible using current scroll range) + /// @brief Focus on a coordinate on the next draw void Focus(double XorY); + /// @brief Undo all scroll operations, go back to the origin + void Reset(); }; } // namespace cgeditor
\ No newline at end of file |
