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

Method IsHorizontalScrollbarVisible

src/SFGUI/ScrolledWindow.cpp:84–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84bool ScrolledWindow::IsHorizontalScrollbarVisible() const {
85 if( m_policy & HORIZONTAL_ALWAYS ) {
86 return true;
87 }
88
89 if( m_policy & HORIZONTAL_NEVER ) {
90 return false;
91 }
92
93 // If we get here Scrollbar is set to Automatic
94
95 auto adjustment = m_horizontal_scrollbar->GetAdjustment();
96 auto value_range = adjustment->GetUpper() - adjustment->GetLower() - adjustment->GetPageSize();
97
98 if( value_range <= .0f ) {
99 // Nothing to scroll
100 return false;
101 }
102
103 return true;
104}
105
106bool ScrolledWindow::IsVerticalScrollbarVisible() const {
107 if( m_policy & VERTICAL_ALWAYS ) {

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