mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-02-02 11:17:39 +08:00
update
This commit is contained in:
parent
d2e3e6dd4b
commit
0b37ddcb6e
@ -142,20 +142,6 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel{
|
|
||||||
id:model_added
|
|
||||||
Component.onCompleted: {
|
|
||||||
append(ItemsOriginal.getRecentlyAddedData())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListModel{
|
|
||||||
id:model_update
|
|
||||||
Component.onCompleted: {
|
|
||||||
append(ItemsOriginal.getRecentlyUpdatedData())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_item
|
id:com_item
|
||||||
Item{
|
Item{
|
||||||
@ -187,7 +173,7 @@ FluScrollablePage{
|
|||||||
id:item_icon
|
id:item_icon
|
||||||
height: 40
|
height: 40
|
||||||
width: 40
|
width: 40
|
||||||
source: model.image
|
source: modelData.image
|
||||||
anchors{
|
anchors{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: 20
|
leftMargin: 20
|
||||||
@ -197,7 +183,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:item_title
|
id:item_title
|
||||||
text:model.title
|
text:modelData.title
|
||||||
fontStyle: FluText.BodyStrong
|
fontStyle: FluText.BodyStrong
|
||||||
anchors{
|
anchors{
|
||||||
left: item_icon.right
|
left: item_icon.right
|
||||||
@ -208,7 +194,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:item_desc
|
id:item_desc
|
||||||
text:model.desc
|
text:modelData.desc
|
||||||
color:FluColors.Grey120
|
color:FluColors.Grey120
|
||||||
wrapMode: Text.WrapAnywhere
|
wrapMode: Text.WrapAnywhere
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
@ -241,7 +227,7 @@ FluScrollablePage{
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ItemsOriginal.startPageByItem(model)
|
ItemsOriginal.startPageByItem(modelData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,7 +246,7 @@ FluScrollablePage{
|
|||||||
implicitHeight: contentHeight
|
implicitHeight: contentHeight
|
||||||
cellHeight: 120
|
cellHeight: 120
|
||||||
cellWidth: 320
|
cellWidth: 320
|
||||||
model:model_added
|
model:ItemsOriginal.getRecentlyAddedData()
|
||||||
interactive: false
|
interactive: false
|
||||||
delegate: com_item
|
delegate: com_item
|
||||||
}
|
}
|
||||||
@ -278,7 +264,7 @@ FluScrollablePage{
|
|||||||
cellHeight: 120
|
cellHeight: 120
|
||||||
cellWidth: 320
|
cellWidth: 320
|
||||||
interactive: false
|
interactive: false
|
||||||
model: model_update
|
model: ItemsOriginal.getRecentlyUpdatedData()
|
||||||
delegate: com_item
|
delegate: com_item
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,224 +16,222 @@ FluObject{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItemHeader{
|
FluPaneItemExpander{
|
||||||
title:"Inputs"
|
title:"Basic input"
|
||||||
}
|
icon:FluentIcons.CheckboxComposite
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Buttons"
|
title:"Buttons"
|
||||||
image:"qrc:/res/image/control/Button.png"
|
image:"qrc:/res/image/control/Button.png"
|
||||||
recentlyUpdated:true
|
recentlyUpdated:true
|
||||||
desc:"A control that responds to user input and raisesa Click event."
|
desc:"A control that responds to user input and raisesa Click event."
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Buttons.qml")
|
navigationView.push("qrc:/T_Buttons.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Slider"
|
||||||
|
image:"qrc:/res/image/control/Slider.png"
|
||||||
|
recentlyUpdated:true
|
||||||
|
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Slider.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"CheckBox"
|
||||||
|
image:"qrc:/res/image/control/Checkbox.png"
|
||||||
|
recentlyUpdated:true
|
||||||
|
desc:"A control that a user can select or clear."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_CheckBox.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"ToggleSwitch"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_ToggleSwitch.qml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItemExpander{
|
||||||
title:"Slider"
|
|
||||||
image:"qrc:/res/image/control/Slider.png"
|
|
||||||
recentlyUpdated:true
|
|
||||||
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Slider.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"CheckBox"
|
|
||||||
image:"qrc:/res/image/control/Checkbox.png"
|
|
||||||
recentlyUpdated:true
|
|
||||||
desc:"A control that a user can select or clear."
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_CheckBox.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"ToggleSwitch"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_ToggleSwitch.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Form"
|
title:"Form"
|
||||||
}
|
icon:FluentIcons.GridView
|
||||||
|
FluPaneItem{
|
||||||
FluPaneItem{
|
title:"TextBox"
|
||||||
title:"TextBox"
|
onTap:{
|
||||||
onTap:{
|
navigationView.push("qrc:/T_TextBox.qml")
|
||||||
navigationView.push("qrc:/T_TextBox.qml")
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"TimePicker"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_TimePicker.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"DatePicker"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_DatePicker.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"CalendarPicker"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_CalendarPicker.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"ColorPicker"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_ColorPicker.qml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"TimePicker"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_TimePicker.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItemExpander{
|
||||||
title:"DatePicker"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_DatePicker.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"CalendarPicker"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_CalendarPicker.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"ColorPicker"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_ColorPicker.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Surface"
|
title:"Surface"
|
||||||
}
|
icon:FluentIcons.SurfaceHub
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"InfoBar"
|
title:"InfoBar"
|
||||||
image:"qrc:/res/image/control/InfoBar.png"
|
image:"qrc:/res/image/control/InfoBar.png"
|
||||||
recentlyUpdated:true
|
recentlyUpdated:true
|
||||||
desc:"An inline message to display app-wide statuschange information."
|
desc:"An inline message to display app-wide statuschange information."
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_InfoBar.qml")
|
navigationView.push("qrc:/T_InfoBar.qml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Progress"
|
title:"Progress"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Progress.qml")
|
navigationView.push("qrc:/T_Progress.qml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Badge"
|
title:"Badge"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Badge.qml")
|
navigationView.push("qrc:/T_Badge.qml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Rectangle"
|
title:"Rectangle"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Rectangle.qml")
|
navigationView.push("qrc:/T_Rectangle.qml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Carousel"
|
title:"Carousel"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Carousel.qml")
|
navigationView.push("qrc:/T_Carousel.qml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Expander"
|
title:"Expander"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Expander.qml")
|
navigationView.push("qrc:/T_Expander.qml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItemHeader{
|
FluPaneItemExpander{
|
||||||
title:"Popus"
|
title:"Popus"
|
||||||
}
|
icon:FluentIcons.ButtonMenu
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Dialog"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Dialog.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Dialog"
|
title:"Tooltip"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Dialog.qml")
|
navigationView.push("qrc:/T_Tooltip.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Menu"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Menu.qml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItemExpander{
|
||||||
title:"Tooltip"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Tooltip.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Menu"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Menu.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Navigation"
|
title:"Navigation"
|
||||||
}
|
icon:FluentIcons.AllApps
|
||||||
|
FluPaneItem{
|
||||||
FluPaneItem{
|
title:"TabView"
|
||||||
title:"TabView"
|
image:"qrc:/res/image/control/TabView.png"
|
||||||
image:"qrc:/res/image/control/TabView.png"
|
recentlyAdded:true
|
||||||
recentlyAdded:true
|
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
|
||||||
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
|
onTap:{
|
||||||
onTap:{
|
navigationView.push("qrc:/T_TabView.qml")
|
||||||
navigationView.push("qrc:/T_TabView.qml")
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"TreeView"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_TreeView.qml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"TreeView"
|
title:"MultiWindow"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_TreeView.qml")
|
navigationView.push("qrc:/T_MultiWindow.qml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItemExpander{
|
||||||
title:"MultiWindow"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_MultiWindow.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Theming"
|
title:"Theming"
|
||||||
}
|
icon:FluentIcons.Brightness
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Theme"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Theme.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItem{
|
||||||
title:"Theme"
|
title:"Awesome"
|
||||||
onTap:{
|
onTap:{
|
||||||
navigationView.push("qrc:/T_Theme.qml")
|
navigationView.push("qrc:/T_Awesome.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Typography"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/T_Typography.qml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluPaneItem{
|
FluPaneItemExpander{
|
||||||
title:"Awesome"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Awesome.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Typography"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Typography.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Media"
|
title:"Media"
|
||||||
}
|
icon:FluentIcons.Media
|
||||||
|
FluPaneItem{
|
||||||
FluPaneItem{
|
title:"MediaPlayer"
|
||||||
title:"MediaPlayer"
|
image:"qrc:/res/image/control/MediaPlayerElement.png"
|
||||||
image:"qrc:/res/image/control/MediaPlayerElement.png"
|
recentlyAdded:true
|
||||||
recentlyAdded:true
|
desc:"A control to display video and image content."
|
||||||
desc:"A control to display video and image content."
|
onTap:{
|
||||||
onTap:{
|
navigationView.push("qrc:/T_MediaPlayer.qml")
|
||||||
navigationView.push("qrc:/T_MediaPlayer.qml")
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,14 +242,23 @@ FluObject{
|
|||||||
if(item instanceof FluPaneItem && item.recentlyAdded){
|
if(item instanceof FluPaneItem && item.recentlyAdded){
|
||||||
arr.push(item)
|
arr.push(item)
|
||||||
}
|
}
|
||||||
|
if(item instanceof FluPaneItemExpander){
|
||||||
|
for(var j=0;j<item.children.length;j++){
|
||||||
|
var itemChild = item.children[j]
|
||||||
|
if(itemChild instanceof FluPaneItem && itemChild.recentlyAdded){
|
||||||
|
arr.push(itemChild)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRecentlyUpdatedData(){
|
function getRecentlyUpdatedData(){
|
||||||
var arr = []
|
var arr = []
|
||||||
for(var i=0;i<children.length;i++){
|
var items = navigationView.getItems();
|
||||||
var item = children[i]
|
for(var i=0;i<items.length;i++){
|
||||||
|
var item = items[i]
|
||||||
if(item instanceof FluPaneItem && item.recentlyUpdated){
|
if(item instanceof FluPaneItem && item.recentlyUpdated){
|
||||||
arr.push(item)
|
arr.push(item)
|
||||||
}
|
}
|
||||||
@ -261,8 +268,9 @@ FluObject{
|
|||||||
|
|
||||||
function getSearchData(){
|
function getSearchData(){
|
||||||
var arr = []
|
var arr = []
|
||||||
for(var i=0;i<children.length;i++){
|
var items = navigationView.getItems();
|
||||||
var item = children[i]
|
for(var i=0;i<items.length;i++){
|
||||||
|
var item = items[i]
|
||||||
if(item instanceof FluPaneItem){
|
if(item instanceof FluPaneItem){
|
||||||
arr.push({title:item.title,key:item.key})
|
arr.push({title:item.title,key:item.key})
|
||||||
}
|
}
|
||||||
@ -270,14 +278,19 @@ FluObject{
|
|||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
|
|
||||||
function startPageByItem(item){
|
function startPageByItem(data){
|
||||||
for(var i=0;i<children.length;i++){
|
var items = navigationView.getItems();
|
||||||
if(children[i].key === item.key){
|
for(var i=0;i<items.length;i++){
|
||||||
|
var item = items[i]
|
||||||
|
if(item.key === data.key){
|
||||||
if(navigationView.getCurrentIndex() === i){
|
if(navigationView.getCurrentIndex() === i){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
children[i].tap()
|
item.tap()
|
||||||
navigationView.setCurrentIndex(i)
|
navigationView.setCurrentIndex(i)
|
||||||
|
if(item.parent){
|
||||||
|
item.parent.isExpand = true
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ FluWindow {
|
|||||||
fontStyle: FluText.Title
|
fontStyle: FluText.Title
|
||||||
}
|
}
|
||||||
FluText{
|
FluText{
|
||||||
text:"v1.1.6"
|
text:"v1.1.7"
|
||||||
fontStyle: FluText.Body
|
fontStyle: FluText.Body
|
||||||
Layout.alignment: Qt.AlignBottom
|
Layout.alignment: Qt.AlignBottom
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,8 @@ void Fluent::registerTypes(const char *uri){
|
|||||||
|
|
||||||
qmlRegisterType<WindowHelper>(uri,major,minor,"WindowHelper");
|
qmlRegisterType<WindowHelper>(uri,major,minor,"WindowHelper");
|
||||||
qmlRegisterType<FluColorSet>(uri,major,minor,"FluColorSet");
|
qmlRegisterType<FluColorSet>(uri,major,minor,"FluColorSet");
|
||||||
|
|
||||||
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluPaneItemExpander.qml"),uri,major,minor,"FluPaneItemExpander");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTabView.qml"),uri,major,minor,"FluTabView");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluTabView.qml"),uri,major,minor,"FluTabView");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluArea.qml"),uri,major,minor,"FluArea");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluArea.qml"),uri,major,minor,"FluArea");
|
||||||
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluBadge.qml"),uri,major,minor,"FluBadge");
|
qmlRegisterType(QUrl("qrc:/com.zhuzichu/controls/FluBadge.qml"),uri,major,minor,"FluBadge");
|
||||||
|
@ -48,14 +48,34 @@ Item {
|
|||||||
id:com_panel_item_separatorr
|
id:com_panel_item_separatorr
|
||||||
FluDivider{
|
FluDivider{
|
||||||
width: nav_list.width
|
width: nav_list.width
|
||||||
height: 1
|
height: {
|
||||||
|
if(model.parent){
|
||||||
|
return model.parent.isExpand ? 1 : 0
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
Behavior on height {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_panel_item_header
|
id:com_panel_item_header
|
||||||
Item{
|
Item{
|
||||||
height: 30
|
height: {
|
||||||
|
if(model.parent){
|
||||||
|
return model.parent.isExpand ? 30 : 0
|
||||||
|
}
|
||||||
|
return 30
|
||||||
|
}
|
||||||
|
Behavior on height {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
width: nav_list.width
|
width: nav_list.width
|
||||||
FluText{
|
FluText{
|
||||||
text:model.title
|
text:model.title
|
||||||
@ -70,11 +90,131 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_panel_item
|
id:com_panel_item_expander
|
||||||
Item{
|
Item{
|
||||||
height: 38
|
height: 38
|
||||||
width: nav_list.width
|
width: nav_list.width
|
||||||
|
|
||||||
|
Rectangle{
|
||||||
|
radius: 4
|
||||||
|
anchors{
|
||||||
|
top: parent.top
|
||||||
|
bottom: parent.bottom
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
topMargin: 2
|
||||||
|
bottomMargin: 2
|
||||||
|
leftMargin: 6
|
||||||
|
rightMargin: 6
|
||||||
|
}
|
||||||
|
Rectangle{
|
||||||
|
width: 3
|
||||||
|
height: 18
|
||||||
|
radius: 1.5
|
||||||
|
color: FluTheme.primaryColor.dark
|
||||||
|
visible: {
|
||||||
|
for(var i=0;i<model.children.length;i++){
|
||||||
|
var item = model.children[i]
|
||||||
|
if(item.idx === nav_list.currentIndex && !model.isExpand){
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluIcon{
|
||||||
|
rotation: model.isExpand?0:180
|
||||||
|
iconSource:FluentIcons.ChevronUp
|
||||||
|
iconSize: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
rightMargin: 12
|
||||||
|
}
|
||||||
|
Behavior on rotation {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MouseArea{
|
||||||
|
id:item_mouse
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
model.isExpand = !model.isExpand
|
||||||
|
}
|
||||||
|
}
|
||||||
|
color: {
|
||||||
|
if(FluTheme.dark){
|
||||||
|
if(item_mouse.containsMouse){
|
||||||
|
return Qt.rgba(1,1,1,0.03)
|
||||||
|
}
|
||||||
|
if((nav_list.currentIndex === position)&&type===0){
|
||||||
|
return Qt.rgba(1,1,1,0.06)
|
||||||
|
}
|
||||||
|
return Qt.rgba(0,0,0,0)
|
||||||
|
}else{
|
||||||
|
if(item_mouse.containsMouse){
|
||||||
|
return Qt.rgba(0,0,0,0.03)
|
||||||
|
}
|
||||||
|
if(nav_list.currentIndex === position&&type===0){
|
||||||
|
return Qt.rgba(0,0,0,0.06)
|
||||||
|
}
|
||||||
|
return Qt.rgba(0,0,0,0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluIcon{
|
||||||
|
id:item_icon
|
||||||
|
iconSource: {
|
||||||
|
if(model.icon){
|
||||||
|
return model.icon
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
width: 30
|
||||||
|
height: 30
|
||||||
|
iconSize: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left:parent.left
|
||||||
|
leftMargin: 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluText{
|
||||||
|
id:item_title
|
||||||
|
text:model.title
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left:item_icon.right
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component{
|
||||||
|
id:com_panel_item
|
||||||
|
Item{
|
||||||
|
Behavior on height {
|
||||||
|
NumberAnimation{
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clip: true
|
||||||
|
height: {
|
||||||
|
if(model.parent){
|
||||||
|
return model.parent.isExpand ? 38 : 0
|
||||||
|
}
|
||||||
|
return 38
|
||||||
|
}
|
||||||
|
width: nav_list.width
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
radius: 4
|
radius: 4
|
||||||
anchors{
|
anchors{
|
||||||
@ -330,11 +470,7 @@ Item {
|
|||||||
}
|
}
|
||||||
ScrollBar.vertical: FluScrollBar {}
|
ScrollBar.vertical: FluScrollBar {}
|
||||||
|
|
||||||
model:{
|
model:handleItems()
|
||||||
if(items){
|
|
||||||
return items.children
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delegate: Loader{
|
delegate: Loader{
|
||||||
property var model: modelData
|
property var model: modelData
|
||||||
property var position: index
|
property var position: index
|
||||||
@ -349,6 +485,9 @@ Item {
|
|||||||
if(modelData instanceof FluPaneItemSeparator){
|
if(modelData instanceof FluPaneItemSeparator){
|
||||||
return com_panel_item_separatorr
|
return com_panel_item_separatorr
|
||||||
}
|
}
|
||||||
|
if(modelData instanceof FluPaneItemExpander){
|
||||||
|
return com_panel_item_expander
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -383,6 +522,33 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleItems(){
|
||||||
|
var idx = 0
|
||||||
|
var data = []
|
||||||
|
if(items){
|
||||||
|
for(var i=0;i<items.children.length;i++){
|
||||||
|
var item = items.children[i]
|
||||||
|
item.idx = idx
|
||||||
|
data.push(item)
|
||||||
|
idx++
|
||||||
|
if(item instanceof FluPaneItemExpander){
|
||||||
|
for(var j=0;j<item.children.length;j++){
|
||||||
|
var itemChild = item.children[j]
|
||||||
|
itemChild.parent = item
|
||||||
|
itemChild.idx = idx
|
||||||
|
data.push(itemChild)
|
||||||
|
idx++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
|
function getItems(){
|
||||||
|
return nav_list.model
|
||||||
|
}
|
||||||
|
|
||||||
function push(url){
|
function push(url){
|
||||||
nav_swipe.push(url)
|
nav_swipe.push(url)
|
||||||
}
|
}
|
||||||
|
@ -3,12 +3,15 @@ import FluentUI
|
|||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
readonly property string key : FluApp.uuid()
|
readonly property string key : FluApp.uuid()
|
||||||
|
readonly property int flag : 0
|
||||||
property string title
|
property string title
|
||||||
property int icon
|
property int icon
|
||||||
property bool recentlyAdded: false
|
property bool recentlyAdded: false
|
||||||
property bool recentlyUpdated: false
|
property bool recentlyUpdated: false
|
||||||
property string desc
|
property string desc
|
||||||
property var image
|
property var image
|
||||||
|
property var parent
|
||||||
|
property int idx
|
||||||
signal tap
|
signal tap
|
||||||
signal repTap
|
signal repTap
|
||||||
}
|
}
|
||||||
|
14
src/controls/FluPaneItemExpander.qml
Normal file
14
src/controls/FluPaneItemExpander.qml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import QtQuick
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluObject {
|
||||||
|
readonly property int flag : 3
|
||||||
|
readonly property string key : FluApp.uuid()
|
||||||
|
property string title
|
||||||
|
property int icon
|
||||||
|
property bool isExpand: false
|
||||||
|
property var parent
|
||||||
|
property int idx
|
||||||
|
signal tap
|
||||||
|
signal repTap
|
||||||
|
}
|
@ -1,6 +1,9 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
readonly property int flag : 1
|
||||||
readonly property string key : FluApp.uuid()
|
readonly property string key : FluApp.uuid()
|
||||||
property string title
|
property string title
|
||||||
|
property var parent
|
||||||
|
property int idx
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
readonly property int flag : 2
|
||||||
readonly property string key : FluApp.uuid()
|
readonly property string key : FluApp.uuid()
|
||||||
|
property var parent
|
||||||
|
property int idx
|
||||||
}
|
}
|
||||||
|
@ -59,5 +59,6 @@
|
|||||||
<file>controls/FluMediaPlayer.qml</file>
|
<file>controls/FluMediaPlayer.qml</file>
|
||||||
<file>controls/FluTabView.qml</file>
|
<file>controls/FluTabView.qml</file>
|
||||||
<file>controls/FluItem.qml</file>
|
<file>controls/FluItem.qml</file>
|
||||||
|
<file>controls/FluPaneItemExpander.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Loading…
Reference in New Issue
Block a user