SDK/ScrollAreaWidget: Add EnableScrollbar
This commit is contained in:
@@ -21,9 +21,15 @@ namespace Ndk
|
||||
ScrollAreaWidget(ScrollAreaWidget&&) = default;
|
||||
~ScrollAreaWidget() = default;
|
||||
|
||||
void EnableScrollbar(bool enable);
|
||||
|
||||
inline float GetScrollHeight() const;
|
||||
inline float GetScrollRatio() const;
|
||||
|
||||
inline bool HasScrollbar() const;
|
||||
inline bool IsScrollbarEnabled() const;
|
||||
inline bool IsScrollbarVisible() const;
|
||||
|
||||
inline void ScrollToHeight(float height);
|
||||
void ScrollToRatio(float ratio);
|
||||
|
||||
@@ -57,7 +63,8 @@ namespace Ndk
|
||||
Nz::SpriteRef m_scrollbarSprite;
|
||||
Nz::Vector2i m_grabbedDelta;
|
||||
ScrollBarStatus m_scrollbarStatus;
|
||||
bool m_isScrollBarVisible;
|
||||
bool m_isScrollbarEnabled;
|
||||
bool m_hasScrollbar;
|
||||
float m_scrollRatio;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,6 +16,21 @@ namespace Ndk
|
||||
return m_scrollRatio;
|
||||
}
|
||||
|
||||
inline bool ScrollAreaWidget::HasScrollbar() const
|
||||
{
|
||||
return m_hasScrollbar;
|
||||
}
|
||||
|
||||
inline bool ScrollAreaWidget::IsScrollbarEnabled() const
|
||||
{
|
||||
return m_isScrollbarEnabled;
|
||||
}
|
||||
|
||||
inline bool ScrollAreaWidget::IsScrollbarVisible() const
|
||||
{
|
||||
return HasScrollbar() && IsScrollbarEnabled();
|
||||
}
|
||||
|
||||
inline void ScrollAreaWidget::ScrollToHeight(float height)
|
||||
{
|
||||
float contentHeight = m_content->GetHeight();
|
||||
|
||||
Reference in New Issue
Block a user