diff options
| author | Mikaƫl Capelle <capelle.mikael@gmail.com> | 2021-01-11 12:49:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-11 12:49:42 +0100 |
| commit | 1dc2b225485a073d82e08a9820493086b2dda8b8 (patch) | |
| tree | 5a4e5478d577f065c7282cb62992c2b6c735e13f /src/moapplication.cpp | |
| parent | a680dfa3e94b34bf6b0ebd65d29d7a9799e3183f (diff) | |
| parent | 05efc74e402ca3770d9fdaa2557f4030c31ee198 (diff) | |
Merge pull request #1350 from Holt59/collapsible-separators
Collapsible separators - Fix & Improvements.
Diffstat (limited to 'src/moapplication.cpp')
| -rw-r--r-- | src/moapplication.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/moapplication.cpp b/src/moapplication.cpp index 709bcbda..9a77c17e 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<const QTreeView*>(widget)) {
@@ -92,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);
|
