| 539 | } |
| 540 | |
| 541 | void Notebook::HandleUpdate( float seconds ) { |
| 542 | Container::HandleUpdate( seconds ); |
| 543 | |
| 544 | float scroll_speed( Context::Get().GetEngine().GetProperty<float>( "ScrollSpeed", shared_from_this() ) ); |
| 545 | |
| 546 | m_elapsed_time += seconds; |
| 547 | |
| 548 | if( m_elapsed_time < ( 1.f / scroll_speed ) ) { |
| 549 | return; |
| 550 | } |
| 551 | |
| 552 | m_elapsed_time -= ( 1.f / scroll_speed ); |
| 553 | |
| 554 | if( IsScrollingForward() ) { |
| 555 | m_first_tab = std::min( m_first_tab + 1, GetPageCount() - GetDisplayedTabCount() ); |
| 556 | RecalculateSize(); |
| 557 | } |
| 558 | else if( IsScrollingBackward() ) { |
| 559 | m_first_tab = std::max( m_first_tab - 1, 0 ); |
| 560 | RecalculateSize(); |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | void Notebook::RecalculateSize() { |
| 565 | if( !IsGloballyVisible() ) { |
nothing calls this directly
no outgoing calls
no test coverage detected