Skip to content

Commit

Permalink
chore: check platformtheme is valid when set menu windowradius
Browse files Browse the repository at this point in the history
if theme is not valid the windowradius is invalid too
  • Loading branch information
kegechen committed Jan 22, 2024
1 parent b020f02 commit 72cd28c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions styleplugins/chameleon/chameleonstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
Expand Down

0 comments on commit 72cd28c

Please sign in to comment.