diff --git a/src/dplatformhandle.cpp b/src/dplatformhandle.cpp index a582a48e..83eec326 100644 --- a/src/dplatformhandle.cpp +++ b/src/dplatformhandle.cpp @@ -549,10 +549,7 @@ static void initWindowRadius(QWindow *window) return; auto theme = DGuiApplicationHelper::instance()->windowTheme(window); - int radius = theme->windowRadius(); - - if (radius == -1) - radius =theme->windowRadius(18); //###(zccrs): 暂时在此处给窗口默认设置为18px的圆角 + int radius = theme->windowRadius(18); //###(zccrs): 暂时在此处给窗口默认设置为18px的圆角 setWindowProperty(window, _windowRadius, radius); window->connect(theme, &DPlatformTheme::windowRadiusChanged, window, [=] (int radius) { diff --git a/src/dplatformtheme.cpp b/src/dplatformtheme.cpp index e2da4773..870949f4 100644 --- a/src/dplatformtheme.cpp +++ b/src/dplatformtheme.cpp @@ -391,8 +391,15 @@ int DPlatformTheme::windowRadius() const int DPlatformTheme::windowRadius(int defaultValue) const { + Q_D(const DPlatformTheme); + + QVariant value = d->theme->getSetting(QByteArrayLiteral("DTK/WindowRadius")); bool ok = false; - int radius = this->property("windowRadius").toInt(&ok); + + if (d->fallbackProperty && !value.isValid() && d->parent) + return d->parent->windowRadius(defaultValue); + + int radius = value.toInt(&ok); return ok ? radius : defaultValue; }