aboutsummaryrefslogtreecommitdiff
path: root/src/components/Scrollbar.hpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-06-07 18:42:50 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2023-06-07 18:42:50 +0200
commit7d753ae2d82592e09e04e4ecf11df976a2d187fd (patch)
tree4bee36d2432bef8793c366c96e4a7a5ed905df06 /src/components/Scrollbar.hpp
parent3594a12bb4a4bc8724a6c3d592487a66f586df20 (diff)
Debug and improve focus and scrollbars codeHEADmaster
Diffstat (limited to 'src/components/Scrollbar.hpp')
-rw-r--r--src/components/Scrollbar.hpp12
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