From 887fd2c02b21d1eb2e14458eea4f2af1577b1e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Tue, 4 Jul 2023 22:38:56 +0800 Subject: [PATCH] update --- example/qml/page/T_Home.qml | 2 +- example/qml/page/T_RemoteLoader.qml | 2 +- example/qml/page/T_TextBox.qml | 2 +- example/qml/window/AboutItem.qml | 142 +++++++++ example/qml/window/MainWindow.qml | 1 + .../FluentUI/Controls/FluNavigationView.qml | 287 ++++++++++-------- src/imports/FluentUI/Controls/FluPage.qml | 9 +- src/imports/FluentUI/Controls/FluPaneItem.qml | 6 +- .../FluentUI/Controls/FluPaneItemEmpty.qml | 4 +- .../FluentUI/Controls/FluPaneItemExpander.qml | 4 +- .../FluentUI/Controls/FluPaneItemHeader.qml | 4 +- .../Controls/FluPaneItemSeparator.qml | 4 +- 12 files changed, 329 insertions(+), 138 deletions(-) create mode 100644 example/qml/window/AboutItem.qml diff --git a/example/qml/page/T_Home.qml b/example/qml/page/T_Home.qml index fc0e6e61..8b457558 100644 --- a/example/qml/page/T_Home.qml +++ b/example/qml/page/T_Home.qml @@ -7,7 +7,7 @@ import FluentUI FluScrollablePage{ - pageMode: FluNavigationView.SingleTask + launchMode: FluPage.SingleTask animDisabled: true ListModel{ diff --git a/example/qml/page/T_RemoteLoader.qml b/example/qml/page/T_RemoteLoader.qml index e10ac2f8..310d0718 100644 --- a/example/qml/page/T_RemoteLoader.qml +++ b/example/qml/page/T_RemoteLoader.qml @@ -6,7 +6,7 @@ import FluentUI import "qrc:///example/qml/component" FluPage{ - pageMode: FluNavigationView.SingleTop + launchMode: FluPage.SingleTop FluRemoteLoader{ anchors.fill: parent source: "https://zhu-zichu.gitee.io/T_RemoteLoader.qml" diff --git a/example/qml/page/T_TextBox.qml b/example/qml/page/T_TextBox.qml index 9e129a30..1fcc1a2a 100644 --- a/example/qml/page/T_TextBox.qml +++ b/example/qml/page/T_TextBox.qml @@ -7,7 +7,7 @@ import "qrc:///example/qml/component" FluScrollablePage{ - pageMode: FluNavigationView.SingleInstance + launchMode: FluPage.SingleInstance title:"TextBox" FluArea{ diff --git a/example/qml/window/AboutItem.qml b/example/qml/window/AboutItem.qml new file mode 100644 index 00000000..d6487fa9 --- /dev/null +++ b/example/qml/window/AboutItem.qml @@ -0,0 +1,142 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import FluentUI +import "qrc:///example/qml/component" + +Item { + ColumnLayout{ + anchors{ + top: parent.top + left: parent.left + right: parent.right + } + + RowLayout{ + Layout.topMargin: 20 + Layout.leftMargin: 15 + spacing: 14 + FluText{ + text:"FluentUI" + font: FluTextStyle.Title + MouseArea{ + anchors.fill: parent + onClicked: { + FluApp.navigate("/") + } + } + } + FluText{ + text:"v%1".arg(appInfo.version) + font: FluTextStyle.Body + Layout.alignment: Qt.AlignBottom + } + } + + RowLayout{ + spacing: 14 + Layout.topMargin: 20 + Layout.leftMargin: 15 + FluText{ + text:"作者:" + } + FluText{ + text:"朱子楚" + Layout.alignment: Qt.AlignBottom + } + } + + RowLayout{ + spacing: 14 + Layout.leftMargin: 15 + FluText{ + text:"GitHub:" + } + FluTextButton{ + id:text_hublink + topPadding:0 + bottomPadding:0 + text:"https://github.com/zhuzichu520/FluentUI" + Layout.alignment: Qt.AlignBottom + onClicked: { + Qt.openUrlExternally(text_hublink.text) + } + } + } + + RowLayout{ + spacing: 14 + Layout.leftMargin: 15 + FluText{ + text:"B站:" + } + FluTextButton{ + topPadding:0 + bottomPadding:0 + text:"https://www.bilibili.com/video/BV1mg4y1M71w/" + Layout.alignment: Qt.AlignBottom + onClicked: { + Qt.openUrlExternally(text) + } + } + } + + RowLayout{ + spacing: 14 + Layout.leftMargin: 15 + FluText{ + id:text_info + text:"如果该项目对你有作用,就请点击上方链接给一个免费的star,或者一键三连,谢谢!" + ColorAnimation { + id: animation + target: text_info + property: "color" + from: "red" + to: "blue" + duration: 1000 + running: true + loops: Animation.Infinite + easing.type: Easing.InOutQuad + } + } + } + + RowLayout{ + spacing: 14 + Layout.topMargin: 20 + Layout.leftMargin: 15 + FluText{ + text:"捐赠:" + } + } + + Item{ + Layout.preferredWidth: parent.width + Layout.preferredHeight: 252 + Row{ + anchors.horizontalCenter: parent.horizontalCenter + spacing: 30 + Image{ + width: 250 + height: 250 + source: "qrc:/example/res/image/qrcode_wx.jpg" + } + Image{ + width: 250 + height: 250 + source: "qrc:/example/res/image/qrcode_zfb.jpg" + } + } + } + + RowLayout{ + spacing: 14 + Layout.leftMargin: 15 + Layout.topMargin: 20 + FluText{ + id:text_desc + text:"个人开发,维护不易,你们的捐赠就是我继续更新的动力!\n有什么问题提Issues,只要时间充足我就会解决的!!" + } + } + } +} diff --git a/example/qml/window/MainWindow.qml b/example/qml/window/MainWindow.qml index 8d79f192..2a6b8702 100644 --- a/example/qml/window/MainWindow.qml +++ b/example/qml/window/MainWindow.qml @@ -168,6 +168,7 @@ CustomWindow { width: parent.width height: parent.height z:999 +// pageMode: FluNavigationView.NoStack items: ItemsOriginal footerItems:ItemsFooter topPadding:FluTools.isMacos() ? 20 : 5 diff --git a/src/imports/FluentUI/Controls/FluNavigationView.qml b/src/imports/FluentUI/Controls/FluNavigationView.qml index c518cc3f..8a34a821 100644 --- a/src/imports/FluentUI/Controls/FluNavigationView.qml +++ b/src/imports/FluentUI/Controls/FluNavigationView.qml @@ -12,21 +12,19 @@ Item { Minimal = 2, Auto = 3 } - enum PageModeFlag{ - Standard = 0, - SingleTask = 1, - SingleTop = 2, - SingleInstance = 3 + enum PageMode { + Stack = 0, + NoStack = 1 } property url logo property string title: "" property FluObject items property FluObject footerItems - property bool dontPageAnimation: false property int displayMode: FluNavigationView.Auto property Component autoSuggestBox property Component actionItem property int topPadding: 0 + property int pageMode: FluNavigationView.Stack signal logoClicked id:control QtObject{ @@ -43,21 +41,21 @@ Item { collapseAll() } function handleItems(){ - var idx = 0 + var _idx = 0 var data = [] if(items){ for(var i=0;i