MCPcopy Create free account
hub / github.com/TankOs/SFGUI / IsVerticalScrollbarVisible

Method IsVerticalScrollbarVisible

src/SFGUI/ScrolledWindow.cpp:106–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106bool ScrolledWindow::IsVerticalScrollbarVisible() const {
107 if( m_policy & VERTICAL_ALWAYS ) {
108 return true;
109 }
110
111 if( m_policy & VERTICAL_NEVER ) {
112 return false;
113 }
114
115 // If we get here Scrollbar is set to Automatic
116
117 auto adjustment = m_vertical_scrollbar->GetAdjustment();
118 auto value_range = adjustment->GetUpper() - adjustment->GetLower() - adjustment->GetPageSize();
119
120 if( value_range <= .0f ) {
121 // Nothing to scroll
122 return false;
123 }
124
125 return true;
126}
127
128const sf::FloatRect& ScrolledWindow::GetContentAllocation() const {
129 return m_content_allocation;

Callers

nothing calls this directly

Calls 4

GetUpperMethod · 0.80
GetLowerMethod · 0.80
GetPageSizeMethod · 0.80
GetAdjustmentMethod · 0.45

Tested by

no test coverage detected