mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-30 07:03:46 +08:00
update
This commit is contained in:
parent
0d87dadc61
commit
8595b2fdec
@ -12,7 +12,7 @@ FluScrollablePage{
|
||||
FluArea{
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20
|
||||
height: 200
|
||||
height: 240
|
||||
paddings: 10
|
||||
ColumnLayout{
|
||||
spacing: 14
|
||||
@ -44,6 +44,12 @@ FluScrollablePage{
|
||||
showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
text:"Loading"
|
||||
onClicked: {
|
||||
showLoading()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
CodeExpander{
|
||||
|
@ -105,7 +105,6 @@ Item {
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea{
|
||||
id:item_layout_mouse
|
||||
anchors.fill: parent
|
||||
@ -200,9 +199,7 @@ Item {
|
||||
FluIconButton{
|
||||
id:item_layout_expanded
|
||||
color:"#00000000"
|
||||
iconSource:item_layout.expanded?FluentIcons.ChevronDown:FluentIcons.ChevronRight
|
||||
opacity: item_layout.hasChild
|
||||
iconSize: 15
|
||||
onClicked: {
|
||||
if(!item_layout.hasChild){
|
||||
item_layout_rect.onClickItem()
|
||||
@ -210,6 +207,18 @@ Item {
|
||||
}
|
||||
model.expanded = !model.expanded
|
||||
}
|
||||
contentItem: FluIcon{
|
||||
rotation: item_layout.expanded?0:-90
|
||||
iconSource:FluentIcons.ChevronDown
|
||||
iconSize: 15
|
||||
Behavior on rotation {
|
||||
enabled: FluTheme.enableAnimation
|
||||
NumberAnimation{
|
||||
duration: 167
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
FluText {
|
||||
text: item_layout.text
|
||||
|
@ -16,6 +16,7 @@ Window {
|
||||
property string route
|
||||
property var argument:({})
|
||||
property var pageRegister
|
||||
property Component loadingItem: com_loading
|
||||
property var closeFunc: function(event){
|
||||
if(closeDestory){
|
||||
deleteWindow()
|
||||
@ -50,13 +51,65 @@ Window {
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
}
|
||||
Loader{
|
||||
property string loadingText: "加载中..."
|
||||
property bool cancel: false
|
||||
id:loader_loading
|
||||
anchors.fill: container
|
||||
}
|
||||
FluInfoBar{
|
||||
id:infoBar
|
||||
root: window
|
||||
}
|
||||
Component{
|
||||
id:com_loading
|
||||
Popup{
|
||||
id:popup_loading
|
||||
modal:true
|
||||
focus: true
|
||||
anchors.centerIn: Overlay.overlay
|
||||
closePolicy: {
|
||||
if(cancel){
|
||||
return Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||
}
|
||||
return Popup.NoAutoClose
|
||||
}
|
||||
Overlay.modal: Rectangle {
|
||||
color: "#44000000"
|
||||
}
|
||||
onVisibleChanged: {
|
||||
if(!visible){
|
||||
loader_loading.sourceComponent = undefined
|
||||
}
|
||||
}
|
||||
visible: true
|
||||
background: Item{}
|
||||
contentItem: Item{
|
||||
ColumnLayout{
|
||||
spacing: 8
|
||||
anchors.centerIn: parent
|
||||
FluProgressRing{
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
FluText{
|
||||
text:loadingText
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
WindowHelper{
|
||||
id:helper
|
||||
}
|
||||
function showLoading(text = "加载中...",cancel = true){
|
||||
loader_loading.loadingText = text
|
||||
loader_loading.cancel = cancel
|
||||
loader_loading.sourceComponent = com_loading
|
||||
}
|
||||
function hideLoading(){
|
||||
loader_loading.sourceComponent = undefined
|
||||
}
|
||||
function showSuccess(text,duration,moremsg){
|
||||
infoBar.showSuccess(text,duration,moremsg)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user