18#include <AUI/Util/ALayoutDirection.h>
19#include <AUI/Common/ATimer.h>
20#include "AViewContainer.h"
21#include "ASpacerExpanding.h"
33 int mScrollOffset = 0;
34 bool mDragging =
false;
37 void setSize(glm::ivec2 size)
override;
41 void setOverridenSize(
int overridenSize) {
42 mOverridenSize = overridenSize;
58 int getMinimumWidth()
override {
62 int getMinimumHeight()
override {
77 explicit AScrollbar(ALayoutDirection direction = ALayoutDirection::VERTICAL);
79 [[nodiscard]]
int getCurrentScroll()
const {
80 return mCurrentScroll;
83 void setScrollDimensions(
size_t viewportSize,
size_t fullSize);
84 void updateScrollHandleSize();
85 void setScroll(
int scroll);
87 void scroll(
int delta)
noexcept {
88 setScroll(mCurrentScroll + delta);
104 mStickToEnd = StickToEnd{
114 mAppearance = appearance;
117 void scrollToStart() {
123 float getAvailableSpaceForSpacer();
125 void updateScrollHandleOffset(
int max);
129 void setSize(glm::ivec2 size)
override;
141 if (mFullSize <= mViewportSize) {
145 return mFullSize - mViewportSize;
157 ALayoutDirection mDirection;
163 size_t mViewportSize = 0, mFullSize = 0;
164 int mCurrentScroll = 0;
166 void setOffset(
size_t o);
168 void scrollForward();
169 void scrollBackward();
171 void handleScrollbar(
int s);
Utility wrapper implementing the stack-allocated (fast) optional idiom.
Definition: AOptional.h:32
Expanding view which is useful in UI building.
Definition: ASpacerExpanding.h:28
A view that represents a set of views.
Definition: AViewContainerBase.h:68
void onPointerPressed(const APointerPressedEvent &event) override
Called on pointer (mouse) released event.
Definition: AViewContainerBase.cpp:287
void onScroll(const AScrollEvent &event) override
Definition: AViewContainerBase.cpp:359
Base class of all UI objects.
Definition: AView.h:77
emits< glm::ivec2 > scrolled
Scroll event.
Definition: AView.h:1103
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
Pointing method move event.
Definition: APointerMoveEvent.h:21
Pointing method press event.
Definition: APointerPressedEvent.h:21
Pointing method press event.
Definition: APointerReleasedEvent.h:19