mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-22 19:00:07 +08:00
fix bug #403
This commit is contained in:
parent
a6001ea142
commit
0222a2111d
@ -16,7 +16,6 @@ FluScrollablePage{
|
||||
Layout.topMargin: 20
|
||||
FluButton{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
Layout.topMargin: 20
|
||||
text:"Show Double Button Dialog"
|
||||
onClicked: {
|
||||
double_btn_dialog.open()
|
||||
@ -65,7 +64,6 @@ FluScrollablePage{
|
||||
Layout.topMargin: 20
|
||||
FluButton{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
Layout.topMargin: 20
|
||||
text:"Show Triple Button Dialog"
|
||||
onClicked: {
|
||||
triple_btn_dialog.open()
|
||||
@ -118,17 +116,25 @@ FluScrollablePage{
|
||||
|
||||
FluArea{
|
||||
Layout.fillWidth: true
|
||||
height: 68
|
||||
height: 100
|
||||
paddings: 10
|
||||
Layout.topMargin: 20
|
||||
FluButton{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
Layout.topMargin: 20
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 5
|
||||
text:"Custom Content Dialog"
|
||||
onClicked: {
|
||||
custom_btn_dialog.open()
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 48
|
||||
text:"Custom Content Dialog2"
|
||||
onClicked: {
|
||||
custom_btn_dialog2.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
Layout.fillWidth: true
|
||||
@ -164,8 +170,8 @@ FluScrollablePage{
|
||||
negativeText:"取消加载"
|
||||
contentDelegate: Component{
|
||||
Item{
|
||||
width: parent.width
|
||||
height: 80
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: 80
|
||||
FluProgressRing{
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
@ -179,4 +185,47 @@ FluScrollablePage{
|
||||
showSuccess("点击确定按钮")
|
||||
}
|
||||
}
|
||||
|
||||
FluContentDialog{
|
||||
id:custom_btn_dialog2
|
||||
title:"折线图"
|
||||
contentDelegate: Component{
|
||||
Item{
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: 300
|
||||
FluChart{
|
||||
anchors.fill: parent
|
||||
chartType: 'line'
|
||||
chartData: { return {
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
datasets: [{
|
||||
label: 'My First Dataset',
|
||||
data: [65, 59, 80, 81, 56, 55, 40],
|
||||
fill: false,
|
||||
borderColor: 'rgb(75, 192, 192)',
|
||||
tension: 0.1
|
||||
}]
|
||||
}
|
||||
}
|
||||
chartOptions: { return {
|
||||
maintainAspectRatio: false,
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Chart.js Line Chart - Stacked'
|
||||
},
|
||||
tooltips: {
|
||||
mode: 'index',
|
||||
intersect: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
buttonFlags: FluContentDialogType.PositiveButton
|
||||
positiveText:"确定"
|
||||
onPositiveClicked:{
|
||||
showSuccess("点击确定按钮")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ FluScrollablePage{
|
||||
Layout.topMargin: 20
|
||||
FluButton{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
Layout.topMargin: 20
|
||||
text:"Show Double Button Dialog"
|
||||
onClicked: {
|
||||
double_btn_dialog.open()
|
||||
@ -65,7 +64,6 @@ FluScrollablePage{
|
||||
Layout.topMargin: 20
|
||||
FluButton{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
Layout.topMargin: 20
|
||||
text:"Show Triple Button Dialog"
|
||||
onClicked: {
|
||||
triple_btn_dialog.open()
|
||||
@ -118,17 +116,25 @@ FluScrollablePage{
|
||||
|
||||
FluArea{
|
||||
Layout.fillWidth: true
|
||||
height: 68
|
||||
height: 100
|
||||
paddings: 10
|
||||
Layout.topMargin: 20
|
||||
FluButton{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
Layout.topMargin: 20
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 5
|
||||
text:"Custom Content Dialog"
|
||||
onClicked: {
|
||||
custom_btn_dialog.open()
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 48
|
||||
text:"Custom Content Dialog2"
|
||||
onClicked: {
|
||||
custom_btn_dialog2.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
Layout.fillWidth: true
|
||||
@ -164,8 +170,8 @@ FluScrollablePage{
|
||||
negativeText:"取消加载"
|
||||
contentDelegate: Component{
|
||||
Item{
|
||||
width: parent.width
|
||||
height: 80
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: 80
|
||||
FluProgressRing{
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
@ -179,4 +185,47 @@ FluScrollablePage{
|
||||
showSuccess("点击确定按钮")
|
||||
}
|
||||
}
|
||||
|
||||
FluContentDialog{
|
||||
id:custom_btn_dialog2
|
||||
title:"折线图"
|
||||
contentDelegate: Component{
|
||||
Item{
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: 300
|
||||
FluChart{
|
||||
anchors.fill: parent
|
||||
chartType: 'line'
|
||||
chartData: { return {
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
datasets: [{
|
||||
label: 'My First Dataset',
|
||||
data: [65, 59, 80, 81, 56, 55, 40],
|
||||
fill: false,
|
||||
borderColor: 'rgb(75, 192, 192)',
|
||||
tension: 0.1
|
||||
}]
|
||||
}
|
||||
}
|
||||
chartOptions: { return {
|
||||
maintainAspectRatio: false,
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Chart.js Line Chart - Stacked'
|
||||
},
|
||||
tooltips: {
|
||||
mode: 'index',
|
||||
intersect: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
buttonFlags: FluContentDialogType.PositiveButton
|
||||
positiveText:"确定"
|
||||
onPositiveClicked:{
|
||||
showSuccess("点击确定按钮")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,9 +8,9 @@ FluPopup {
|
||||
id: control
|
||||
property string title: ""
|
||||
property string message: ""
|
||||
property string neutralText: "Neutral"
|
||||
property string negativeText: "Negative"
|
||||
property string positiveText: "Positive"
|
||||
property string neutralText: "Close"
|
||||
property string negativeText: "Cancel"
|
||||
property string positiveText: "OK"
|
||||
property int messageTextFormart: Text.AutoText
|
||||
property int delayTime: 100
|
||||
property int buttonFlags: FluContentDialogType.NegativeButton | FluContentDialogType.PositiveButton
|
||||
@ -75,9 +75,15 @@ FluPopup {
|
||||
Layout.preferredHeight: status===Loader.Ready ? item.height : 0
|
||||
}
|
||||
FluLoader{
|
||||
sourceComponent: control.contentDelegate
|
||||
sourceComponent:control.visible ? control.contentDelegate : undefined
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: status===Loader.Ready ? item.height : 0
|
||||
onStatusChanged: {
|
||||
if(status===Loader.Ready){
|
||||
Layout.preferredHeight = item.implicitHeight
|
||||
}else{
|
||||
Layout.preferredHeight = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle{
|
||||
id:layout_actions
|
||||
|
@ -8,9 +8,9 @@ FluPopup {
|
||||
id: control
|
||||
property string title: ""
|
||||
property string message: ""
|
||||
property string neutralText: "Neutral"
|
||||
property string negativeText: "Negative"
|
||||
property string positiveText: "Positive"
|
||||
property string neutralText: "Close"
|
||||
property string negativeText: "Cancel"
|
||||
property string positiveText: "OK"
|
||||
property int messageTextFormart: Text.AutoText
|
||||
property int delayTime: 100
|
||||
property int buttonFlags: FluContentDialogType.NegativeButton | FluContentDialogType.PositiveButton
|
||||
@ -75,9 +75,15 @@ FluPopup {
|
||||
Layout.preferredHeight: status===Loader.Ready ? item.height : 0
|
||||
}
|
||||
FluLoader{
|
||||
sourceComponent: control.contentDelegate
|
||||
sourceComponent:control.visible ? control.contentDelegate : undefined
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: status===Loader.Ready ? item.height : 0
|
||||
onStatusChanged: {
|
||||
if(status===Loader.Ready){
|
||||
Layout.preferredHeight = item.implicitHeight
|
||||
}else{
|
||||
Layout.preferredHeight = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle{
|
||||
id:layout_actions
|
||||
|
Loading…
Reference in New Issue
Block a user