From 8c976c231b947355beb6b032eb8c9784c7e7eec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sat, 10 Jun 2023 15:01:47 +0200 Subject: [PATCH] [qt5] Added scrollbars_style.patch that aims to fix https://github.com/mixxxdj/mixxx/issues/9495 --- .../qt5-base/patches/scrollbars_style.patch | 53 +++++++++++++++++++ overlay/osx/qt5-base/portfile.cmake | 1 + overlay/osx/qt5-base/vcpkg.json | 2 +- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 overlay/osx/qt5-base/patches/scrollbars_style.patch diff --git a/overlay/osx/qt5-base/patches/scrollbars_style.patch b/overlay/osx/qt5-base/patches/scrollbars_style.patch new file mode 100644 index 00000000000000..3b185eb77442e4 --- /dev/null +++ b/overlay/osx/qt5-base/patches/scrollbars_style.patch @@ -0,0 +1,53 @@ +From e0f8cad075e0688e7e88d42eefbaa000b2636e2f Mon Sep 17 00:00:00 2001 +From: Volker Hilsheimer +Date: Tue, 23 Nov 2021 17:05:05 +0100 +Subject: [PATCH] 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. + +The cherry-pick doesn't include the base line test from the upstream +change, as the testing framework is not available in 6.2. + +Fixes: QTBUG-98289 +Change-Id: Ic53ad248b3eedd54722ac7b2fe5256a27092dbc1 +Reviewed-by: Richard Moe Gustavsen +(cherry picked from commit 56da533b45e2785e8fd54ef6fcddb7b973c665bf) +Reviewed-by: Volker Hilsheimer +--- + src/widgets/styles/qstylesheetstyle.cpp | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp +index c2c9cc9fd7e..efa79789a8e 100644 +--- a/src/widgets/styles/qstylesheetstyle.cpp ++++ b/src/widgets/styles/qstylesheetstyle.cpp +@@ -5066,8 +5066,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()) { +@@ -5660,6 +5666,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)) { diff --git a/overlay/osx/qt5-base/portfile.cmake b/overlay/osx/qt5-base/portfile.cmake index 28b03ca8000149..3e0a68b8a041ee 100644 --- a/overlay/osx/qt5-base/portfile.cmake +++ b/overlay/osx/qt5-base/portfile.cmake @@ -38,6 +38,7 @@ qt_download_submodule( OUT_SOURCE_PATH SOURCE_PATH patches/arm64_qcocoahelper.patch # alow to build on arm64 patches/arm64_send_super_stret.patch # don't use qt_msgSendSuper_stret on arm64 patches/replace_result_of.patch # Replace usage of std::result_of with decltype + patches/scrollbars_style.patch # Never handle scrollbars styled with box or border changes as transient ) # Remove vendored dependencies to ensure they are not picked up by the build diff --git a/overlay/osx/qt5-base/vcpkg.json b/overlay/osx/qt5-base/vcpkg.json index e4cb192f2f29fd..cbf7edc21fcf54 100644 --- a/overlay/osx/qt5-base/vcpkg.json +++ b/overlay/osx/qt5-base/vcpkg.json @@ -1,7 +1,7 @@ { "name": "qt5-base", "version-semver": "5.12.5", - "port-version": 16, + "port-version": 17, "description": "Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.", "homepage": "https://www.qt.io/", "dependencies": [