From 82f606dd65c5ccaeaafa72c774715e8dcbb2d856 Mon Sep 17 00:00:00 2001 From: zhuzichu Date: Tue, 20 Jun 2023 12:53:32 +0800 Subject: [PATCH] update --- example/qml/page/T_Home.qml | 1 - example/qml/page/T_TextBox.qml | 3 +- .../FluentUI/Controls/FluContentPage.qml | 4 +- .../FluentUI/Controls/FluNavigationView.qml | 92 ++++++++++++++----- src/imports/FluentUI/Controls/FluPage.qml | 18 ++++ .../FluentUI/Controls/FluScrollablePage.qml | 4 +- .../FluentUI/Controls/FluTableView2.qml | 22 +---- 7 files changed, 93 insertions(+), 51 deletions(-) create mode 100644 src/imports/FluentUI/Controls/FluPage.qml diff --git a/example/qml/page/T_Home.qml b/example/qml/page/T_Home.qml index 5393328f..6ae4df10 100644 --- a/example/qml/page/T_Home.qml +++ b/example/qml/page/T_Home.qml @@ -17,7 +17,6 @@ FluScrollablePage{ desc:"The latest FluentUI controls and styles for your applications." url:"https://github.com/zhuzichu520/FluentUI" } - } Item{ diff --git a/example/qml/page/T_TextBox.qml b/example/qml/page/T_TextBox.qml index 531f62c6..23672668 100644 --- a/example/qml/page/T_TextBox.qml +++ b/example/qml/page/T_TextBox.qml @@ -7,8 +7,9 @@ import "qrc:///example/qml/component" FluScrollablePage{ - title:"TextBox" + pageMode: FluNavigationView.SingleInstance + title:"TextBox" FluArea{ Layout.fillWidth: true height: 68 diff --git a/src/imports/FluentUI/Controls/FluContentPage.qml b/src/imports/FluentUI/Controls/FluContentPage.qml index a117d2d5..6cbe771b 100644 --- a/src/imports/FluentUI/Controls/FluContentPage.qml +++ b/src/imports/FluentUI/Controls/FluContentPage.qml @@ -4,15 +4,13 @@ import QtQuick.Window import QtQuick.Controls import FluentUI -Item { +FluPage { property alias title: text_title.text default property alias content: container.data property int leftPadding: 10 property int topPadding: 0 property int rightPadding: 10 property int bottomPadding: 10 - property int pageMode: FluNavigationView.SingleTop - property string url: '' id:control FluText{ id:text_title diff --git a/src/imports/FluentUI/Controls/FluNavigationView.qml b/src/imports/FluentUI/Controls/FluNavigationView.qml index 5a738b8b..998525bf 100644 --- a/src/imports/FluentUI/Controls/FluNavigationView.qml +++ b/src/imports/FluentUI/Controls/FluNavigationView.qml @@ -15,7 +15,8 @@ Item { enum PageModeFlag{ Standard = 0, SingleTask = 1, - SingleTop = 2 + SingleTop = 2, + SingleInstance = 3 } property url logo property string title: "" @@ -30,6 +31,7 @@ Item { id:control QtObject{ id:d + property var pageMap: ({}) property var stackItems: [] property int displayMode: FluNavigationView.Open property bool enableNavigationPanel: false @@ -490,7 +492,7 @@ Item { } Connections{ target: d - function onIsCompactAndNotPanelChanged(){ + function onIsCompactAndNotPanelChanged(){ if(item_dot_loader.item){ item_dot_loader.item.isDot = d.isCompactAndNotPanel } @@ -532,6 +534,20 @@ Item { layout_footer.currentIndex = item.idx-(nav_list.count-layout_footer.count) } nav_list.currentIndex = item.idx + if(nav_swipe.currentItem.pageMode === FluNavigationView.SingleInstance){ + var url = nav_swipe.currentItem.url + var pageIndex = -1 + for(var i=0;i