| 104 | } |
| 105 | |
| 106 | bool 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 | |
| 128 | const sf::FloatRect& ScrolledWindow::GetContentAllocation() const { |
| 129 | return m_content_allocation; |
nothing calls this directly
no test coverage detected