From 8872cefb2a8149b0bd4557bf1a696bbb03dcbd78 Mon Sep 17 00:00:00 2001 From: wangfei Date: Tue, 21 May 2024 14:56:07 +0800 Subject: [PATCH] fix: item is hidden partially in settingsdialog need to hide the wrap widget which contains item widgets Issue: https://github.com/linuxdeepin/developer-center/issues/8664 --- src/main/service.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/service.cpp b/src/main/service.cpp index 653282abe..892e97c75 100644 --- a/src/main/service.cpp +++ b/src/main/service.cpp @@ -142,6 +142,10 @@ void Service::showHideOpacityAndBlurOptions(bool isShow) if (QObject::tr("Blur background") == checkText) { QWidget *optionWidget = widget; QWidget *parentWidget = widget->parentWidget(); + QWidget *wrapWidget = parentWidget ? parentWidget->parentWidget() : nullptr; + if (wrapWidget && strcmp(wrapWidget->metaObject()->className(), "QWidget") == 0) { + wrapWidget->setVisible(isShow); + } if (parentWidget && strcmp(parentWidget->metaObject()->className(), "Dtk::Widget::DFrame") == 0) optionWidget = parentWidget; @@ -153,6 +157,10 @@ void Service::showHideOpacityAndBlurOptions(bool isShow) } else if (strcmp(widget->metaObject()->className(), "Dtk::Widget::DSlider") == 0) { QWidget *optionWidget = widget; QWidget *parentWidget = widget->parentWidget(); + QWidget *wrapWidget = parentWidget ? parentWidget->parentWidget() : nullptr; + if (wrapWidget && strcmp(wrapWidget->metaObject()->className(), "QWidget") == 0) { + wrapWidget->setVisible(isShow); + } if (parentWidget && strcmp(parentWidget->metaObject()->className(), "Dtk::Widget::DFrame") == 0) optionWidget = parentWidget; @@ -165,6 +173,11 @@ void Service::showHideOpacityAndBlurOptions(bool isShow) if (lblText == QObject::tr("Opacity")) { QWidget *optionWidget = widget; QWidget *parentWidget = widget->parentWidget(); + QWidget *wrapWidget = parentWidget ? parentWidget->parentWidget() : nullptr; + if (wrapWidget && strcmp(wrapWidget->metaObject()->className(), "QWidget") == 0) { + wrapWidget->setVisible(isShow); + } + if (parentWidget && strcmp(parentWidget->metaObject()->className(), "Dtk::Widget::DFrame") == 0) optionWidget = parentWidget;