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 1fd7936
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 @@ -4354,7 +4354,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 1fd7936

Please sign in to comment.