diff --git a/ChangeLog b/ChangeLog index 0348a3bd..6f17285e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2019-06-02 Markus Gans + * Avoid drawing the scroll bars if the widget is non-visible + 2019-05-27 Markus Gans * Use the Singleton design pattern to get a single object instance via FTerm @@ -120,7 +123,7 @@ the switch statement with a vector of lambda expressions 2018-12-09 Markus Gans - * Better handling of the scrollbar maximum + * Better handling of the scroll bar maximum * Deactivate copy constructor and assignment operator with "= delete" * Use nullptr instead of 0 to initialize a pointer values @@ -136,7 +139,7 @@ * Fix compile in optimization level 2 for newer gcc 2018-11-27 Markus Gans - * Correct vertical scrollbar position after sorting in FListView + * Correct vertical scroll bar position after sorting in FListView 2018-11-25 Markus Gans * Version 0.5.0 diff --git a/src/flistbox.cpp b/src/flistbox.cpp index ef8438ad..3589f6e4 100644 --- a/src/flistbox.cpp +++ b/src/flistbox.cpp @@ -737,15 +737,18 @@ void FListBox::adjustSize() hbar->setWidth (width + nf_offset, false); hbar->resize(); - if ( isHorizontallyScrollable() ) - hbar->show(); - else - hbar->hide(); + if ( isShown() ) + { + if ( isHorizontallyScrollable() ) + hbar->show(); + else + hbar->hide(); - if ( isVerticallyScrollable() ) - vbar->show(); - else - vbar->hide(); + if ( isVerticallyScrollable() ) + vbar->show(); + else + vbar->hide(); + } } @@ -1180,10 +1183,13 @@ void FListBox::recalculateHorizontalBar (std::size_t len, bool has_brackets) hbar->setPageSize (int(max_line_width), int(getWidth() - nf_offset - 4)); hbar->calculateSliderValues(); - if ( isHorizontallyScrollable() ) - hbar->show(); - else - hbar->hide(); + if ( isShown() ) + { + if ( isHorizontallyScrollable() ) + hbar->show(); + else + hbar->hide(); + } } } @@ -1197,10 +1203,13 @@ void FListBox::recalculateVerticalBar (std::size_t element_count) vbar->setPageSize (int(element_count), int(getHeight()) - 2); vbar->calculateSliderValues(); - if ( isVerticallyScrollable() ) - vbar->show(); - else - vbar->hide(); + if ( isShown() ) + { + if ( isVerticallyScrollable() ) + vbar->show(); + else + vbar->hide(); + } } //---------------------------------------------------------------------- diff --git a/src/flistview.cpp b/src/flistview.cpp index d2385af5..09a6b7dc 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -1361,15 +1361,18 @@ void FListView::adjustSize() hbar->setWidth (width, false); hbar->resize(); - if ( isHorizontallyScrollable() ) - hbar->show(); - else - hbar->hide(); + if ( isShown() ) + { + if ( isHorizontallyScrollable() ) + hbar->show(); + else + hbar->hide(); - if ( isVerticallyScrollable() ) - vbar->show(); - else - vbar->hide(); + if ( isVerticallyScrollable() ) + vbar->show(); + else + vbar->hide(); + } } @@ -1966,10 +1969,13 @@ void FListView::recalculateHorizontalBar (std::size_t len) hbar->setPageSize (int(max_line_width), int(getWidth() - nf_offset) - 4); hbar->calculateSliderValues(); - if ( isHorizontallyScrollable() ) - hbar->show(); - else - hbar->hide(); + if ( isShown() ) + { + if ( isHorizontallyScrollable() ) + hbar->show(); + else + hbar->hide(); + } } } @@ -1983,10 +1989,13 @@ void FListView::recalculateVerticalBar (std::size_t element_count) vbar->setPageSize (int(element_count), int(getHeight()) - 2); vbar->calculateSliderValues(); - if ( isVerticallyScrollable() ) - vbar->show(); - else - vbar->hide(); + if ( isShown() ) + { + if ( isVerticallyScrollable() ) + vbar->show(); + else + vbar->hide(); + } } //---------------------------------------------------------------------- diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index d7633d48..5d080512 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -814,6 +814,9 @@ void FScrollView::calculateScrollbarPos() //---------------------------------------------------------------------- void FScrollView::setHorizontalScrollBarVisibility() { + if ( ! isShown() ) + return; + switch ( hMode ) { case fc::Auto: @@ -836,6 +839,9 @@ void FScrollView::setHorizontalScrollBarVisibility() //---------------------------------------------------------------------- void FScrollView::setVerticalScrollBarVisibility() { + if ( ! isShown() ) + return; + switch ( vMode ) { case fc::Auto: diff --git a/src/ftermdebugdata.cpp b/src/ftermdebugdata.cpp index bd5424ee..44014157 100644 --- a/src/ftermdebugdata.cpp +++ b/src/ftermdebugdata.cpp @@ -27,7 +27,7 @@ namespace finalcut { - + #if DEBUG // static class attributes FTermData* FTermDebugData::data = nullptr; diff --git a/src/ftermlinux.cpp b/src/ftermlinux.cpp index fce78caa..134691ad 100644 --- a/src/ftermlinux.cpp +++ b/src/ftermlinux.cpp @@ -1237,13 +1237,15 @@ inline void FTermLinux::initSpecialCharacter() //---------------------------------------------------------------------- sInt16 FTermLinux::getFontPos (wchar_t ucs) { + constexpr sInt16 NOT_FOUND = -1; + for (std::size_t n = 0; n < screen_unicode_map.entry_ct; n++) { if ( screen_unicode_map.entries[n].unicode == ucs ) return sInt16(screen_unicode_map.entries[n].fontpos); } - return -1; + return NOT_FOUND; } //----------------------------------------------------------------------