From 098ea31a1d848205ffc2a801432b2717aa876d97 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sun, 3 Jan 2021 01:50:45 +0100 Subject: Update documentation for drawBranches. --- src/modlistview.cpp | 6 ++++++ src/modlistview.h | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/modlistview.cpp b/src/modlistview.cpp index c2942717..bc6b5a65 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -855,6 +855,12 @@ QRect ModListView::visualRect(const QModelIndex& index) const void ModListView::drawBranches(QPainter* painter, const QRect& rect, const QModelIndex& index) const { + // the branches are the small indicator left to the row (there are none in the default style, and + // the VS dark style only has background for these) + // + // the branches are not shifted left with the visualRect() change and since MO2 uses stylesheet, + // it is not possible to shift those in the proxy style so we have to shift it here. + // QRect r(rect); if (hasCollapsibleSeparators() && index.parent().isValid()) { r.adjust(-indentation(), 0, 0 -indentation(), 0); diff --git a/src/modlistview.h b/src/modlistview.h index b7d641ea..2aa48140 100644 --- a/src/modlistview.h +++ b/src/modlistview.h @@ -85,10 +85,6 @@ public: bool isModVisible(unsigned int index) const; bool isModVisible(ModInfo::Ptr mod) const; - // re-implemented to fix indentation with collapsible separators - // - QRect visualRect(const QModelIndex& index) const override; - // refresh the view (to call when settings have been changed) // void refresh(); @@ -155,6 +151,9 @@ protected: bool toggleSelectionState(); bool copySelection(); + // re-implemented to fix indentation with collapsible separators + // + QRect visualRect(const QModelIndex& index) const override; void drawBranches(QPainter* painter, const QRect& rect, const QModelIndex& index) const override; void timerEvent(QTimerEvent* event) override; -- cgit v1.3.1