From 1cb6011edb34bcb4eca79abddaea4888e65548a7 Mon Sep 17 00:00:00 2001 From: deepin-ci-robot Date: Mon, 22 Jan 2024 05:39:41 +0000 Subject: [PATCH] sync: from linuxdeepin/qt5integration Synchronize source files from linuxdeepin/qt5integration. Source-pull-request: https://github.com/linuxdeepin/qt5integration/pull/210 --- styleplugins/chameleon/chameleonstyle.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/styleplugins/chameleon/chameleonstyle.cpp b/styleplugins/chameleon/chameleonstyle.cpp index 6814613..8339585 100644 --- a/styleplugins/chameleon/chameleonstyle.cpp +++ b/styleplugins/chameleon/chameleonstyle.cpp @@ -4354,11 +4354,13 @@ void ChameleonStyle::polish(QWidget *w) handle.setEnableBlurWindow(true); DPlatformTheme *theme = DGuiApplicationHelper::instance()->applicationTheme(); - setWindowRadius(w, qMax(0, qMin(theme->windowRadius(), 18))); + if (theme->isValid()) { + setWindowRadius(w, qMax(0, qMin(theme->windowRadius(), 18))); + connect(theme, &DPlatformTheme::windowRadiusChanged, w, [w](int r){ + setWindowRadius(w, qMax(0, qMin(r, 18))); + }); + } - connect(theme, &DPlatformTheme::windowRadiusChanged, w, [w](int r){ - setWindowRadius(w, qMax(0, qMin(r, 18))); - }); w->setAttribute(Qt::WA_TranslucentBackground); connect(DWindowManagerHelper::instance(), SIGNAL(hasCompositeChanged()), w, SLOT(update())); }