From 3b2a5995aa228bd5eb58da8ce48303e946da481a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Cie=C5=9Blak?= Date: Fri, 12 May 2023 13:50:13 +0200 Subject: [PATCH] fix(StatusDropdown): Add workaround for QTBUG-87804 The workaround has no known side-effects and it doesn't break any bindings. --- .../src/StatusQ/Controls/StatusDropdown.qml | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Controls/StatusDropdown.qml b/ui/StatusQ/src/StatusQ/Controls/StatusDropdown.qml index 72c43cbf1e..fb68abf440 100644 --- a/ui/StatusQ/src/StatusQ/Controls/StatusDropdown.qml +++ b/ui/StatusQ/src/StatusQ/Controls/StatusDropdown.qml @@ -1,6 +1,6 @@ -import QtQuick 2.13 -import QtGraphicalEffects 1.13 -import QtQuick.Controls 2.14 as QC +import QtQuick 2.15 +import QtGraphicalEffects 1.15 +import QtQuick.Controls 2.15 as QC import StatusQ.Core.Theme 0.1 @@ -28,16 +28,17 @@ import StatusQ.Core.Theme 0.1 For a list of components available see StatusQ. */ QC.Popup { + id: root + dim: false closePolicy: QC.Popup.CloseOnPressOutside | QC.Popup.CloseOnEscape background: Rectangle { - id: border color: Theme.palette.statusMenu.backgroundColor radius: 8 border.color: "transparent" layer.enabled: true layer.effect: DropShadow { - source: border + source: root.background horizontalOffset: 0 verticalOffset: 4 radius: 12 @@ -46,4 +47,21 @@ QC.Popup { color: Theme.palette.dropShadow } } + + // workaround for https://bugreports.qt.io/browse/QTBUG-87804 + Binding on margins{ + id: workaroundBinding + + when: false + } + + Connections { + target: root.contentItem + + function onImplicitHeightChanged() { + workaroundBinding.value = root.margins + 1 + workaroundBinding.when = true + workaroundBinding.when = false + } + } }