Merge pull request #232 from FeJQ/FluNavigationView-pr

给FluPaneItemSeparator增加spacing和size属性
This commit is contained in:
zhuzichu 2023-08-04 12:05:15 +08:00 committed by GitHub
commit 9bd98c68e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 4 deletions

View File

@ -323,6 +323,11 @@ FluObject{
} }
} }
FluPaneItemSeparator{
spacing:20
size:1
}
FluPaneItemExpander{ FluPaneItemExpander{
title:lang.other title:lang.other
icon:FluentIcons.Shop icon:FluentIcons.Shop

View File

@ -3,5 +3,16 @@ import QtQuick.Window
import FluentUI import FluentUI
Rectangle { Rectangle {
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) 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
}
} }

View File

@ -110,11 +110,12 @@ Item {
id:com_panel_item_separatorr id:com_panel_item_separatorr
FluDivider{ FluDivider{
width: layout_list.width width: layout_list.width
height: { spacing: model.spacing
separatorHeight: {
if(model.parent){ if(model.parent){
return model.parent.isExpand ? 1 : 0 return model.parent.isExpand ? model.size : 0
} }
return 1 return model.size
} }
} }
} }

View File

@ -6,4 +6,6 @@ QtObject {
readonly property string key : FluTools.uuid() readonly property string key : FluTools.uuid()
property int _idx property int _idx
property var parent property var parent
property real spacing
property int size:1
} }