add fast blur for image
This commit is contained in:
parent
6e780c35ad
commit
358f0f0589
@ -2,6 +2,7 @@ import QtQuick 2.12
|
||||
import QtQuick.Controls 2.5
|
||||
|
||||
import "util.mjs" as Util
|
||||
import QtGraphicalEffects 1.12
|
||||
|
||||
AnimatedImage {
|
||||
property var wrapper
|
||||
@ -83,4 +84,20 @@ AnimatedImage {
|
||||
mouseAreaBridge.onClick(wrapper)
|
||||
}
|
||||
}
|
||||
|
||||
property var isBlur: false
|
||||
onIsBlurChanged: {
|
||||
console.log(tag, uuid + " onIsBlurChanged: " + this.isBlur)
|
||||
if (isBlur) {
|
||||
this.layer.enabled = true
|
||||
} else {
|
||||
this.layer.enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
layer.enabled: false
|
||||
layer.effect: FastBlur {
|
||||
radius: 50
|
||||
transparentBorder: true
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,10 @@ void DoricImageNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
|
||||
} else if (name == "imageBase64") {
|
||||
container->setProperty("fillMode", this->contentMode);
|
||||
container->setProperty("source", prop.toString());
|
||||
} else if (name == "isBlur") {
|
||||
if (prop.toBool()) {
|
||||
container->setProperty("isBlur", prop.toBool());
|
||||
}
|
||||
} else {
|
||||
DoricViewNode::blend(view, name, prop);
|
||||
}
|
||||
|
Reference in New Issue
Block a user