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,46 +92,61 @@ FluPopup {
margins: spacing margins: spacing
fill: parent fill: parent
} }
spacing: 15 spacing: 10
FluButton{ Item{
id:neutral_btn
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.NeutralButton visible: control.buttonFlags&FluContentDialogType.NeutralButton
text: neutralText FluButton{
onClicked: { id:neutral_btn
if(control.onNeutralClickListener){ text: neutralText
control.onNeutralClickListener() width: parent.width
}else{ anchors.centerIn: parent
neutralClicked() onClicked: {
control.close() if(control.onNeutralClickListener){
control.onNeutralClickListener()
}else{
neutralClicked()
control.close()
}
} }
} }
} }
FluButton{ Item{
id:negative_btn
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.NegativeButton visible: control.buttonFlags&FluContentDialogType.NegativeButton
text: negativeText FluButton{
onClicked: { id:negative_btn
if(control.onNegativeClickListener){ width: parent.width
control.onNegativeClickListener() anchors.centerIn: parent
}else{ text: negativeText
negativeClicked() onClicked: {
control.close() if(control.onNegativeClickListener){
control.onNegativeClickListener()
}else{
negativeClicked()
control.close()
}
} }
} }
} }
FluFilledButton{ Item{
id:positive_btn
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.PositiveButton visible: control.buttonFlags&FluContentDialogType.PositiveButton
text: positiveText FluFilledButton{
onClicked: { id:positive_btn
if(control.onPositiveClickListener){ text: positiveText
control.onPositiveClickListener() width: parent.width
}else{ anchors.centerIn: parent
positiveClicked() onClicked: {
control.close() if(control.onPositiveClickListener){
control.onPositiveClickListener()
}else{
positiveClicked()
control.close()
}
} }
} }
} }

View File

@ -92,46 +92,61 @@ FluPopup {
margins: spacing margins: spacing
fill: parent fill: parent
} }
spacing: 15 spacing: 10
FluButton{ Item{
id:neutral_btn
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.NeutralButton visible: control.buttonFlags&FluContentDialogType.NeutralButton
text: neutralText FluButton{
onClicked: { id:neutral_btn
if(control.onNeutralClickListener){ text: neutralText
control.onNeutralClickListener() width: parent.width
}else{ anchors.centerIn: parent
neutralClicked() onClicked: {
control.close() if(control.onNeutralClickListener){
control.onNeutralClickListener()
}else{
neutralClicked()
control.close()
}
} }
} }
} }
FluButton{ Item{
id:negative_btn
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.NegativeButton visible: control.buttonFlags&FluContentDialogType.NegativeButton
text: negativeText FluButton{
onClicked: { id:negative_btn
if(control.onNegativeClickListener){ width: parent.width
control.onNegativeClickListener() anchors.centerIn: parent
}else{ text: negativeText
negativeClicked() onClicked: {
control.close() if(control.onNegativeClickListener){
control.onNegativeClickListener()
}else{
negativeClicked()
control.close()
}
} }
} }
} }
FluFilledButton{ Item{
id:positive_btn
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true
visible: control.buttonFlags&FluContentDialogType.PositiveButton visible: control.buttonFlags&FluContentDialogType.PositiveButton
text: positiveText FluFilledButton{
onClicked: { id:positive_btn
if(control.onPositiveClickListener){ text: positiveText
control.onPositiveClickListener() width: parent.width
}else{ anchors.centerIn: parent
positiveClicked() onClicked: {
control.close() if(control.onPositiveClickListener){
control.onPositiveClickListener()
}else{
positiveClicked()
control.close()
}
} }
} }
} }