Add acrylic effect for FluContentDialog.

main
Mentalflow 2023-05-22 20:39:00 +08:00
parent f802838847
commit b7fdcca506
No known key found for this signature in database
GPG Key ID: 5AE68D4401A2EE71
2 changed files with 22 additions and 6 deletions

View File

@ -69,6 +69,7 @@ CustomWindow {
} }
positiveText:"退出" positiveText:"退出"
neutralText:"取消" neutralText:"取消"
blurSource: nav_view
onPositiveClicked:{ onPositiveClicked:{
window.deleteWindow() window.deleteWindow()
FluApp.closeApp() FluApp.closeApp()

View File

@ -1,4 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Window import QtQuick.Window
@ -11,6 +11,8 @@ Popup {
property string neutralText: "Neutral" property string neutralText: "Neutral"
property string negativeText: "Negative" property string negativeText: "Negative"
property string positiveText: "Positive" property string positiveText: "Positive"
property alias blurSource: blur.sourceItem
property bool blurBackground: true
signal neutralClicked signal neutralClicked
signal negativeClicked signal negativeClicked
signal positiveClicked signal positiveClicked
@ -50,14 +52,27 @@ Popup {
easing.bezierCurve: [ 1, 0, 0, 0 ] easing.bezierCurve: [ 1, 0, 0, 0 ]
} }
} }
contentItem: Rectangle { contentItem:
Rectangle {
id:layout_content id:layout_content
anchors.fill: parent
implicitWidth:minWidth implicitWidth:minWidth
implicitHeight: text_title.height + text_message.height + layout_actions.height implicitHeight: text_title.height + text_message.height + layout_actions.height
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1) color: 'transparent'
radius:5 radius:5
FluShadow{ FluAcrylic{
radius: 5 id:blur
anchors{
top:parent.top
left: parent.left
right: parent.right
bottom: layout_actions.bottom
}
height: parent.height
color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1)
rectX: popup.x
rectY: popup.y
acrylicOpacity:blurBackground ? 0.8 : 1
} }
FluText{ FluText{
id:text_title id:text_title
@ -92,7 +107,7 @@ Popup {
id:layout_actions id:layout_actions
height: 68 height: 68
radius: 5 radius: 5
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1) color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255, blurBackground ? blur.acrylicOpacity - 0.4 : 1) : Qt.rgba(243/255,243/255,243/255,blurBackground ? blur.acrylicOpacity - 0.4 : 1)
anchors{ anchors{
top:text_message.bottom top:text_message.bottom
left: parent.left left: parent.left