summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qfusionstyle.cpp
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2020-12-23 22:21:08 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2021-01-29 06:26:55 +0000
commit180c662b0790c6eceffdcb4661681d7df1541a2d (patch)
treeef449dbbca65a8382d1281a801960f767aa0a27b /src/widgets/styles/qfusionstyle.cpp
parent693aa08ddf6afc236ecd1844690158f02ba46dd4 (diff)
QHeaderView: Mark the drop section during section move
Currently there is no visual feedback where the section move will end up. Therefore mark the drop section to show where the dragged section will be inserted. Fixes: QTBUG-673 Fixes: QTBUG-1114 Change-Id: I3e45a9a9c0604342bb0286fc7cd4c89c757c28cd Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/styles/qfusionstyle.cpp')
-rw-r--r--src/widgets/styles/qfusionstyle.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index b8044dbc09..d2eb5e25cc 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -1283,6 +1283,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
QString pixmapName = QStyleHelper::uniqueName(QLatin1String("headersection"), option, option->rect.size());
pixmapName += QString::number(- int(header->position));
pixmapName += QString::number(- int(header->orientation));
+ pixmapName += QString::number(- int(header->isSectionDragTarget));
QPixmap cache;
if (!QPixmapCache::find(pixmapName, &cache)) {
@@ -1291,9 +1292,12 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
QRect pixmapRect(0, 0, rect.width(), rect.height());
QPainter cachePainter(&cache);
QColor buttonColor = d->buttonColor(option->palette);
- QColor gradientStopColor;
QColor gradientStartColor = buttonColor.lighter(104);
- gradientStopColor = buttonColor.darker(102);
+ QColor gradientStopColor = buttonColor.darker(102);
+ if (header->isSectionDragTarget) {
+ gradientStopColor = gradientStartColor.darker(130);
+ gradientStartColor = gradientStartColor.darker(130);
+ }
QLinearGradient gradient(pixmapRect.topLeft(), pixmapRect.bottomLeft());
if (option->palette.window().gradient()) {