🆕 Width of scrollbars in ScrollablePanel can now be changed
parent
d85429c268
commit
f93a3d4bf0
|
@ -183,6 +183,22 @@ namespace tgui
|
|||
Vector2f getContentOffset() const;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Channges the width of the scrollbars
|
||||
///
|
||||
/// @param width Scrollbar width
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void setScrollbarWidth(float width);
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Returns the width of the scrollbars
|
||||
///
|
||||
/// @return Scrollbar width
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
float getScrollbarWidth() const;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// @internal
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -288,6 +288,22 @@ namespace tgui
|
|||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ScrollablePanel::setScrollbarWidth(float width)
|
||||
{
|
||||
m_verticalScrollbar.setSize({width, m_verticalScrollbar.getSize().y});
|
||||
m_horizontalScrollbar.setSize({m_horizontalScrollbar.getSize().x, width});
|
||||
updateScrollbars();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
float ScrollablePanel::getScrollbarWidth() const
|
||||
{
|
||||
return m_verticalScrollbar.getSize().x;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ScrollablePanel::leftMousePressed(Vector2f pos)
|
||||
{
|
||||
m_mouseDown = true;
|
||||
|
|
|
@ -78,6 +78,12 @@ TEST_CASE("[ScrollablePanel]")
|
|||
}
|
||||
}
|
||||
|
||||
SECTION("ScrollbarWidth")
|
||||
{
|
||||
panel->setScrollbarWidth(25);
|
||||
REQUIRE(panel->getScrollbarWidth() == 25);
|
||||
}
|
||||
|
||||
SECTION("Events / Signals")
|
||||
{
|
||||
unsigned int mousePressedCount = 0;
|
||||
|
|
Loading…
Reference in New Issue