From f7647b985b791959ecdfc9896a77fa51ac784f85 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sun, 3 Jan 2021 13:39:22 +0100 Subject: Fix ModListView::visualRect(). --- src/modlistview.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/modlistview.cpp') diff --git a/src/modlistview.cpp b/src/modlistview.cpp index 29c68165..e6d78bab 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -829,13 +829,10 @@ QRect ModListView::visualRect(const QModelIndex& index) const // this shift the visualRect() from QTreeView to match the new actual // zone after removing indentation (see the ModListStyledItemDelegated) QRect rect = QTreeView::visualRect(index); - if (hasCollapsibleSeparators()) { - if (index.isValid() && !index.model()->hasChildren(index) && index.parent().isValid()) { - auto parentIndex = index.parent().data(ModList::IndexRole).toInt(); - if (ModInfo::getByIndex(parentIndex)->isSeparator()) { - rect.adjust(-indentation(), 0, 0, 0); - } - } + if (hasCollapsibleSeparators() + && index.column() == 0 && index.isValid() + && index.parent().isValid()) { + rect.adjust(-indentation(), 0, 0, 0); } return rect; } -- cgit v1.3.1