checkable FListViewItem now shows the input cursor

This commit is contained in:
Markus Gans 2018-11-18 22:48:55 +01:00
parent 3953dc19fa
commit 2cb08ce928
1 changed files with 10 additions and 1 deletions

View File

@ -1663,13 +1663,19 @@ void FListView::drawList()
{ {
bool is_current_line = bool( iter == current_iter ); bool is_current_line = bool( iter == current_iter );
const FListViewItem* item = static_cast<FListViewItem*>(*iter); const FListViewItem* item = static_cast<FListViewItem*>(*iter);
int tree_offset = ( tree_view ) ? int(item->getDepth() << 1) + 1 : 0;
int checkbox_offset = ( item->isCheckable() ) ? 1 : 0;
setPrintPos (2, 2 + int(y)); setPrintPos (2, 2 + int(y));
// Draw one FListViewItem // Draw one FListViewItem
drawListLine (item, flags.focus, is_current_line); drawListLine (item, flags.focus, is_current_line);
if ( flags.focus && is_current_line ) if ( flags.focus && is_current_line )
setCursorPos (3, 2 + int(y)); // first character {
setVisibleCursor (item->isCheckable());
setCursorPos ( 3 + tree_offset + checkbox_offset - xoffset
, 2 + int(y)); // first character
}
last_visible_line = iter; last_visible_line = iter;
y++; y++;
@ -1679,6 +1685,9 @@ void FListView::drawList()
// Reset color // Reset color
setColor(); setColor();
if ( isMonochron() )
setReverse(true);
// Clean empty space after last element // Clean empty space after last element
while ( y < uInt(getClientHeight()) ) while ( y < uInt(getClientHeight()) )
{ {