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("点击最小化按钮") 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("点击最小化按钮") 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 margins: spacing
fill: parent fill: parent
} }
spacing: 15 spacing: 10
Item{
Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.NeutralButton
FluButton{ FluButton{
id:neutral_btn id:neutral_btn
Layout.fillWidth: true
visible: control.buttonFlags&FluContentDialogType.NeutralButton
text: neutralText text: neutralText
width: parent.width
anchors.centerIn: parent
onClicked: { onClicked: {
if(control.onNeutralClickListener){ if(control.onNeutralClickListener){
control.onNeutralClickListener() control.onNeutralClickListener()
@ -107,10 +111,15 @@ FluPopup {
} }
} }
} }
}
Item{
Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.NegativeButton
FluButton{ FluButton{
id:negative_btn id:negative_btn
Layout.fillWidth: true width: parent.width
visible: control.buttonFlags&FluContentDialogType.NegativeButton anchors.centerIn: parent
text: negativeText text: negativeText
onClicked: { onClicked: {
if(control.onNegativeClickListener){ if(control.onNegativeClickListener){
@ -121,11 +130,16 @@ FluPopup {
} }
} }
} }
}
Item{
Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.PositiveButton
FluFilledButton{ FluFilledButton{
id:positive_btn id:positive_btn
Layout.fillWidth: true
visible: control.buttonFlags&FluContentDialogType.PositiveButton
text: positiveText text: positiveText
width: parent.width
anchors.centerIn: parent
onClicked: { onClicked: {
if(control.onPositiveClickListener){ if(control.onPositiveClickListener){
control.onPositiveClickListener() control.onPositiveClickListener()
@ -139,4 +153,5 @@ FluPopup {
} }
} }
} }
}
} }

View File

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