调整亚克力效果的噪点占比

参考官方figma winui3设计稿,噪点图像占比为2%,不然看起来噪点太明显
This commit is contained in:
wey 2023-11-28 23:02:39 +08:00
parent d07383ba46
commit e37d47f629
2 changed files with 18 additions and 16 deletions

View File

@ -4,13 +4,14 @@ import FluentUI 1.0
Item { Item {
id: control id: control
property color tintColor: Qt.rgba(1,1,1,1) property color tintColor: Qt.rgba(1, 1, 1, 1)
property real tintOpacity: 0.65 property real tintOpacity: 0.65
property real luminosity: 0.01 property real luminosity: 0.01
property real noiseOpacity : 0.066 property real noiseOpacity: 0.02
property alias target : effect_source.sourceItem property alias target: effect_source.sourceItem
property int blurRadius: 32 property int blurRadius: 32
property rect targetRect : Qt.rect(control.x, control.y, control.width, control.height) property rect targetRect: Qt.rect(control.x, control.y, control.width,
control.height)
ShaderEffectSource { ShaderEffectSource {
id: effect_source id: effect_source
anchors.fill: parent anchors.fill: parent
@ -18,20 +19,20 @@ Item {
sourceRect: control.targetRect sourceRect: control.targetRect
} }
FastBlur { FastBlur {
id:fast_blur id: fast_blur
anchors.fill: parent anchors.fill: parent
source: effect_source source: effect_source
radius: control.blurRadius radius: control.blurRadius
} }
Rectangle{ Rectangle {
anchors.fill: parent anchors.fill: parent
color: Qt.rgba(1, 1, 1, luminosity) color: Qt.rgba(1, 1, 1, luminosity)
} }
Rectangle{ Rectangle {
anchors.fill: parent anchors.fill: parent
color: Qt.rgba(tintColor.r, tintColor.g, tintColor.b, tintOpacity) color: Qt.rgba(tintColor.r, tintColor.g, tintColor.b, tintOpacity)
} }
Image{ Image {
anchors.fill: parent anchors.fill: parent
source: "../Image/noise.png" source: "../Image/noise.png"
fillMode: Image.Tile fillMode: Image.Tile

View File

@ -4,13 +4,14 @@ import FluentUI
Item { Item {
id: control id: control
property color tintColor: Qt.rgba(1,1,1,1) property color tintColor: Qt.rgba(1, 1, 1, 1)
property real tintOpacity: 0.65 property real tintOpacity: 0.65
property real luminosity: 0.01 property real luminosity: 0.01
property real noiseOpacity : 0.066 property real noiseOpacity: 0.02
property alias target : effect_source.sourceItem property alias target: effect_source.sourceItem
property int blurRadius: 32 property int blurRadius: 32
property rect targetRect : Qt.rect(control.x, control.y, control.width, control.height) property rect targetRect: Qt.rect(control.x, control.y, control.width,
control.height)
ShaderEffectSource { ShaderEffectSource {
id: effect_source id: effect_source
anchors.fill: parent anchors.fill: parent
@ -18,20 +19,20 @@ Item {
sourceRect: control.targetRect sourceRect: control.targetRect
} }
FastBlur { FastBlur {
id:fast_blur id: fast_blur
anchors.fill: parent anchors.fill: parent
source: effect_source source: effect_source
radius: control.blurRadius radius: control.blurRadius
} }
Rectangle{ Rectangle {
anchors.fill: parent anchors.fill: parent
color: Qt.rgba(1, 1, 1, luminosity) color: Qt.rgba(1, 1, 1, luminosity)
} }
Rectangle{ Rectangle {
anchors.fill: parent anchors.fill: parent
color: Qt.rgba(tintColor.r, tintColor.g, tintColor.b, tintOpacity) color: Qt.rgba(tintColor.r, tintColor.g, tintColor.b, tintOpacity)
} }
Image{ Image {
anchors.fill: parent anchors.fill: parent
source: "../Image/noise.png" source: "../Image/noise.png"
fillMode: Image.Tile fillMode: Image.Tile