summaryrefslogtreecommitdiff
path: root/src/icondelegate.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-01-01 13:51:36 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-02 15:38:19 +0100
commite5f43788e874e638e1d4dbab20451c36e52df10d (patch)
tree9191bae2dce4cb69bd9c5bfa0099a4f8981a50d1 /src/icondelegate.cpp
parentf36c68332019ec68a713b21519c0439039845fa1 (diff)
Visual fixes for the modlist.
- Fix invalid positions of markers in the scrollbar. - Use color from children for collapsed elements (background and markers).
Diffstat (limited to 'src/icondelegate.cpp')
-rw-r--r--src/icondelegate.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/icondelegate.cpp b/src/icondelegate.cpp
index 03964263..901b5731 100644
--- a/src/icondelegate.cpp
+++ b/src/icondelegate.cpp
@@ -27,7 +27,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
using namespace MOBase;
-IconDelegate::IconDelegate(QObject *parent)
+IconDelegate::IconDelegate(QObject* parent)
: QStyledItemDelegate(parent)
{
}
@@ -66,7 +66,12 @@ void IconDelegate::paintIcons(
void IconDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
- QStyledItemDelegate::paint(painter, option, index);
+ if (auto* w = qobject_cast<QAbstractItemView*>(parent())) {
+ w->itemDelegate()->paint(painter, option, index);
+ }
+ else {
+ QStyledItemDelegate::paint(painter, option, index);
+ }
paintIcons(painter, option, index, getIcons(index));
}