mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-23 11:17:15 +08:00
update
This commit is contained in:
parent
ad4d077480
commit
80619f6974
@ -24,6 +24,7 @@ FluScrollablePage{
|
|||||||
FluTextButton{
|
FluTextButton{
|
||||||
disabled:text_button_switch.checked
|
disabled:text_button_switch.checked
|
||||||
text:"Text Button"
|
text:"Text Button"
|
||||||
|
contentDescription: "文本按钮"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
showInfo("点击Text Button")
|
showInfo("点击Text Button")
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,10 @@ CustomWindow {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
z:999
|
z:999
|
||||||
// pageMode: FluNavigationView.NoStack
|
//NoStack模式,每次切换都会销毁之前的页面然后创建一个新的页面,只需消耗少量内存(推荐)
|
||||||
|
// pageMode: FluNavigationView.NoStack
|
||||||
|
//Stack模式,每次切换都会将页面压入栈中,随着栈的页面增多,消耗的内存也越多,内存消耗多就会卡顿,这时候就需要按返回将页面pop掉,释放内存。该模式可以配合FluPage中的launchMode属性,设置页面的启动模式
|
||||||
|
pageMode: FluNavigationView.NoStack
|
||||||
items: ItemsOriginal
|
items: ItemsOriginal
|
||||||
footerItems:ItemsFooter
|
footerItems:ItemsFooter
|
||||||
topPadding:FluTools.isMacos() ? 20 : 5
|
topPadding:FluTools.isMacos() ? 20 : 5
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
namespace Fluent_DarkMode {
|
namespace Fluent_DarkMode {
|
||||||
Q_NAMESPACE
|
Q_NAMESPACE
|
||||||
enum Fluent_DarkModeType {
|
enum Fluent_DarkModeType {
|
||||||
System = 0x0,
|
System = 0x0,
|
||||||
Light = 0x1,
|
Light = 0x1,
|
||||||
Dark = 0x2,
|
Dark = 0x2,
|
||||||
};
|
};
|
||||||
Q_ENUM_NS(Fluent_DarkModeType)
|
Q_ENUM_NS(Fluent_DarkModeType)
|
||||||
QML_NAMED_ELEMENT(FluDarkMode)
|
QML_NAMED_ELEMENT(FluDarkMode)
|
||||||
|
@ -19,77 +19,90 @@ Item{
|
|||||||
property string errorButtonText: "重新加载"
|
property string errorButtonText: "重新加载"
|
||||||
property color color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
property color color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
||||||
signal errorClicked
|
signal errorClicked
|
||||||
|
property Component loadingItem : com_loading
|
||||||
|
property Component emptyItem : com_empty
|
||||||
|
property Component errorItem : com_error
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id:container
|
id:container
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: statusMode === FluStatusView.Success
|
visible: statusMode===FluStatusView.Success
|
||||||
}
|
}
|
||||||
FluArea{
|
Loader{
|
||||||
paddings: 0
|
id:loader
|
||||||
border.width: 0
|
anchors.fill: parent
|
||||||
anchors.fill: container
|
visible: statusMode!==FluStatusView.Success
|
||||||
visible: opacity
|
sourceComponent: {
|
||||||
opacity: statusMode === FluStatusView.Loading
|
if(statusMode === FluStatusView.Loading){
|
||||||
Behavior on opacity {
|
return loadingItem
|
||||||
NumberAnimation { duration: 83 }
|
|
||||||
}
|
|
||||||
color:control.color
|
|
||||||
ColumnLayout{
|
|
||||||
anchors.centerIn: parent
|
|
||||||
visible: statusMode === FluStatusView.Loading
|
|
||||||
FluProgressRing{
|
|
||||||
indeterminate: true
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
}
|
}
|
||||||
FluText{
|
if(statusMode === FluStatusView.Empty){
|
||||||
text:control.loadingText
|
return emptyItem
|
||||||
Layout.alignment: Qt.AlignHCenter
|
}
|
||||||
|
if(statusMode === FluStatusView.Error){
|
||||||
|
return errorItem
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Component{
|
||||||
|
id:com_loading
|
||||||
|
FluArea{
|
||||||
|
paddings: 0
|
||||||
|
border.width: 0
|
||||||
|
radius: 0
|
||||||
|
color:control.color
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.centerIn: parent
|
||||||
|
FluProgressRing{
|
||||||
|
indeterminate: true
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:control.loadingText
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluArea{
|
Component {
|
||||||
paddings: 0
|
id:com_empty
|
||||||
border.width: 0
|
FluArea{
|
||||||
anchors.fill: container
|
paddings: 0
|
||||||
visible: opacity
|
border.width: 0
|
||||||
color:control.color
|
radius: 0
|
||||||
opacity: statusMode === FluStatusView.Empty
|
color:control.color
|
||||||
Behavior on opacity {
|
ColumnLayout{
|
||||||
NumberAnimation { duration: 83 }
|
anchors.centerIn: parent
|
||||||
}
|
FluText{
|
||||||
ColumnLayout{
|
text:control.emptyText
|
||||||
anchors.centerIn: parent
|
font: FluTextStyle.BodyStrong
|
||||||
visible: statusMode === FluStatusView.Empty
|
Layout.alignment: Qt.AlignHCenter
|
||||||
FluText{
|
}
|
||||||
text:control.emptyText
|
|
||||||
font: FluTextStyle.BodyStrong
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluArea{
|
Component{
|
||||||
paddings: 0
|
id:com_error
|
||||||
border.width: 0
|
FluArea{
|
||||||
anchors.fill: container
|
paddings: 0
|
||||||
visible: opacity
|
border.width: 0
|
||||||
color:control.color
|
radius: 0
|
||||||
opacity: statusMode === FluStatusView.Error
|
color:control.color
|
||||||
Behavior on opacity {
|
ColumnLayout{
|
||||||
NumberAnimation { duration: 83 }
|
anchors.centerIn: parent
|
||||||
}
|
FluText{
|
||||||
ColumnLayout{
|
text:control.errorText
|
||||||
anchors.centerIn: parent
|
font: FluTextStyle.BodyStrong
|
||||||
FluText{
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text:control.errorText
|
}
|
||||||
font: FluTextStyle.BodyStrong
|
FluFilledButton{
|
||||||
Layout.alignment: Qt.AlignHCenter
|
id:btn_error
|
||||||
}
|
Layout.alignment: Qt.AlignHCenter
|
||||||
FluFilledButton{
|
text:control.errorButtonText
|
||||||
id:btn_error
|
onClicked:{
|
||||||
Layout.alignment: Qt.AlignHCenter
|
control.errorClicked()
|
||||||
text:control.errorButtonText
|
}
|
||||||
onClicked:{
|
|
||||||
control.errorClicked()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,6 +83,7 @@ TextField{
|
|||||||
right: parent.right
|
right: parent.right
|
||||||
rightMargin: closeRightMargin
|
rightMargin: closeRightMargin
|
||||||
}
|
}
|
||||||
|
contentDescription:"清空"
|
||||||
onClicked:{
|
onClicked:{
|
||||||
control.text = ""
|
control.text = ""
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user