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 QtQuick.Controls 2.5
|
||||||
|
|
||||||
import "util.mjs" as Util
|
import "util.mjs" as Util
|
||||||
|
import QtGraphicalEffects 1.12
|
||||||
|
|
||||||
AnimatedImage {
|
AnimatedImage {
|
||||||
property var wrapper
|
property var wrapper
|
||||||
@ -83,4 +84,20 @@ AnimatedImage {
|
|||||||
mouseAreaBridge.onClick(wrapper)
|
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") {
|
} else if (name == "imageBase64") {
|
||||||
container->setProperty("fillMode", this->contentMode);
|
container->setProperty("fillMode", this->contentMode);
|
||||||
container->setProperty("source", prop.toString());
|
container->setProperty("source", prop.toString());
|
||||||
|
} else if (name == "isBlur") {
|
||||||
|
if (prop.toBool()) {
|
||||||
|
container->setProperty("isBlur", prop.toBool());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
DoricViewNode::blend(view, name, prop);
|
DoricViewNode::blend(view, name, prop);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user