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 2408780
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 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)));
});

w->setAttribute(Qt::WA_TranslucentBackground);
connect(DWindowManagerHelper::instance(), SIGNAL(hasCompositeChanged()), w, SLOT(update()));
}
Expand Down

0 comments on commit 2408780

Please sign in to comment.