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 authored and FeiWang1119 committed Mar 5, 2024
1 parent 25b6448 commit 2f74550
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion styleplugins/chameleon/chameleonstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4358,7 +4358,8 @@ 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)));
Expand Down

0 comments on commit 2f74550

Please sign in to comment.