update T_Dialog

This commit is contained in:
zhuzichu 2023-12-04 17:35:05 +08:00
parent 2428a38194
commit a9772a8fb0
4 changed files with 214 additions and 56 deletions

View File

@ -115,4 +115,68 @@ FluScrollablePage{
showSuccess("点击最小化按钮")
}
}
FluArea{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
FluButton{
anchors.verticalCenter: parent.verticalCenter
Layout.topMargin: 20
text:"Custom Content Dialog"
onClicked: {
custom_btn_dialog.open()
}
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
code:'FluContentDialog{
id:dialog
title:"友情提示"
message:"数据正在加载中,请稍等..."
negativeText:"取消加载"
contentDelegate: Component{
Item{
width: parent.width
height: 80
FluProgressRing{
anchors.centerIn: parent
}
}
}
onNegativeClicked:{
showSuccess("点击取消按钮")
}
positiveText:"确定"
onPositiveClicked:{
showSuccess("点击确定按钮")
}
dialog.open()'
}
FluContentDialog{
id:custom_btn_dialog
title:"友情提示"
message:"数据正在加载中,请稍等..."
negativeText:"取消加载"
contentDelegate: Component{
Item{
width: parent.width
height: 80
FluProgressRing{
anchors.centerIn: parent
}
}
}
onNegativeClicked:{
showSuccess("点击取消按钮")
}
positiveText:"确定"
onPositiveClicked:{
showSuccess("点击确定按钮")
}
}
}

View File

@ -116,4 +116,68 @@ FluScrollablePage{
showSuccess("点击最小化按钮")
}
}
FluArea{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
FluButton{
anchors.verticalCenter: parent.verticalCenter
Layout.topMargin: 20
text:"Custom Content Dialog"
onClicked: {
custom_btn_dialog.open()
}
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
code:'FluContentDialog{
id:dialog
title:"友情提示"
message:"数据正在加载中,请稍等..."
negativeText:"取消加载"
contentDelegate: Component{
Item{
width: parent.width
height: 80
FluProgressRing{
anchors.centerIn: parent
}
}
}
onNegativeClicked:{
showSuccess("点击取消按钮")
}
positiveText:"确定"
onPositiveClicked:{
showSuccess("点击确定按钮")
}
dialog.open()'
}
FluContentDialog{
id:custom_btn_dialog
title:"友情提示"
message:"数据正在加载中,请稍等..."
negativeText:"取消加载"
contentDelegate: Component{
Item{
width: parent.width
height: 80
FluProgressRing{
anchors.centerIn: parent
}
}
}
onNegativeClicked:{
showSuccess("点击取消按钮")
}
positiveText:"确定"
onPositiveClicked:{
showSuccess("点击确定按钮")
}
}
}

View File

@ -92,12 +92,16 @@ FluPopup {
margins: spacing
fill: parent
}
spacing: 15
spacing: 10
Item{
Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.NeutralButton
FluButton{
id:neutral_btn
Layout.fillWidth: true
visible: control.buttonFlags&FluContentDialogType.NeutralButton
text: neutralText
width: parent.width
anchors.centerIn: parent
onClicked: {
if(control.onNeutralClickListener){
control.onNeutralClickListener()
@ -107,10 +111,15 @@ FluPopup {
}
}
}
}
Item{
Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.NegativeButton
FluButton{
id:negative_btn
Layout.fillWidth: true
visible: control.buttonFlags&FluContentDialogType.NegativeButton
width: parent.width
anchors.centerIn: parent
text: negativeText
onClicked: {
if(control.onNegativeClickListener){
@ -121,11 +130,16 @@ FluPopup {
}
}
}
}
Item{
Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.PositiveButton
FluFilledButton{
id:positive_btn
Layout.fillWidth: true
visible: control.buttonFlags&FluContentDialogType.PositiveButton
text: positiveText
width: parent.width
anchors.centerIn: parent
onClicked: {
if(control.onPositiveClickListener){
control.onPositiveClickListener()
@ -140,3 +154,4 @@ FluPopup {
}
}
}
}

View File

@ -92,12 +92,16 @@ FluPopup {
margins: spacing
fill: parent
}
spacing: 15
spacing: 10
Item{
Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.NeutralButton
FluButton{
id:neutral_btn
Layout.fillWidth: true
visible: control.buttonFlags&FluContentDialogType.NeutralButton
text: neutralText
width: parent.width
anchors.centerIn: parent
onClicked: {
if(control.onNeutralClickListener){
control.onNeutralClickListener()
@ -107,10 +111,15 @@ FluPopup {
}
}
}
}
Item{
Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.NegativeButton
FluButton{
id:negative_btn
Layout.fillWidth: true
visible: control.buttonFlags&FluContentDialogType.NegativeButton
width: parent.width
anchors.centerIn: parent
text: negativeText
onClicked: {
if(control.onNegativeClickListener){
@ -121,11 +130,16 @@ FluPopup {
}
}
}
}
Item{
Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.PositiveButton
FluFilledButton{
id:positive_btn
Layout.fillWidth: true
visible: control.buttonFlags&FluContentDialogType.PositiveButton
text: positiveText
width: parent.width
anchors.centerIn: parent
onClicked: {
if(control.onPositiveClickListener){
control.onPositiveClickListener()
@ -140,3 +154,4 @@ FluPopup {
}
}
}
}