Fix collapse() and expand() in FListViewItem()

This commit is contained in:
Markus Gans 2020-02-11 00:29:58 +01:00
parent dd625e0822
commit 83a6ee497b
2 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,6 @@
2020-02-11 Markus Gans <guru.mail@muenster.de>
* Fix collapse() and expand() in FListViewItem()
2020-02-09 Markus Gans <guru.mail@muenster.de> 2020-02-09 Markus Gans <guru.mail@muenster.de>
* Adding a tty check for stdin * Adding a tty check for stdin
* An application structure diagram was added to the document * An application structure diagram was added to the document

View File

@ -372,6 +372,7 @@ void FListViewItem::expand()
if ( isExpand() || ! hasChildren() ) if ( isExpand() || ! hasChildren() )
return; return;
resetVisibleLineCounter();
is_expand = true; is_expand = true;
} }
@ -381,8 +382,8 @@ void FListViewItem::collapse()
if ( ! isExpand() ) if ( ! isExpand() )
return; return;
resetVisibleLineCounter();
is_expand = false; is_expand = false;
visible_lines = 1;
} }
// private methods of FListView // private methods of FListView
@ -434,11 +435,10 @@ std::size_t FListViewItem::getVisibleLines()
if ( visible_lines > 1 ) if ( visible_lines > 1 )
return visible_lines; return visible_lines;
visible_lines = 1;
if ( ! isExpand() || ! hasChildren() ) if ( ! isExpand() || ! hasChildren() )
{
visible_lines = 1;
return visible_lines; return visible_lines;
}
auto iter = FObject::begin(); auto iter = FObject::begin();
@ -2484,7 +2484,7 @@ inline void FListView::collapseAndScrollLeft()
{ {
// Collapse element // Collapse element
item->collapse(); item->collapse();
adjustScrollbars (getCount()); adjustSize();
vbar->calculateSliderValues(); vbar->calculateSliderValues();
// Force vertical scrollbar redraw // Force vertical scrollbar redraw
first_line_position_before = -1; first_line_position_before = -1;