From c06d28e3a388d53543897c7fcafe3ed3507dce78 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Thu, 7 Jan 2021 21:57:47 +0100 Subject: Tentative fix for drop indicator appearance at the top of the mod list. --- src/moapplication.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/moapplication.cpp') diff --git a/src/moapplication.cpp b/src/moapplication.cpp index 709bcbda..9de54f2f 100644 --- a/src/moapplication.cpp +++ b/src/moapplication.cpp @@ -65,9 +65,19 @@ public: { } - void drawPrimitive(PrimitiveElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget) const { + void drawPrimitive( + PrimitiveElement element, const QStyleOption* option, + QPainter* painter, const QWidget* widget) const override + { if (element == QStyle::PE_IndicatorItemViewItemDrop) { + // 0. Fix a bug that made the drop indicator sometimes appear on top + // of the mod list when selecting a mod. + if (option->rect.height() == 0 + && option->rect.bottomRight() == QPoint(-1, -1)) { + return; + } + // 1. full-width drop indicator QRect rect(option->rect); if (auto* view = qobject_cast(widget)) { -- cgit v1.3.1 From 5bb48d5e525660ba408d586226754a0f00326bb5 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Sun, 10 Jan 2021 19:29:18 +0100 Subject: Small clean. --- src/moapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/moapplication.cpp') diff --git a/src/moapplication.cpp b/src/moapplication.cpp index 9de54f2f..9a77c17e 100644 --- a/src/moapplication.cpp +++ b/src/moapplication.cpp @@ -102,7 +102,7 @@ public: rect.topLeft() + QPoint(-5, -5) }; painter->drawPolygon(tri, 3); - painter->drawLine(QPoint(rect.topLeft().x(), rect.topLeft().y()), rect.topRight()); + painter->drawLine(rect.topLeft(), rect.topRight()); } else { painter->drawRoundedRect(rect, 5, 5); -- cgit v1.3.1