diff --git a/qt5-ukui-platformtheme/widget/filedialog/kyfiledialog.cpp b/qt5-ukui-platformtheme/widget/filedialog/kyfiledialog.cpp index 497180a..e0906fd 100644 --- a/qt5-ukui-platformtheme/widget/filedialog/kyfiledialog.cpp +++ b/qt5-ukui-platformtheme/widget/filedialog/kyfiledialog.cpp @@ -1684,8 +1684,18 @@ void KyNativeFileDialog::paintEvent(QPaintEvent *e) // sidebarPath.addRect(adjustedRect.adjusted(6, 0, 0, 0)); QPainter p(this); QPainterPath contentPath; - if(this && this->property("windowRadius").isValid()) - radius = this->property("windowRadius").toInt(); + + + if (UKUIStyleSettings::isSchemaInstalled("org.ukui.style")) { + auto settings = UKUIStyleSettings::globalInstance(); + if(settings->keys().contains("windowRadius")) + radius = settings->get("windowRadius").toInt(); + else if(this && this->property("maxRadius").isValid()) + radius = this->property("maxRadius").toInt(); + } + else if(this && this->property("maxRadius").isValid()) + radius = this->property("maxRadius").toInt(); + // qDebug() << "KyNativeFileDialog radius........" << radius; contentPath.addRoundedRect(this->rect(), radius, radius); auto bgPath = contentPath - sidebarPath; diff --git a/ukui-styles/blur-helper.cpp b/ukui-styles/blur-helper.cpp index 0ffe570..6348d56 100644 --- a/ukui-styles/blur-helper.cpp +++ b/ukui-styles/blur-helper.cpp @@ -282,8 +282,8 @@ void BlurHelper::delayUpdate(QWidget *w, bool updateBlurRegionOnly) } QPainterPath path; int radius = 8; - if(widget->property("windowRadius").isValid()) - radius = widget->property("windowRadius").toInt(); + if(widget->property("maxRadius").isValid()) + radius = widget->property("maxRadius").toInt(); path.addRoundedRect(widget->rect(), radius, radius); KWindowEffects::enableBlurBehind(widget->winId(), true, path.toFillPolygon().toPolygon()); if (!updateBlurRegionOnly) diff --git a/ukui-styles/qt5-config-style-ukui/config-shadow-helper.cpp b/ukui-styles/qt5-config-style-ukui/config-shadow-helper.cpp index e62526d..c586f7a 100644 --- a/ukui-styles/qt5-config-style-ukui/config-shadow-helper.cpp +++ b/ukui-styles/qt5-config-style-ukui/config-shadow-helper.cpp @@ -155,8 +155,8 @@ QPixmap ConfigShadowHelper::getShadowPixmap(QColor color, /*ConfigShadowHelper:: QPoint currentPos; int qAppMaxradius = maxRadius; - if(widget && widget->property("windowRadius").isValid()){ - qAppMaxradius = widget->property("windowRadius").toInt(); + if(widget && widget->property("maxRadius").isValid()){ + qAppMaxradius = widget->property("maxRadius").toInt(); // qDebug() << "radius...." << qAppMaxradius; } // move to top left arc start point @@ -259,8 +259,8 @@ QPainterPath ConfigShadowHelper::caculateRelativePainterPath(QWidget *widget, qr QPointF currentPos; int qAppMaxradius = maxRadius; - if(widget && widget->property("windowRadius").isValid()){ - qAppMaxradius = widget->property("windowRadius").toInt(); + if(widget && widget->property("maxRadius").isValid()){ + qAppMaxradius = widget->property("maxRadius").toInt(); //qDebug() << "radius...." << qAppMaxradius; } diff --git a/ukui-styles/qt5-config-style-ukui/themeconfig/classical.json b/ukui-styles/qt5-config-style-ukui/themeconfig/classical.json index c2d8a4a..443d8f7 100644 --- a/ukui-styles/qt5-config-style-ukui/themeconfig/classical.json +++ b/ukui-styles/qt5-config-style-ukui/themeconfig/classical.json @@ -1,6 +1,6 @@ { "Radius":{ - "Window_Radius" : {"value": "0", "type": "int"}, + "Max_Radius" : {"value": "0", "type": "int"}, "Normal_Radius" : {"value": "0", "type": "int"}, "Min_Radius" : {"value": "0", "type": "int"} }, diff --git a/ukui-styles/qt5-config-style-ukui/themeconfig/default.json b/ukui-styles/qt5-config-style-ukui/themeconfig/default.json index f72a3dc..ed9e456 100644 --- a/ukui-styles/qt5-config-style-ukui/themeconfig/default.json +++ b/ukui-styles/qt5-config-style-ukui/themeconfig/default.json @@ -1,6 +1,6 @@ { "Radius":{ - "Window_Radius" : {"value": "8", "type": "int"}, + "Max_Radius" : {"value": "8", "type": "int"}, "Normal_Radius" : {"value": "6", "type": "int"}, "Min_Radius" : {"value": "4", "type": "int"} }, diff --git a/ukui-styles/qt5-config-style-ukui/themeconfig/fashion.json b/ukui-styles/qt5-config-style-ukui/themeconfig/fashion.json index 141b63f..44da586 100644 --- a/ukui-styles/qt5-config-style-ukui/themeconfig/fashion.json +++ b/ukui-styles/qt5-config-style-ukui/themeconfig/fashion.json @@ -1,6 +1,6 @@ { "Radius":{ - "Window_Radius" : {"value": "8", "type": "int"}, + "Max_Radius" : {"value": "8", "type": "int"}, "Normal_Radius" : {"value": "6", "type": "int"}, "Min_Radius" : {"value": "4", "type": "int"} }, diff --git a/ukui-styles/qt5-config-style-ukui/ukui-config-style-parameters.cpp b/ukui-styles/qt5-config-style-ukui/ukui-config-style-parameters.cpp index 4c5c848..fc1b9a8 100644 --- a/ukui-styles/qt5-config-style-ukui/ukui-config-style-parameters.cpp +++ b/ukui-styles/qt5-config-style-ukui/ukui-config-style-parameters.cpp @@ -3948,8 +3948,8 @@ void UKUIConfigStyleParameters::initConfigTabWidgetParameters(bool isDark, const void UKUIConfigStyleParameters::initConfigMenuParameters(bool isDark, const QStyleOption *option, const QWidget *widget) { - int frameradius = (widget && widget->property("windowRadius").isValid()) ? - widget->property("windowRadius").toInt() : m_radiusStruct.maxRadius; + int frameradius = (widget && widget->property("maxRadius").isValid()) ? + widget->property("maxRadius").toInt() : m_radiusStruct.maxRadius; int itemradius = (widget && widget->property("normalRadius").isValid()) ? widget->property("normalRadius").toInt() : m_radiusStruct.normalRadius; // QPixmap framePixmap(option->rect.size()); diff --git a/ukui-styles/qt5-config-style-ukui/ukui-config-style.cpp b/ukui-styles/qt5-config-style-ukui/ukui-config-style.cpp index 96e315e..f9186aa 100644 --- a/ukui-styles/qt5-config-style-ukui/ukui-config-style.cpp +++ b/ukui-styles/qt5-config-style-ukui/ukui-config-style.cpp @@ -265,13 +265,7 @@ UKUIConfigStyle::UKUIConfigStyle(bool dark, bool useDefault, QString type) : QPr sp = new UKUIConfigStyleParameters(this, isUseDarkPalette(), m_widget_theme); - if (UKUIStyleSettings::isSchemaInstalled("org.ukui.style")) { - auto settings = UKUIStyleSettings::globalInstance(); - if(settings->keys().contains("windowRadius")) - setProperty("windowRadius", settings->get("windowRadius").toInt()); - else - setProperty("windowRadius", sp->radiusProperty().maxRadius); - } + setProperty("maxRadius", sp->radiusProperty().maxRadius); setProperty("normalRadius", sp->radiusProperty().normalRadius); setProperty("minRadius", sp->radiusProperty().minRadius); } @@ -968,30 +962,9 @@ void UKUIConfigStyle::polish(QWidget *widget) if(!widget) return; - - if (UKUIStyleSettings::isSchemaInstalled("org.ukui.style")) { - auto settings = UKUIStyleSettings::globalInstance(); - if(settings->keys().contains("windowRadius")) - widget->setProperty("windowRadius", settings->get("windowRadius").toInt()); - else - widget->setProperty("windowRadius", sp->radiusProperty().maxRadius); - } - -// if(settings->keys().contains("normalRadius")) -// widget->setProperty("normalRadius", settings->get("normalRadius").toInt()); -// else -// widget->setProperty("normalRadius", sp->radiusProperty().normalRadius); - -// if(settings->keys().contains("minRadius")) -// widget->setProperty("minRadius", settings->get("minRadius").toInt()); -// else -// widget->setProperty("minRadius", sp->radiusProperty().minRadius); -// } -// else{ - widget->setProperty("normalRadius", sp->radiusProperty().normalRadius); - widget->setProperty("minRadius", sp->radiusProperty().minRadius); -// } - + widget->setProperty("maxRadius", sp->radiusProperty().maxRadius); + widget->setProperty("normalRadius", sp->radiusProperty().normalRadius); + widget->setProperty("minRadius", sp->radiusProperty().minRadius); Style::polish(widget); diff --git a/ukui-styles/qt5-style-ukui/qt5-ukui-style.cpp b/ukui-styles/qt5-style-ukui/qt5-ukui-style.cpp index e0bd4bf..f0e0636 100644 --- a/ukui-styles/qt5-style-ukui/qt5-ukui-style.cpp +++ b/ukui-styles/qt5-style-ukui/qt5-ukui-style.cpp @@ -261,7 +261,7 @@ Qt5UKUIStyle::Qt5UKUIStyle(bool dark, bool useDefault, QString type) : QProxySty sp = new KClassicalStyleParameters(this, isUseDarkPalette()); qDebug() << "classical setproperty........" << sp->radiusProperty().maxRadius << sp->radiusProperty().normalRadius << sp->radiusProperty().minRadius; - setProperty("windowRadius", sp->radiusProperty().maxRadius); + setProperty("maxRadius", sp->radiusProperty().maxRadius); setProperty("normalRadius", sp->radiusProperty().normalRadius); setProperty("minRadius", sp->radiusProperty().minRadius); } diff --git a/ukui-styles/qt5-style-ukui/themeconfig/style-ukui-classical.json b/ukui-styles/qt5-style-ukui/themeconfig/style-ukui-classical.json index 3164a16..45be0db 100644 --- a/ukui-styles/qt5-style-ukui/themeconfig/style-ukui-classical.json +++ b/ukui-styles/qt5-style-ukui/themeconfig/style-ukui-classical.json @@ -1,6 +1,6 @@ { "Radius":{ - "Window_Radius" : {"value": "0", "type": "int"}, + "Max_Radius" : {"value": "0", "type": "int"}, "Normal_Radius" : {"value": "0", "type": "int"}, "Min_Radius" : {"value": "0", "type": "int"} } diff --git a/ukui-styles/readconfig.cpp b/ukui-styles/readconfig.cpp index 2c51920..607b7fd 100644 --- a/ukui-styles/readconfig.cpp +++ b/ukui-styles/readconfig.cpp @@ -1128,7 +1128,7 @@ UKUIRadiusInformation::UKUIRadiusStruct ReadThemeConfig::getRadiusStruct(QString if(!m_loadConfig) return m_radiusStruct; - getRadius(Window_Radius, m_radiusStruct.maxRadius); + getRadius(Max_Radius, m_radiusStruct.maxRadius); getRadius(Normal_Radius, m_radiusStruct.normalRadius); getRadius(Min_Radius, m_radiusStruct.minRadius); return m_radiusStruct; diff --git a/ukui-styles/themeinformation.h b/ukui-styles/themeinformation.h index 8af8bc8..5cbe95d 100644 --- a/ukui-styles/themeinformation.h +++ b/ukui-styles/themeinformation.h @@ -43,7 +43,7 @@ #define Obj_PaletteRole_Type "paletterole" #define UKUI_Radius "Radius" -#define Window_Radius "Window_Radius" +#define Max_Radius "Max_Radius" #define Normal_Radius "Normal_Radius" #define Min_Radius "Min_Radius"