Compare commits
No commits in common. "082fd79c5128e74eabe076d9c8bbf22daacc63bf" and "ad4d0774808f253baa3b3fc64a6ce11e51f9e439" have entirely different histories.
082fd79c51
...
ad4d077480
|
@ -24,7 +24,6 @@ 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,10 +168,7 @@ CustomWindow {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
z:999
|
z:999
|
||||||
//NoStack模式,每次切换都会销毁之前的页面然后创建一个新的页面,只需消耗少量内存(推荐)
|
// pageMode: FluNavigationView.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)
|
||||||
|
|
|
@ -5,6 +5,5 @@ import FluentUI
|
||||||
QtObject {
|
QtObject {
|
||||||
readonly property string _key : FluTools.uuid()
|
readonly property string _key : FluTools.uuid()
|
||||||
property int _idx
|
property int _idx
|
||||||
property var _ext
|
|
||||||
property var parent
|
property var parent
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,90 +19,77 @@ 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
|
||||||
}
|
}
|
||||||
Loader{
|
FluArea{
|
||||||
id:loader
|
paddings: 0
|
||||||
anchors.fill: parent
|
border.width: 0
|
||||||
visible: statusMode!==FluStatusView.Success
|
anchors.fill: container
|
||||||
sourceComponent: {
|
visible: opacity
|
||||||
if(statusMode === FluStatusView.Loading){
|
opacity: statusMode === FluStatusView.Loading
|
||||||
return loadingItem
|
Behavior on opacity {
|
||||||
}
|
NumberAnimation { duration: 83 }
|
||||||
if(statusMode === FluStatusView.Empty){
|
|
||||||
return emptyItem
|
|
||||||
}
|
|
||||||
if(statusMode === FluStatusView.Error){
|
|
||||||
return errorItem
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
}
|
||||||
}
|
color:control.color
|
||||||
Component{
|
ColumnLayout{
|
||||||
id:com_loading
|
anchors.centerIn: parent
|
||||||
FluArea{
|
visible: statusMode === FluStatusView.Loading
|
||||||
paddings: 0
|
FluProgressRing{
|
||||||
border.width: 0
|
indeterminate: true
|
||||||
radius: 0
|
Layout.alignment: Qt.AlignHCenter
|
||||||
color:control.color
|
}
|
||||||
ColumnLayout{
|
FluText{
|
||||||
anchors.centerIn: parent
|
text:control.loadingText
|
||||||
FluProgressRing{
|
Layout.alignment: Qt.AlignHCenter
|
||||||
indeterminate: true
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
}
|
|
||||||
FluText{
|
|
||||||
text:control.loadingText
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component {
|
FluArea{
|
||||||
id:com_empty
|
paddings: 0
|
||||||
FluArea{
|
border.width: 0
|
||||||
paddings: 0
|
anchors.fill: container
|
||||||
border.width: 0
|
visible: opacity
|
||||||
radius: 0
|
color:control.color
|
||||||
color:control.color
|
opacity: statusMode === FluStatusView.Empty
|
||||||
ColumnLayout{
|
Behavior on opacity {
|
||||||
anchors.centerIn: parent
|
NumberAnimation { duration: 83 }
|
||||||
FluText{
|
}
|
||||||
text:control.emptyText
|
ColumnLayout{
|
||||||
font: FluTextStyle.BodyStrong
|
anchors.centerIn: parent
|
||||||
Layout.alignment: Qt.AlignHCenter
|
visible: statusMode === FluStatusView.Empty
|
||||||
}
|
FluText{
|
||||||
|
text:control.emptyText
|
||||||
|
font: FluTextStyle.BodyStrong
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component{
|
FluArea{
|
||||||
id:com_error
|
paddings: 0
|
||||||
FluArea{
|
border.width: 0
|
||||||
paddings: 0
|
anchors.fill: container
|
||||||
border.width: 0
|
visible: opacity
|
||||||
radius: 0
|
color:control.color
|
||||||
color:control.color
|
opacity: statusMode === FluStatusView.Error
|
||||||
ColumnLayout{
|
Behavior on opacity {
|
||||||
anchors.centerIn: parent
|
NumberAnimation { duration: 83 }
|
||||||
FluText{
|
}
|
||||||
text:control.errorText
|
ColumnLayout{
|
||||||
font: FluTextStyle.BodyStrong
|
anchors.centerIn: parent
|
||||||
Layout.alignment: Qt.AlignHCenter
|
FluText{
|
||||||
}
|
text:control.errorText
|
||||||
FluFilledButton{
|
font: FluTextStyle.BodyStrong
|
||||||
id:btn_error
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.alignment: Qt.AlignHCenter
|
}
|
||||||
text:control.errorButtonText
|
FluFilledButton{
|
||||||
onClicked:{
|
id:btn_error
|
||||||
control.errorClicked()
|
Layout.alignment: Qt.AlignHCenter
|
||||||
}
|
text:control.errorButtonText
|
||||||
|
onClicked:{
|
||||||
|
control.errorClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,6 @@ TextField{
|
||||||
right: parent.right
|
right: parent.right
|
||||||
rightMargin: closeRightMargin
|
rightMargin: closeRightMargin
|
||||||
}
|
}
|
||||||
contentDescription:"清空"
|
|
||||||
onClicked:{
|
onClicked:{
|
||||||
control.text = ""
|
control.text = ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue