Skip to content

Commit

Permalink
fix: item is hidden partially in settingsdialog (#344)
Browse files Browse the repository at this point in the history
need to hide the wrap widget which contains item widgets

Issue: linuxdeepin/developer-center#8664
  • Loading branch information
FeiWang1119 authored May 21, 2024
1 parent 1aded42 commit 90905b0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit 90905b0

Please sign in to comment.