From 4b3548563bde8f79450934585b3786bed22523a9 Mon Sep 17 00:00:00 2001 From: zhuzichu Date: Tue, 18 Jul 2023 14:07:07 +0800 Subject: [PATCH] update --- .../FluentUI/Controls/FluContentPage.qml | 24 +++++++- .../FluentUI/Controls/FluScrollablePage.qml | 61 +++++++++++-------- 2 files changed, 58 insertions(+), 27 deletions(-) diff --git a/src/imports/FluentUI/Controls/FluContentPage.qml b/src/imports/FluentUI/Controls/FluContentPage.qml index 6cbe771b..672c6f86 100644 --- a/src/imports/FluentUI/Controls/FluContentPage.qml +++ b/src/imports/FluentUI/Controls/FluContentPage.qml @@ -11,6 +11,17 @@ FluPage { property int topPadding: 0 property int rightPadding: 10 property int bottomPadding: 10 + property alias color: status_view.color + property alias statusMode: status_view.statusMode + property alias loadingText: status_view.loadingText + property alias emptyText:status_view.emptyText + property alias errorText:status_view.errorText + property alias errorButtonText:status_view.errorButtonText + property alias loadingItem :status_view.loadingItem + property alias emptyItem : status_view.emptyItem + property alias errorItem :status_view.errorItem + signal errorClicked + id:control FluText{ id:text_title @@ -26,9 +37,11 @@ FluPage { rightMargin: control.rightPadding } } - Item{ - clip: true - id:container + FluStatusView{ + id:status_view + color: "#00000000" + statusMode: FluStatusView.Success + onErrorClicked: control.errorClicked() anchors{ left: parent.left right: parent.right @@ -38,5 +51,10 @@ FluPage { rightMargin: control.rightPadding bottomMargin: control.bottomPadding } + Item{ + clip: true + id:container + anchors.fill: parent + } } } diff --git a/src/imports/FluentUI/Controls/FluScrollablePage.qml b/src/imports/FluentUI/Controls/FluScrollablePage.qml index 34fa0c00..d947f3f7 100644 --- a/src/imports/FluentUI/Controls/FluScrollablePage.qml +++ b/src/imports/FluentUI/Controls/FluScrollablePage.qml @@ -12,6 +12,16 @@ FluPage { property int topPadding: 0 property int rightPadding: 10 property int bottomPadding: 10 + property alias color: status_view.color + property alias statusMode: status_view.statusMode + property alias loadingText: status_view.loadingText + property alias emptyText:status_view.emptyText + property alias errorText:status_view.errorText + property alias errorButtonText:status_view.errorButtonText + property alias loadingItem :status_view.loadingItem + property alias emptyItem : status_view.emptyItem + property alias errorItem :status_view.errorItem + signal errorClicked id:control FluText{ id:text_title @@ -28,9 +38,11 @@ FluPage { rightMargin: control.rightPadding } } - Flickable{ - id:flickview - clip: true + FluStatusView{ + id:status_view + color: "#00000000" + statusMode: FluStatusView.Success + onErrorClicked: control.errorClicked() anchors{ left: parent.left right: parent.right @@ -38,29 +50,30 @@ FluPage { bottom: parent.bottom bottomMargin: control.bottomPadding } - contentWidth: parent.width - contentHeight: container.height - ScrollBar.vertical: FluScrollBar { - anchors.right: flickview.right - anchors.rightMargin: 2 - } - boundsBehavior: Flickable.StopAtBounds - anchors{ - top: text_title.bottom - bottom: parent.bottom - } - ColumnLayout{ - id:container - spacing: control.spacing + Flickable{ + id:flickview clip: true - anchors{ - left: parent.left - right: parent.right - top: parent.top - leftMargin: control.leftPadding - rightMargin: control.rightPadding + anchors.fill: parent + contentWidth: parent.width + contentHeight: container.height + ScrollBar.vertical: FluScrollBar { + anchors.right: flickview.right + anchors.rightMargin: 2 + } + boundsBehavior: Flickable.StopAtBounds + ColumnLayout{ + id:container + spacing: control.spacing + clip: true + anchors{ + left: parent.left + right: parent.right + top: parent.top + leftMargin: control.leftPadding + rightMargin: control.rightPadding + } + width: parent.width } - width: parent.width } } }