From 7cd9b7c6bcef68af31bf03f0c2860aeb3b3c0ac1 Mon Sep 17 00:00:00 2001 From: "HARRISON-FENG\\FengJQ" Date: Thu, 3 Aug 2023 18:14:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99FluPaneItemSeparator=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?spacing=E5=92=8Csize=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/qml/global/ItemsOriginal.qml | 5 +++++ src/imports/FluentUI/Controls/FluDivider.qml | 13 ++++++++++++- src/imports/FluentUI/Controls/FluNavigationView.qml | 7 ++++--- .../FluentUI/Controls/FluPaneItemSeparator.qml | 2 ++ 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/example/qml/global/ItemsOriginal.qml b/example/qml/global/ItemsOriginal.qml index 5d8ad003..e6af8a6f 100644 --- a/example/qml/global/ItemsOriginal.qml +++ b/example/qml/global/ItemsOriginal.qml @@ -323,6 +323,11 @@ FluObject{ } } + FluPaneItemSeparator{ + spacing:20 + size:1 + } + FluPaneItemExpander{ title:lang.other icon:FluentIcons.Shop diff --git a/src/imports/FluentUI/Controls/FluDivider.qml b/src/imports/FluentUI/Controls/FluDivider.qml index 949eefd2..57710126 100644 --- a/src/imports/FluentUI/Controls/FluDivider.qml +++ b/src/imports/FluentUI/Controls/FluDivider.qml @@ -3,5 +3,16 @@ import QtQuick.Window import FluentUI Rectangle { - color: FluTheme.dark ? Qt.rgba(80/255,80/255,80/255,1) : Qt.rgba(210/255,210/255,210/255,1) + property real spacing + property alias separatorHeight:separator.height + + id:root + color:Qt.rgba(0,0,0,0) + height: spacing*2+separator.height + Rectangle{ + id:separator + color: FluTheme.dark ? Qt.rgba(80/255,80/255,80/255,1) : Qt.rgba(210/255,210/255,210/255,1) + width:parent.width + anchors.centerIn: parent + } } diff --git a/src/imports/FluentUI/Controls/FluNavigationView.qml b/src/imports/FluentUI/Controls/FluNavigationView.qml index 5fb2f898..8e94c068 100644 --- a/src/imports/FluentUI/Controls/FluNavigationView.qml +++ b/src/imports/FluentUI/Controls/FluNavigationView.qml @@ -110,11 +110,12 @@ Item { id:com_panel_item_separatorr FluDivider{ width: layout_list.width - height: { + spacing: model.spacing + separatorHeight: { if(model.parent){ - return model.parent.isExpand ? 1 : 0 + return model.parent.isExpand ? model.size : 0 } - return 1 + return model.size } } } diff --git a/src/imports/FluentUI/Controls/FluPaneItemSeparator.qml b/src/imports/FluentUI/Controls/FluPaneItemSeparator.qml index 0ebc9471..81ce0ce1 100644 --- a/src/imports/FluentUI/Controls/FluPaneItemSeparator.qml +++ b/src/imports/FluentUI/Controls/FluPaneItemSeparator.qml @@ -6,4 +6,6 @@ QtObject { readonly property string key : FluTools.uuid() property int _idx property var parent + property real spacing + property int size:1 }