From 74afdeaf497489d9d41db4cf1d2b27f0f3186e0b Mon Sep 17 00:00:00 2001 From: Mentalflow <312902918@qq.com> Date: Sun, 14 May 2023 13:05:06 +0800 Subject: [PATCH] Use Qt6 compatible blur effect. --- example/qml/page/T_Acrylic.qml | 28 +++++++++++--------- src/imports/FluentUI/Controls/FluAcrylic.qml | 4 +-- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/example/qml/page/T_Acrylic.qml b/example/qml/page/T_Acrylic.qml index 63557bf3..521f853f 100644 --- a/example/qml/page/T_Acrylic.qml +++ b/example/qml/page/T_Acrylic.qml @@ -20,21 +20,23 @@ FluScrollablePage{ height: 1200/5 radius:[15,15,15,15] Image { + id:image asynchronous: true source: "qrc:/example/res/image/banner_3.jpg" anchors.fill: parent sourceSize: Qt.size(width,height) - FluAcrylic { - anchors.bottom: parent.bottom - anchors.right: parent.right - width: 100 - height: 100 - FluText { - anchors.centerIn: parent - text: "Acrylic" - color: "#FFFFFF" - font.bold: true - } + } + FluAcrylic { + sourceItem:image + anchors.bottom: parent.bottom + anchors.right: parent.right + width: 100 + height: 100 + FluText { + anchors.centerIn: parent + text: "Acrylic" + color: "#FFFFFF" + font.bold: true } } Layout.topMargin: 20 @@ -45,15 +47,17 @@ FluScrollablePage{ Layout.fillWidth: true Layout.topMargin: -1 code:'Image{ + id:image width: 800 height: 600 source: "qrc:/example/res/image/image_huoyin.webp" radius: 8 + } FluAcrylic{ + sourceItem:image width: 100 height: 100 anchors.centerIn: parent - } }' } diff --git a/src/imports/FluentUI/Controls/FluAcrylic.qml b/src/imports/FluentUI/Controls/FluAcrylic.qml index 7076e07c..98f0b619 100644 --- a/src/imports/FluentUI/Controls/FluAcrylic.qml +++ b/src/imports/FluentUI/Controls/FluAcrylic.qml @@ -23,11 +23,9 @@ Item { sourceRect: Qt.rect(control.x, control.y, control.width, control.height) } - GaussianBlur { + FastBlur { radius: 20 anchors.fill: effect_source source: effect_source - samples: 1 + radius * 2 } - }