From fa77ed616313869f0fda4fe0c771eb03d6e9c441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Thu, 2 Nov 2023 23:02:08 +0800 Subject: [PATCH] update --- example/qml-Qt6/window/MainWindow.qml | 2 +- example/qml-Qt6/window/PageWindow.qml | 2 +- example/qml/window/MainWindow.qml | 2 +- example/qml/window/PageWindow.qml | 2 +- src/FluentUI.cpp | 2 + .../FluentUI/Controls/FluCalendarView.qml | 2 +- .../imports/FluentUI/Controls/FluCarousel.qml | 4 +- .../FluentUI/Controls/FluDatePicker.qml | 6 +-- .../FluentUI/Controls/FluIconButton.qml | 4 +- .../imports/FluentUI/Controls/FluImage.qml | 2 +- .../imports/FluentUI/Controls/FluInfoBar.qml | 2 +- .../imports/FluentUI/Controls/FluMenuItem.qml | 2 +- .../FluentUI/Controls/FluNavigationView.qml | 40 +++++++------------ .../imports/FluentUI/Controls/FluPivot.qml | 2 +- .../FluentUI/Controls/FluRemoteLoader.qml | 2 +- .../FluentUI/Controls/FluStatusView.qml | 2 +- .../imports/FluentUI/Controls/FluTabView.qml | 2 +- .../FluentUI/Controls/FluTableView.qml | 12 +++--- .../FluentUI/Controls/FluTimePicker.qml | 6 +-- .../imports/FluentUI/Controls/FluTimeline.qml | 6 +-- src/Qt5/imports/FluentUI/Controls/FluTour.qml | 4 +- .../imports/FluentUI/Controls/FluTreeView.qml | 8 ++-- .../imports/FluentUI/Controls/FluWindow.qml | 6 +-- src/Qt5/imports/FluentUI/qmldir | 1 + src/Qt5/imports/fluentui.qrc | 1 + .../FluentUI/Controls/FluCalendarView.qml | 2 +- .../imports/FluentUI/Controls/FluCarousel.qml | 4 +- .../FluentUI/Controls/FluDatePicker.qml | 6 +-- .../FluentUI/Controls/FluIconButton.qml | 6 +-- .../imports/FluentUI/Controls/FluImage.qml | 2 +- .../imports/FluentUI/Controls/FluInfoBar.qml | 2 +- .../imports/FluentUI/Controls/FluMenuItem.qml | 2 +- .../FluentUI/Controls/FluNavigationView.qml | 28 ++++++------- .../imports/FluentUI/Controls/FluPivot.qml | 2 +- .../FluentUI/Controls/FluRemoteLoader.qml | 2 +- .../FluentUI/Controls/FluStatusView.qml | 2 +- .../imports/FluentUI/Controls/FluTabView.qml | 2 +- .../FluentUI/Controls/FluTableView.qml | 12 +++--- .../FluentUI/Controls/FluTimePicker.qml | 6 +-- .../imports/FluentUI/Controls/FluTimeline.qml | 6 +-- src/Qt6/imports/FluentUI/Controls/FluTour.qml | 4 +- .../imports/FluentUI/Controls/FluTreeView.qml | 8 ++-- .../imports/FluentUI/Controls/FluWindow.qml | 6 +-- 43 files changed, 111 insertions(+), 115 deletions(-) diff --git a/example/qml-Qt6/window/MainWindow.qml b/example/qml-Qt6/window/MainWindow.qml index b7d76df2..5f97bf4d 100644 --- a/example/qml-Qt6/window/MainWindow.qml +++ b/example/qml-Qt6/window/MainWindow.qml @@ -244,7 +244,7 @@ FluWindow { } } - Loader{ + FluLoader{ id:loader_reveal anchors.fill: parent } diff --git a/example/qml-Qt6/window/PageWindow.qml b/example/qml-Qt6/window/PageWindow.qml index 129141ac..4e67cb49 100644 --- a/example/qml-Qt6/window/PageWindow.qml +++ b/example/qml-Qt6/window/PageWindow.qml @@ -18,7 +18,7 @@ FluWindow { window.title = arg.title loader.setSource( arg.url,{animDisabled:true}) } - Loader{ + FluLoader{ id: loader anchors.fill: parent } diff --git a/example/qml/window/MainWindow.qml b/example/qml/window/MainWindow.qml index 4e7e4740..7d100a04 100644 --- a/example/qml/window/MainWindow.qml +++ b/example/qml/window/MainWindow.qml @@ -247,7 +247,7 @@ FluWindow { } } - Loader{ + FluLoader{ id:loader_reveal anchors.fill: parent } diff --git a/example/qml/window/PageWindow.qml b/example/qml/window/PageWindow.qml index 4ac73699..f6f4f8ef 100644 --- a/example/qml/window/PageWindow.qml +++ b/example/qml/window/PageWindow.qml @@ -19,7 +19,7 @@ FluWindow { window.title = arg.title loader.setSource( arg.url,{animDisabled:true}) } - Loader{ + FluLoader{ id: loader anchors.fill: parent } diff --git a/src/FluentUI.cpp b/src/FluentUI.cpp index 266f09b5..702da9ea 100644 --- a/src/FluentUI.cpp +++ b/src/FluentUI.cpp @@ -151,6 +151,8 @@ void FluentUI::registerTypes(const char *uri){ qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluProgressButton.qml"),uri,major,minor,"FluProgressButton"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluLoadingButton.qml"),uri,major,minor,"FluLoadingButton"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluClip.qml"),uri,major,minor,"FluClip"); + qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluLoader.qml"),uri,major,minor,"FluLoader"); + qmlRegisterUncreatableMetaObject(Fluent_Awesome::staticMetaObject, uri,major,minor,"FluentIcons", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluHttpType::staticMetaObject, uri,major,minor,"FluHttpType", "Access to enums & flags only"); diff --git a/src/Qt5/imports/FluentUI/Controls/FluCalendarView.qml b/src/Qt5/imports/FluentUI/Controls/FluCalendarView.qml index 952d6a95..0a3cba0b 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluCalendarView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluCalendarView.qml @@ -331,7 +331,7 @@ Item { cellWidth: displayMode === FluCalendarViewType.Month ? 40 : 70 clip: true boundsBehavior:Flickable.StopAtBounds - delegate: Loader{ + delegate: FluLoader{ property var modelData : model property var name : model.name property var date : model.date diff --git a/src/Qt5/imports/FluentUI/Controls/FluCarousel.qml b/src/Qt5/imports/FluentUI/Controls/FluCarousel.qml index a62cb1a1..4ee914f0 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluCarousel.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluCarousel.qml @@ -75,7 +75,7 @@ Item { return 0 return index-1 } - Loader{ + FluLoader{ property int displayIndex : item_control.displayIndex property var model: list_view.model.get(index) anchors.fill: parent @@ -156,7 +156,7 @@ Item { Repeater{ id:repeater_indicator model: list_view.count - Loader{ + FluLoader{ property int displayIndex: { if(index === 0) return list_view.count-3 diff --git a/src/Qt5/imports/FluentUI/Controls/FluDatePicker.qml b/src/Qt5/imports/FluentUI/Controls/FluDatePicker.qml index 894def8b..eaa261f7 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluDatePicker.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluDatePicker.qml @@ -232,7 +232,7 @@ Rectangle { preferredHighlightEnd: 0 highlightMoveDuration: 0 visible: showYear - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property int type:0 property int position:index @@ -254,7 +254,7 @@ Rectangle { preferredHighlightEnd: 0 highlightMoveDuration: 0 boundsBehavior:Flickable.StopAtBounds - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property int type:1 property int position:index @@ -277,7 +277,7 @@ Rectangle { ScrollBar.vertical: FluScrollBar {} Layout.alignment: Qt.AlignVCenter boundsBehavior:Flickable.StopAtBounds - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property int type:2 property int position:index diff --git a/src/Qt5/imports/FluentUI/Controls/FluIconButton.qml b/src/Qt5/imports/FluentUI/Controls/FluIconButton.qml index 8f071df0..edf70651 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluIconButton.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluIconButton.qml @@ -71,7 +71,7 @@ Button { Component{ id:com_row RowLayout{ - Loader{ + FluLoader{ sourceComponent: iconDelegate Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter visible: display !== Button.TextOnly @@ -86,7 +86,7 @@ Button { Component{ id:com_column ColumnLayout{ - Loader{ + FluLoader{ sourceComponent: iconDelegate Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter visible: display !== Button.TextOnly diff --git a/src/Qt5/imports/FluentUI/Controls/FluImage.qml b/src/Qt5/imports/FluentUI/Controls/FluImage.qml index b1001e3d..964cd102 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluImage.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluImage.qml @@ -11,7 +11,7 @@ Image { property Component errorItem : com_error property Component loadingItem: com_loading id: control - Loader{ + FluLoader{ anchors.fill: parent sourceComponent: { if(control.status === Image.Loading){ diff --git a/src/Qt5/imports/FluentUI/Controls/FluInfoBar.qml b/src/Qt5/imports/FluentUI/Controls/FluInfoBar.qml index e4a159dd..27ce39ea 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluInfoBar.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluInfoBar.qml @@ -86,7 +86,7 @@ FluObject { interval: duration; running: duration > 0; repeat: duration > 0 onTriggered: content.close(); } - Loader{ + FluLoader{ id:loader; x:(parent.width - width) / 2; property var _super: content; diff --git a/src/Qt5/imports/FluentUI/Controls/FluMenuItem.qml b/src/Qt5/imports/FluentUI/Controls/FluMenuItem.qml index f06be1b1..f057b6fd 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluMenuItem.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluMenuItem.qml @@ -60,7 +60,7 @@ T.MenuItem { right: parent.right rightMargin: (control.mirrored ? indicatorPadding : arrowPadding)+5 } - Loader{ + FluLoader{ id:loader_icon sourceComponent: iconDelegate anchors.verticalCenter: parent.verticalCenter diff --git a/src/Qt5/imports/FluentUI/Controls/FluNavigationView.qml b/src/Qt5/imports/FluentUI/Controls/FluNavigationView.qml index 88c43937..6b9264be 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluNavigationView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluNavigationView.qml @@ -334,7 +334,7 @@ Item { left:parent.left leftMargin: 3 } - Loader{ + FluLoader{ anchors.centerIn: parent sourceComponent: { if(model&&model.iconDelegate){ @@ -342,7 +342,6 @@ Item { } return com_icon } - Component.onDestruction: sourceComponent = undefined } } FluText{ @@ -381,7 +380,7 @@ Item { return FluTheme.dark ? FluColors.White : FluColors.Grey220 } } - Loader{ + FluLoader{ id:item_edit_loader anchors{ top: parent.top @@ -390,7 +389,6 @@ Item { right: item_title.right rightMargin: 8 } - Component.onDestruction: sourceComponent = undefined sourceComponent: { if(d.isCompact){ return undefined @@ -398,7 +396,7 @@ Item { return model&&model.showEdit ? model.editDelegate : undefined } onStatusChanged: { - if(status === Loader.Ready){ + if(status === FluLoader.Ready){ item.forceActiveFocus() item_connection_edit_focus.target = item } @@ -554,9 +552,8 @@ Item { left:parent.left leftMargin: 3 } - Loader{ + FluLoader{ anchors.centerIn: parent - Component.onDestruction: sourceComponent = undefined sourceComponent: { if(model&&model.iconDelegate){ return model.iconDelegate @@ -601,7 +598,7 @@ Item { right: item_dot_loader.left } } - Loader{ + FluLoader{ id:item_edit_loader anchors{ top: parent.top @@ -619,9 +616,8 @@ Item { } return model.showEdit ? model.editDelegate : undefined } - Component.onDestruction: sourceComponent = undefined onStatusChanged: { - if(status === Loader.Ready){ + if(status === FluLoader.Ready){ item.forceActiveFocus() item_connection_edit_focus.target = item } @@ -640,7 +636,7 @@ Item { } } } - Loader{ + FluLoader{ id:item_dot_loader property bool isDot: (item_dot_loader.item&&item_dot_loader.item.isDot) anchors{ @@ -655,7 +651,6 @@ Item { } return undefined } - Component.onDestruction: sourceComponent = undefined Connections{ target: d function onIsCompactAndNotPanelChanged(){ @@ -785,11 +780,10 @@ Item { } return 0 } - Loader{ + FluLoader{ id:loader_action anchors.centerIn: parent sourceComponent: actionItem - Component.onDestruction: sourceComponent = undefined } } } @@ -828,7 +822,7 @@ Item { } } } - Loader{ + FluLoader{ id:loader_content anchors{ left: parent.left @@ -845,7 +839,6 @@ Item { return control.cellWidth } } - Component.onDestruction: sourceComponent = undefined Behavior on anchors.leftMargin { enabled: FluTheme.enableAnimation && d.animDisabled NumberAnimation{ @@ -915,7 +908,7 @@ Item { clip: true y:nav_app_bar.height+control.topPadding height: autoSuggestBox ? 38 : 0 - Loader{ + FluLoader{ id:loader_auto_suggest_box sourceComponent: autoSuggestBox anchors{ @@ -925,7 +918,6 @@ Item { rightMargin: 6 verticalCenter: parent.verticalCenter } - Component.onDestruction: sourceComponent = undefined visible: { if(d.isCompactAndNotPanel){ return false @@ -993,11 +985,10 @@ Item { } } currentIndex: -1 - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property var _idx: index property int type: 0 - Component.onDestruction: sourceComponent = undefined sourceComponent: { if(model === null || !model) return undefined @@ -1051,11 +1042,10 @@ Item { } } } - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property var _idx: index property int type: 1 - Component.onDestruction: sourceComponent = undefined sourceComponent: { if(modelData instanceof FluPaneItem){ return com_panel_item @@ -1117,14 +1107,13 @@ Item { radius:4 } - Loader{ + FluLoader{ id:item_dot_loader anchors{ right: parent.right verticalCenter: parent.verticalCenter rightMargin: 10 } - Component.onDestruction: sourceComponent = undefined sourceComponent: { if(model.infoBadge){ return model.infoBadge @@ -1175,9 +1164,8 @@ Item { control_popup.open() } } - Loader{ + FluLoader{ property var modelData - Component.onDestruction: sourceComponent = undefined id:loader_item_menu } Connections{ diff --git a/src/Qt5/imports/FluentUI/Controls/FluPivot.qml b/src/Qt5/imports/FluentUI/Controls/FluPivot.qml index 1fac4100..1a850bf5 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluPivot.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluPivot.qml @@ -84,7 +84,7 @@ Page { anchors.fill: parent Repeater{ model:d.children - Loader{ + FluLoader{ property var argument: modelData.argument anchors.fill: parent sourceComponent: modelData.contentItem diff --git a/src/Qt5/imports/FluentUI/Controls/FluRemoteLoader.qml b/src/Qt5/imports/FluentUI/Controls/FluRemoteLoader.qml index 0e5c6f53..ffd725ac 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluRemoteLoader.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluRemoteLoader.qml @@ -15,7 +15,7 @@ FluStatusView { loader.source = control.source } } - Loader{ + FluLoader{ id:loader anchors.fill: parent asynchronous: true diff --git a/src/Qt5/imports/FluentUI/Controls/FluStatusView.qml b/src/Qt5/imports/FluentUI/Controls/FluStatusView.qml index 1b6d9c99..2dbd28de 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluStatusView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluStatusView.qml @@ -23,7 +23,7 @@ Item{ anchors.fill: parent visible: statusMode===FluStatusViewType.Success } - Loader{ + FluLoader{ id:loader anchors.fill: parent visible: statusMode!==FluStatusViewType.Success diff --git a/src/Qt5/imports/FluentUI/Controls/FluTabView.qml b/src/Qt5/imports/FluentUI/Controls/FluTabView.qml index 507152fe..5f8612aa 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTabView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTabView.qml @@ -273,7 +273,7 @@ Item { } Repeater{ model:tab_model - Loader{ + FluLoader{ property var argument: model.argument anchors.fill: parent sourceComponent: model.page diff --git a/src/Qt5/imports/FluentUI/Controls/FluTableView.qml b/src/Qt5/imports/FluentUI/Controls/FluTableView.qml index deb060c9..4cdf0139 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTableView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTableView.qml @@ -301,7 +301,7 @@ Rectangle { event.accepted = true } } - Loader{ + FluLoader{ property var itemModel: model property var modelData: display property var tableView: table_view @@ -341,7 +341,7 @@ Rectangle { onEntered: { d.rowHoverIndex = -1 } - Loader{ + FluLoader{ id:item_loader property var display property int column @@ -393,8 +393,10 @@ Rectangle { property bool canceled: false property int columnIndex: column readonly property var obj : columnSource[column] - implicitWidth: item_column_loader.item.implicitWidth + (cellPadding * 2) - implicitHeight: Math.max(36, item_column_loader.item.implicitHeight + (cellPadding * 2)) + implicitWidth: { + return (item_column_loader.item && item_column_loader.item.implicitWidth) + (cellPadding * 2) + } + implicitHeight: Math.max(36, (item_column_loader.item&&item_column_loader.item.implicitHeight) + (cellPadding * 2)) color: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1) Rectangle{ border.color: control.borderColor @@ -443,7 +445,7 @@ Rectangle { closeEditor() } } - Loader{ + FluLoader{ id:item_column_loader property var itemModel: model property var modelData: model.display diff --git a/src/Qt5/imports/FluentUI/Controls/FluTimePicker.qml b/src/Qt5/imports/FluentUI/Controls/FluTimePicker.qml index b17e89d8..7319d96c 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTimePicker.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTimePicker.qml @@ -238,7 +238,7 @@ Rectangle { highlightMoveDuration: 0 model: isH ? generateArray(1,12) : generateArray(0,23) clip: true - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property int type:0 property int position:index @@ -261,7 +261,7 @@ Rectangle { highlightMoveDuration: 0 ScrollBar.vertical: FluScrollBar {} boundsBehavior:Flickable.StopAtBounds - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property int type:1 property int position:index @@ -287,7 +287,7 @@ Rectangle { ScrollBar.vertical: FluScrollBar {} Layout.alignment: Qt.AlignVCenter boundsBehavior:Flickable.StopAtBounds - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property int type:2 property int position:index diff --git a/src/Qt5/imports/FluentUI/Controls/FluTimeline.qml b/src/Qt5/imports/FluentUI/Controls/FluTimeline.qml index 92b1f954..297473d0 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTimeline.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTimeline.qml @@ -116,7 +116,7 @@ Item{ id:item_layout width: layout_column.width height: loader_text.height - Loader{ + FluLoader{ id:item_loader state: d.stateName states: [ @@ -149,7 +149,7 @@ Item{ } } - Loader{ + FluLoader{ property var modelData: control.model.get(index) property bool isRight: state === "Right" id:loader_lable @@ -219,7 +219,7 @@ Item{ ] } - Loader{ + FluLoader{ id:loader_text property var modelData: control.model.get(index) property bool isRight: state === "Right" diff --git a/src/Qt5/imports/FluentUI/Controls/FluTour.qml b/src/Qt5/imports/FluentUI/Controls/FluTour.qml index 4f4f52ad..d9febaac 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTour.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTour.qml @@ -155,7 +155,7 @@ Popup{ leftMargin: 15 } } - Loader{ + FluLoader{ id:loader_next property bool isEnd: control.index === steps.length-1 sourceComponent: com_next_button @@ -166,7 +166,7 @@ Popup{ rightMargin: 15 } } - Loader{ + FluLoader{ id:loader_prev visible: control.index !== 0 sourceComponent: com_prev_button diff --git a/src/Qt5/imports/FluentUI/Controls/FluTreeView.qml b/src/Qt5/imports/FluentUI/Controls/FluTreeView.qml index 0d4a8151..17b99f6c 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTreeView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTreeView.qml @@ -86,7 +86,7 @@ Item { ListView.onPooled: { item_loader_container.item.pooled() } - Loader{ + FluLoader{ property var itemControl: item_control property var itemModel: dataModel property int rowIndex: index @@ -95,7 +95,7 @@ Item { sourceComponent: com_item_container } } - Loader{ + FluLoader{ id:loader_container property var itemControl property var itemModel @@ -357,7 +357,7 @@ Item { } } - Loader{ + FluLoader{ id:item_loader_expand Layout.preferredWidth: 20 Layout.preferredHeight: 20 @@ -381,7 +381,7 @@ Item { } Layout.alignment: Qt.AlignVCenter } - Loader{ + FluLoader{ property var dataModel: itemModel property var itemMouse: item_mouse id:item_loader_cell diff --git a/src/Qt5/imports/FluentUI/Controls/FluWindow.qml b/src/Qt5/imports/FluentUI/Controls/FluWindow.qml index 4923d123..3c5717e2 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluWindow.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluWindow.qml @@ -94,11 +94,11 @@ Window { showStayTop: window.showStayTop } } - Loader{ + FluLoader{ anchors.fill: parent sourceComponent: background } - Loader{ + FluLoader{ id: loader_title_bar anchors { top: parent.top @@ -117,7 +117,7 @@ Window { } clip: true } - Loader{ + FluLoader{ property string loadingText: "加载中..." property bool cancel: false id:loader_loading diff --git a/src/Qt5/imports/FluentUI/qmldir b/src/Qt5/imports/FluentUI/qmldir index 6dd6d003..848c58d6 100644 --- a/src/Qt5/imports/FluentUI/qmldir +++ b/src/Qt5/imports/FluentUI/qmldir @@ -95,4 +95,5 @@ FluStaggeredView 1.0 Controls/FluStaggeredView.qml FluProgressButton 1.0 Controls/FluProgressButton.qml FluLoadingButton 1.0 Controls/FluLoadingButton.qml FluClip 1.0 Controls/FluClip.qml +FluLoader 1.0 Controls/FluLoader.qml plugin fluentuiplugin diff --git a/src/Qt5/imports/fluentui.qrc b/src/Qt5/imports/fluentui.qrc index 97ec984e..e4da5df8 100644 --- a/src/Qt5/imports/fluentui.qrc +++ b/src/Qt5/imports/fluentui.qrc @@ -95,5 +95,6 @@ FluentUI/Controls/ColorPicker/Content/SBPicker.qml FluentUI/Controls/FluLoadingButton.qml FluentUI/Controls/FluClip.qml + FluentUI/Controls/FluLoader.qml diff --git a/src/Qt6/imports/FluentUI/Controls/FluCalendarView.qml b/src/Qt6/imports/FluentUI/Controls/FluCalendarView.qml index 63bdcd52..50d293fc 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluCalendarView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluCalendarView.qml @@ -331,7 +331,7 @@ Item { cellWidth: displayMode === FluCalendarViewType.Month ? 40 : 70 clip: true boundsBehavior:Flickable.StopAtBounds - delegate: Loader{ + delegate: FluLoader{ property var modelData : model property var name : model.name property var date : model.date diff --git a/src/Qt6/imports/FluentUI/Controls/FluCarousel.qml b/src/Qt6/imports/FluentUI/Controls/FluCarousel.qml index 454c8c4a..844b8d9d 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluCarousel.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluCarousel.qml @@ -75,7 +75,7 @@ Item { return 0 return index-1 } - Loader{ + FluLoader{ property int displayIndex : item_control.displayIndex property var model: list_view.model.get(index) anchors.fill: parent @@ -156,7 +156,7 @@ Item { Repeater{ id:repeater_indicator model: list_view.count - Loader{ + FluLoader{ property int displayIndex: { if(index === 0) return list_view.count-3 diff --git a/src/Qt6/imports/FluentUI/Controls/FluDatePicker.qml b/src/Qt6/imports/FluentUI/Controls/FluDatePicker.qml index 95f08830..5862fad1 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluDatePicker.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluDatePicker.qml @@ -232,7 +232,7 @@ Rectangle { preferredHighlightEnd: 0 highlightMoveDuration: 0 visible: showYear - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property int type:0 property int position:index @@ -254,7 +254,7 @@ Rectangle { preferredHighlightEnd: 0 highlightMoveDuration: 0 boundsBehavior:Flickable.StopAtBounds - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property int type:1 property int position:index @@ -277,7 +277,7 @@ Rectangle { ScrollBar.vertical: FluScrollBar {} Layout.alignment: Qt.AlignVCenter boundsBehavior:Flickable.StopAtBounds - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property int type:2 property int position:index diff --git a/src/Qt6/imports/FluentUI/Controls/FluIconButton.qml b/src/Qt6/imports/FluentUI/Controls/FluIconButton.qml index 316badc1..dd72c91a 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluIconButton.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluIconButton.qml @@ -72,7 +72,7 @@ Button { Component{ id:com_row RowLayout{ - Loader{ + FluLoader{ sourceComponent: iconDelegate Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter visible: display !== Button.TextOnly @@ -87,7 +87,7 @@ Button { Component{ id:com_column ColumnLayout{ - Loader{ + FluLoader{ sourceComponent: iconDelegate Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter visible: display !== Button.TextOnly @@ -99,7 +99,7 @@ Button { } } } - contentItem:Loader{ + contentItem:FluLoader{ sourceComponent: { if(display === Button.TextUnderIcon){ return com_column diff --git a/src/Qt6/imports/FluentUI/Controls/FluImage.qml b/src/Qt6/imports/FluentUI/Controls/FluImage.qml index 4b02185a..09ecdf95 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluImage.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluImage.qml @@ -11,7 +11,7 @@ Image { property Component errorItem : com_error property Component loadingItem: com_loading id: control - Loader{ + FluLoader{ anchors.fill: parent sourceComponent: { if(control.status === Image.Loading){ diff --git a/src/Qt6/imports/FluentUI/Controls/FluInfoBar.qml b/src/Qt6/imports/FluentUI/Controls/FluInfoBar.qml index 4633cde0..731d66b1 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluInfoBar.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluInfoBar.qml @@ -86,7 +86,7 @@ FluObject { interval: duration; running: duration > 0; repeat: duration > 0 onTriggered: content.close(); } - Loader{ + FluLoader{ id:loader; x:(parent.width - width) / 2; property var _super: content; diff --git a/src/Qt6/imports/FluentUI/Controls/FluMenuItem.qml b/src/Qt6/imports/FluentUI/Controls/FluMenuItem.qml index 57b7d8c2..6417dd3d 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluMenuItem.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluMenuItem.qml @@ -61,7 +61,7 @@ T.MenuItem { right: parent.right rightMargin: (control.mirrored ? indicatorPadding : arrowPadding)+5 } - Loader{ + FluLoader{ id:loader_icon sourceComponent: iconDelegate anchors.verticalCenter: parent.verticalCenter diff --git a/src/Qt6/imports/FluentUI/Controls/FluNavigationView.qml b/src/Qt6/imports/FluentUI/Controls/FluNavigationView.qml index 4571e347..d6af70a1 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluNavigationView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluNavigationView.qml @@ -335,7 +335,7 @@ Item { left:parent.left leftMargin: 3 } - Loader{ + FluLoader{ anchors.centerIn: parent sourceComponent: { if(model&&model.iconDelegate){ @@ -382,7 +382,7 @@ Item { return FluTheme.dark ? FluColors.White : FluColors.Grey220 } } - Loader{ + FluLoader{ id:item_edit_loader anchors{ top: parent.top @@ -399,7 +399,7 @@ Item { return model&&model.showEdit ? model.editDelegate : undefined } onStatusChanged: { - if(status === Loader.Ready){ + if(status === FluLoader.Ready){ item.forceActiveFocus() item_connection_edit_focus.target = item } @@ -555,7 +555,7 @@ Item { left:parent.left leftMargin: 3 } - Loader{ + FluLoader{ anchors.centerIn: parent Component.onDestruction: sourceComponent = undefined sourceComponent: { @@ -602,7 +602,7 @@ Item { right: item_dot_loader.left } } - Loader{ + FluLoader{ id:item_edit_loader anchors{ top: parent.top @@ -622,7 +622,7 @@ Item { } Component.onDestruction: sourceComponent = undefined onStatusChanged: { - if(status === Loader.Ready){ + if(status === FluLoader.Ready){ item.forceActiveFocus() item_connection_edit_focus.target = item } @@ -641,7 +641,7 @@ Item { } } } - Loader{ + FluLoader{ id:item_dot_loader property bool isDot: (item_dot_loader.item&&item_dot_loader.item.isDot) anchors{ @@ -786,7 +786,7 @@ Item { } return 0 } - Loader{ + FluLoader{ id:loader_action anchors.centerIn: parent sourceComponent: actionItem @@ -829,7 +829,7 @@ Item { } } } - Loader{ + FluLoader{ id:loader_content anchors{ left: parent.left @@ -916,7 +916,7 @@ Item { clip: true y:nav_app_bar.height+control.topPadding height: autoSuggestBox ? 38 : 0 - Loader{ + FluLoader{ id:loader_auto_suggest_box sourceComponent: autoSuggestBox anchors{ @@ -994,7 +994,7 @@ Item { } } currentIndex: -1 - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property var _idx: index property int type: 0 @@ -1052,7 +1052,7 @@ Item { } } } - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property var _idx: index property int type: 1 @@ -1118,7 +1118,7 @@ Item { radius:4 } - Loader{ + FluLoader{ id:item_dot_loader anchors{ right: parent.right @@ -1176,7 +1176,7 @@ Item { control_popup.open() } } - Loader{ + FluLoader{ property var modelData Component.onDestruction: sourceComponent = undefined id:loader_item_menu diff --git a/src/Qt6/imports/FluentUI/Controls/FluPivot.qml b/src/Qt6/imports/FluentUI/Controls/FluPivot.qml index e2a10f63..df0374ca 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluPivot.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluPivot.qml @@ -84,7 +84,7 @@ Page { anchors.fill: parent Repeater{ model:d.children - Loader{ + FluLoader{ property var argument: modelData.argument anchors.fill: parent sourceComponent: modelData.contentItem diff --git a/src/Qt6/imports/FluentUI/Controls/FluRemoteLoader.qml b/src/Qt6/imports/FluentUI/Controls/FluRemoteLoader.qml index 3001b2da..e1f6267e 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluRemoteLoader.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluRemoteLoader.qml @@ -15,7 +15,7 @@ FluStatusView { loader.source = control.source } } - Loader{ + FluLoader{ id:loader anchors.fill: parent asynchronous: true diff --git a/src/Qt6/imports/FluentUI/Controls/FluStatusView.qml b/src/Qt6/imports/FluentUI/Controls/FluStatusView.qml index 22bd7522..9f7b9a48 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluStatusView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluStatusView.qml @@ -22,7 +22,7 @@ Item{ anchors.fill: parent visible: statusMode===FluStatusViewType.Success } - Loader{ + FluLoader{ id:loader anchors.fill: parent visible: statusMode!==FluStatusViewType.Success diff --git a/src/Qt6/imports/FluentUI/Controls/FluTabView.qml b/src/Qt6/imports/FluentUI/Controls/FluTabView.qml index 9f905e71..652e9a53 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTabView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTabView.qml @@ -273,7 +273,7 @@ Item { } Repeater{ model:tab_model - Loader{ + FluLoader{ property var argument: model.argument anchors.fill: parent sourceComponent: model.page diff --git a/src/Qt6/imports/FluentUI/Controls/FluTableView.qml b/src/Qt6/imports/FluentUI/Controls/FluTableView.qml index 8e3543e5..0f91a282 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTableView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTableView.qml @@ -302,7 +302,7 @@ Rectangle { event.accepted = true } } - Loader{ + FluLoader{ property var itemModel: model property var modelData: display property var tableView: table_view @@ -342,7 +342,7 @@ Rectangle { onEntered: { d.rowHoverIndex = -1 } - Loader{ + FluLoader{ id:item_loader property var display property int column @@ -394,8 +394,10 @@ Rectangle { property bool canceled: false property int columnIndex: column readonly property var obj : columnSource[column] - implicitWidth: item_column_loader.item.implicitWidth + (cellPadding * 2) - implicitHeight: Math.max(36, item_column_loader.item.implicitHeight + (cellPadding * 2)) + implicitWidth: { + return (item_column_loader.item && item_column_loader.item.implicitWidth) + (cellPadding * 2) + } + implicitHeight: Math.max(36, (item_column_loader.item&&item_column_loader.item.implicitHeight) + (cellPadding * 2)) color: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1) Rectangle{ border.color: control.borderColor @@ -444,7 +446,7 @@ Rectangle { closeEditor() } } - Loader{ + FluLoader{ id:item_column_loader property var itemModel: model property var modelData: model.display diff --git a/src/Qt6/imports/FluentUI/Controls/FluTimePicker.qml b/src/Qt6/imports/FluentUI/Controls/FluTimePicker.qml index 3116dc1e..9dfd3ea9 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTimePicker.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTimePicker.qml @@ -238,7 +238,7 @@ Rectangle { highlightMoveDuration: 0 model: isH ? generateArray(1,12) : generateArray(0,23) clip: true - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property int type:0 property int position:index @@ -261,7 +261,7 @@ Rectangle { highlightMoveDuration: 0 ScrollBar.vertical: FluScrollBar {} boundsBehavior:Flickable.StopAtBounds - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property int type:1 property int position:index @@ -287,7 +287,7 @@ Rectangle { ScrollBar.vertical: FluScrollBar {} Layout.alignment: Qt.AlignVCenter boundsBehavior:Flickable.StopAtBounds - delegate: Loader{ + delegate: FluLoader{ property var model: modelData property int type:2 property int position:index diff --git a/src/Qt6/imports/FluentUI/Controls/FluTimeline.qml b/src/Qt6/imports/FluentUI/Controls/FluTimeline.qml index 37f69e94..167736e2 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTimeline.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTimeline.qml @@ -116,7 +116,7 @@ Item{ id:item_layout width: layout_column.width height: loader_text.height - Loader{ + FluLoader{ id:item_loader state: d.stateName states: [ @@ -149,7 +149,7 @@ Item{ } } - Loader{ + FluLoader{ property var modelData: control.model.get(index) property bool isRight: state === "Right" id:loader_lable @@ -219,7 +219,7 @@ Item{ ] } - Loader{ + FluLoader{ id:loader_text property var modelData: control.model.get(index) property bool isRight: state === "Right" diff --git a/src/Qt6/imports/FluentUI/Controls/FluTour.qml b/src/Qt6/imports/FluentUI/Controls/FluTour.qml index e664b7c1..4fb4b2de 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTour.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTour.qml @@ -144,7 +144,7 @@ Popup{ leftMargin: 15 } } - Loader{ + FluLoader{ id:loader_next property bool isEnd: control.index === steps.length-1 sourceComponent: com_next_button @@ -155,7 +155,7 @@ Popup{ rightMargin: 15 } } - Loader{ + FluLoader{ id:loader_prev visible: control.index !== 0 sourceComponent: com_prev_button diff --git a/src/Qt6/imports/FluentUI/Controls/FluTreeView.qml b/src/Qt6/imports/FluentUI/Controls/FluTreeView.qml index de2bd0fe..12ef0a60 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTreeView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTreeView.qml @@ -86,7 +86,7 @@ Item { ListView.onPooled: { item_loader_container.item.pooled() } - Loader{ + FluLoader{ property var itemControl: item_control property var itemModel: dataModel property int rowIndex: index @@ -95,7 +95,7 @@ Item { sourceComponent: com_item_container } } - Loader{ + FluLoader{ id:loader_container property var itemControl property var itemModel @@ -357,7 +357,7 @@ Item { } } - Loader{ + FluLoader{ id:item_loader_expand Layout.preferredWidth: 20 Layout.preferredHeight: 20 @@ -381,7 +381,7 @@ Item { } Layout.alignment: Qt.AlignVCenter } - Loader{ + FluLoader{ property var dataModel: itemModel property var itemMouse: item_mouse id:item_loader_cell diff --git a/src/Qt6/imports/FluentUI/Controls/FluWindow.qml b/src/Qt6/imports/FluentUI/Controls/FluWindow.qml index ab157809..f82f57ce 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluWindow.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluWindow.qml @@ -93,11 +93,11 @@ Window { showStayTop: window.showStayTop } } - Loader{ + FluLoader{ anchors.fill: parent sourceComponent: background } - Loader{ + FluLoader{ id: loader_title_bar anchors { top: parent.top @@ -116,7 +116,7 @@ Window { } clip: true } - Loader{ + FluLoader{ property string loadingText: "加载中..." property bool cancel: false id:loader_loading