summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylesheetstyle.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-11-23 17:05:05 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-11-29 16:02:28 +0100
commit56da533b45e2785e8fd54ef6fcddb7b973c665bf (patch)
treefd346c37a3ca2a8ca35ade168d76cf082ba21baa /src/widgets/styles/qstylesheetstyle.cpp
parent8fbedf2196a292fe2affcf83ddc846b9c852772a (diff)
Never handle scrollbars styled with box or border changes as transient
If scrollbars are styled with a style sheet that includes a box or removes off the native border, then we never treat them as transient or overlapping. Otherwise, the layout logic in QAbstractScrollArea will show them on top of the viewport, overlapping the content. Add case to the style sheet test baseline test. It's a test for scrollbars in a scroll area, rather than a test for the styling of the scrollbars themselves. Fixes: QTBUG-98289 Pick-to: 6.2 Change-Id: Ic53ad248b3eedd54722ac7b2fe5256a27092dbc1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 0784f61747..1449def8c5 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -5065,8 +5065,14 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const
if (!rule.hasNativeBorder() || rule.hasBox())
return 0;
break;
+
+ case PM_ScrollView_ScrollBarOverlap:
+ if (!rule.hasNativeBorder() || rule.hasBox())
+ return 0;
+ break;
#endif // QT_CONFIG(scrollbar)
+
case PM_ProgressBarChunkWidth:
subRule = renderRule(w, opt, PseudoElement_ProgressBarChunk);
if (subRule.hasContentsSize()) {
@@ -5659,6 +5665,10 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
case SH_ItemView_PaintAlternatingRowColorsForEmptyArea: s = QLatin1String("paint-alternating-row-colors-for-empty-area"); break;
case SH_TitleBar_ShowToolTipsOnButtons: s = QLatin1String("titlebar-show-tooltips-on-buttons"); break;
case SH_Widget_Animation_Duration: s = QLatin1String("widget-animation-duration"); break;
+ case SH_ScrollBar_Transient:
+ if (!rule.hasNativeBorder() || rule.hasBox())
+ return 0;
+ break;
default: break;
}
if (!s.isEmpty() && rule.hasStyleHint(s)) {