forked from openkylin/qt5-ukui-platformtheme
修复tooltip无毛玻璃的问题
This commit is contained in:
parent
c61ccd054b
commit
9eb0d043bd
|
@ -282,8 +282,11 @@ void BlurHelper::delayUpdate(QWidget *w, bool updateBlurRegionOnly)
|
|||
}
|
||||
QPainterPath path;
|
||||
int radius = 8;
|
||||
if(widget->property("maxRadius").isValid())
|
||||
radius = widget->property("maxRadius").toInt();
|
||||
if (UKUIStyleSettings::isSchemaInstalled("org.ukui.style")) {
|
||||
auto settings = UKUIStyleSettings::globalInstance();
|
||||
if(settings->keys().contains("windowRadius"))
|
||||
radius = settings->get("windowRadius").toInt();
|
||||
}
|
||||
path.addRoundedRect(widget->rect(), radius, radius);
|
||||
KWindowEffects::enableBlurBehind(widget->winId(), true, path.toFillPolygon().toPolygon());
|
||||
if (!updateBlurRegionOnly)
|
||||
|
@ -294,8 +297,11 @@ void BlurHelper::delayUpdate(QWidget *w, bool updateBlurRegionOnly)
|
|||
if (widget->inherits("QTipLabel")) {
|
||||
QPainterPath path;
|
||||
int radius = 8;
|
||||
if(widget->property("normalRadius").isValid())
|
||||
radius = widget->property("normalRadius").toInt();
|
||||
if (UKUIStyleSettings::isSchemaInstalled("org.ukui.style")) {
|
||||
auto settings = UKUIStyleSettings::globalInstance();
|
||||
if(settings->keys().contains("windowRadius"))
|
||||
radius = settings->get("windowRadius").toInt();
|
||||
}
|
||||
path.addRoundedRect(widget->rect().adjusted(+4,+4,-4,-4), radius, radius);
|
||||
KWindowEffects::enableBlurBehind(widget->winId(), true, path.toFillPolygon().toPolygon());
|
||||
if (!updateBlurRegionOnly)
|
||||
|
|
|
@ -947,6 +947,11 @@ void UKUIConfigStyle::polish(QWidget *widget)
|
|||
}
|
||||
}
|
||||
|
||||
if(!widget)
|
||||
return;
|
||||
|
||||
realSetWindowSurfaceFormatAlpha(widget);
|
||||
|
||||
if (qAppName() != "ukui-menu" || (qAppName() == "ukui-menu" && widget && widget->inherits("QMenu"))) {
|
||||
if (widget && widget->testAttribute(Qt::WA_TranslucentBackground) && widget->isTopLevel()) {
|
||||
//FIXME:
|
||||
|
@ -976,16 +981,12 @@ void UKUIConfigStyle::polish(QWidget *widget)
|
|||
}
|
||||
}
|
||||
|
||||
if(!widget)
|
||||
return;
|
||||
widget->setProperty("maxRadius", sp->radiusProperty().maxRadius);
|
||||
widget->setProperty("normalRadius", sp->radiusProperty().normalRadius);
|
||||
widget->setProperty("minRadius", sp->radiusProperty().minRadius);
|
||||
|
||||
Style::polish(widget);
|
||||
|
||||
realSetWindowSurfaceFormatAlpha(widget);
|
||||
|
||||
m_shadow_helper->registerWidget(widget);
|
||||
|
||||
if (qobject_cast<QTabWidget*>(widget)) {
|
||||
|
|
Loading…
Reference in New Issue