This commit is contained in:
zhuzichu 2023-12-20 17:17:41 +08:00
parent 70e525f51e
commit f6cc83123b
6 changed files with 34 additions and 96 deletions

View File

@ -50,9 +50,7 @@ FluObject{
} }
title:"Buttons" title:"Buttons"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Button.png" extra:({image:"qrc:/example/res/image/control/Button.png",recentlyUpdated:true,desc:"A control that responds to user input and raisesa Click event."})
recentlyUpdated:true
desc:"A control that responds to user input and raisesa Click event."
url:"qrc:/example/qml/page/T_Buttons.qml" url:"qrc:/example/qml/page/T_Buttons.qml"
onTap:{ onTap:{
item_buttons.count = 0 item_buttons.count = 0
@ -83,18 +81,14 @@ FluObject{
FluPaneItem{ FluPaneItem{
title:"Slider" title:"Slider"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Slider.png" extra:({image:"qrc:/example/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."})
recentlyUpdated:true
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
url:"qrc:/example/qml/page/T_Slider.qml" url:"qrc:/example/qml/page/T_Slider.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
FluPaneItem{ FluPaneItem{
title:"CheckBox" title:"CheckBox"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Checkbox.png" extra:({image:"qrc:/example/res/image/control/Checkbox.png",recentlyUpdated:true,desc:"A control that a user can select or clear."})
recentlyUpdated:true
desc:"A control that a user can select or clear."
url:"qrc:/example/qml/page/T_CheckBox.qml" url:"qrc:/example/qml/page/T_CheckBox.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
@ -164,9 +158,7 @@ FluObject{
FluPaneItem{ FluPaneItem{
title:"InfoBar" title:"InfoBar"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/InfoBar.png" extra:({image:"qrc:/example/res/image/control/InfoBar.png",recentlyUpdated:true,desc:"An inline message to display app-wide statuschange information."})
recentlyUpdated:true
desc:"An inline message to display app-wide statuschange information."
url:"qrc:/example/qml/page/T_InfoBar.qml" url:"qrc:/example/qml/page/T_InfoBar.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
@ -276,10 +268,7 @@ FluObject{
FluPaneItem{ FluPaneItem{
title:"Pivot" title:"Pivot"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Pivot.png" extra:({image:"qrc:/example/res/image/control/Pivot.png",order:3,recentlyAdded:true,desc:"Presents information from different sources in atabbed view."})
recentlyAdded:true
order:3
desc:"Presents information from different sources in atabbed view."
url:"qrc:/example/qml/page/T_Pivot.qml" url:"qrc:/example/qml/page/T_Pivot.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
@ -292,10 +281,7 @@ FluObject{
FluPaneItem{ FluPaneItem{
title:"TabView" title:"TabView"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/TabView.png" extra:({image:"qrc:/example/res/image/control/TabView.png",order:1,recentlyAdded:true,desc:"A control that displays a collection of tabs thatcan be used to display several documents."})
recentlyAdded:true
order:1
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
url:"qrc:/example/qml/page/T_TabView.qml" url:"qrc:/example/qml/page/T_TabView.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
@ -308,10 +294,7 @@ FluObject{
FluPaneItem{ FluPaneItem{
title:"TableView" title:"TableView"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/DataGrid.png" extra:({image:"qrc:/example/res/image/control/DataGrid.png",order:4,recentlyAdded:true,desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"})
recentlyAdded:true
order:4
desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"
url:"qrc:/example/qml/page/T_TableView.qml" url:"qrc:/example/qml/page/T_TableView.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
@ -330,10 +313,7 @@ FluObject{
FluPaneItem{ FluPaneItem{
title:"FlipView" title:"FlipView"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/FlipView.png" extra:({image:"qrc:/example/res/image/control/FlipView.png",order:2,recentlyAdded:true,desc:"Presents a collection of items that the user canflip through, one item at a time."})
recentlyAdded:true
order:2
desc:"Presents a collection of items that the user canflip through, one item at a time."
url:"qrc:/example/qml/page/T_FlipView.qml" url:"qrc:/example/qml/page/T_FlipView.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
@ -490,21 +470,14 @@ FluObject{
function getRecentlyAddedData(){ function getRecentlyAddedData(){
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++){
if(item instanceof FluPaneItem && item.recentlyAdded){ var item = items[i]
if(item instanceof FluPaneItem && item.extra && item.extra.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)
} }
} arr.sort(function(o1,o2){ return o2.extra.order-o1.extra.order })
}
}
arr.sort(function(o1,o2){ return o2.order-o1.order })
return arr return arr
} }
@ -513,7 +486,7 @@ FluObject{
var items = navigationView.getItems(); var items = navigationView.getItems();
for(var i=0;i<items.length;i++){ for(var i=0;i<items.length;i++){
var item = items[i] var item = items[i]
if(item instanceof FluPaneItem && item.recentlyUpdated){ if(item instanceof FluPaneItem && item.extra && item.extra.recentlyUpdated){
arr.push(item) arr.push(item)
} }
} }

View File

@ -160,7 +160,7 @@ FluScrollablePage{
Component{ Component{
id:com_item id:com_item
Item{ Item{
property string desc: modelData.desc property string desc: modelData.extra.desc
width: 320 width: 320
height: 120 height: 120
FluArea{ FluArea{
@ -182,7 +182,7 @@ FluScrollablePage{
id:item_icon id:item_icon
height: 40 height: 40
width: 40 width: 40
source: modelData.image source: modelData.extra.image
anchors{ anchors{
left: parent.left left: parent.left
leftMargin: 20 leftMargin: 20

View File

@ -50,9 +50,7 @@ FluObject{
} }
title:"Buttons" title:"Buttons"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Button.png" extra:({image:"qrc:/example/res/image/control/Button.png",recentlyUpdated:true,desc:"A control that responds to user input and raisesa Click event."})
recentlyUpdated:true
desc:"A control that responds to user input and raisesa Click event."
url:"qrc:/example/qml/page/T_Buttons.qml" url:"qrc:/example/qml/page/T_Buttons.qml"
onTap:{ onTap:{
item_buttons.count = 0 item_buttons.count = 0
@ -83,18 +81,14 @@ FluObject{
FluPaneItem{ FluPaneItem{
title:"Slider" title:"Slider"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Slider.png" extra:({image:"qrc:/example/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."})
recentlyUpdated:true
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
url:"qrc:/example/qml/page/T_Slider.qml" url:"qrc:/example/qml/page/T_Slider.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
FluPaneItem{ FluPaneItem{
title:"CheckBox" title:"CheckBox"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Checkbox.png" extra:({image:"qrc:/example/res/image/control/Checkbox.png",recentlyUpdated:true,desc:"A control that a user can select or clear."})
recentlyUpdated:true
desc:"A control that a user can select or clear."
url:"qrc:/example/qml/page/T_CheckBox.qml" url:"qrc:/example/qml/page/T_CheckBox.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
@ -164,9 +158,7 @@ FluObject{
FluPaneItem{ FluPaneItem{
title:"InfoBar" title:"InfoBar"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/InfoBar.png" extra:({image:"qrc:/example/res/image/control/InfoBar.png",recentlyUpdated:true,desc:"An inline message to display app-wide statuschange information."})
recentlyUpdated:true
desc:"An inline message to display app-wide statuschange information."
url:"qrc:/example/qml/page/T_InfoBar.qml" url:"qrc:/example/qml/page/T_InfoBar.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
@ -276,10 +268,7 @@ FluObject{
FluPaneItem{ FluPaneItem{
title:"Pivot" title:"Pivot"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/Pivot.png" extra:({image:"qrc:/example/res/image/control/Pivot.png",order:3,recentlyAdded:true,desc:"Presents information from different sources in atabbed view."})
recentlyAdded:true
order:3
desc:"Presents information from different sources in atabbed view."
url:"qrc:/example/qml/page/T_Pivot.qml" url:"qrc:/example/qml/page/T_Pivot.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
@ -292,10 +281,7 @@ FluObject{
FluPaneItem{ FluPaneItem{
title:"TabView" title:"TabView"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/TabView.png" extra:({image:"qrc:/example/res/image/control/TabView.png",order:1,recentlyAdded:true,desc:"A control that displays a collection of tabs thatcan be used to display several documents."})
recentlyAdded:true
order:1
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
url:"qrc:/example/qml/page/T_TabView.qml" url:"qrc:/example/qml/page/T_TabView.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
@ -308,10 +294,7 @@ FluObject{
FluPaneItem{ FluPaneItem{
title:"TableView" title:"TableView"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/DataGrid.png" extra:({image:"qrc:/example/res/image/control/DataGrid.png",order:4,recentlyAdded:true,desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"})
recentlyAdded:true
order:4
desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"
url:"qrc:/example/qml/page/T_TableView.qml" url:"qrc:/example/qml/page/T_TableView.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
@ -330,10 +313,7 @@ FluObject{
FluPaneItem{ FluPaneItem{
title:"FlipView" title:"FlipView"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
image:"qrc:/example/res/image/control/FlipView.png" extra:({image:"qrc:/example/res/image/control/FlipView.png",order:2,recentlyAdded:true,desc:"Presents a collection of items that the user canflip through, one item at a time."})
recentlyAdded:true
order:2
desc:"Presents a collection of items that the user canflip through, one item at a time."
url:"qrc:/example/qml/page/T_FlipView.qml" url:"qrc:/example/qml/page/T_FlipView.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
@ -490,21 +470,14 @@ FluObject{
function getRecentlyAddedData(){ function getRecentlyAddedData(){
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++){
if(item instanceof FluPaneItem && item.recentlyAdded){ var item = items[i]
if(item instanceof FluPaneItem && item.extra && item.extra.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)
} }
} arr.sort(function(o1,o2){ return o2.extra.order-o1.extra.order })
}
}
arr.sort(function(o1,o2){ return o2.order-o1.order })
return arr return arr
} }
@ -513,7 +486,7 @@ FluObject{
var items = navigationView.getItems(); var items = navigationView.getItems();
for(var i=0;i<items.length;i++){ for(var i=0;i<items.length;i++){
var item = items[i] var item = items[i]
if(item instanceof FluPaneItem && item.recentlyUpdated){ if(item instanceof FluPaneItem && item.extra && item.extra.recentlyUpdated){
arr.push(item) arr.push(item)
} }
} }

View File

@ -160,7 +160,7 @@ FluScrollablePage{
Component{ Component{
id:com_item id:com_item
Item{ Item{
property string desc: modelData.desc property string desc: modelData.extra.desc
width: 320 width: 320
height: 120 height: 120
FluArea{ FluArea{
@ -182,7 +182,7 @@ FluScrollablePage{
id:item_icon id:item_icon
height: 40 height: 40
width: 40 width: 40
source: modelData.image source: modelData.extra.image
anchors{ anchors{
left: parent.left left: parent.left
leftMargin: 20 leftMargin: 20

View File

@ -8,21 +8,17 @@ QtObject {
property var _ext property var _ext
property var _parent property var _parent
property string title property string title
property int order : 0
property var url property var url
property bool disabled: false property bool disabled: false
property int icon property int icon
property bool iconVisible: true property bool iconVisible: true
property Component infoBadge property Component infoBadge
property bool recentlyAdded: false
property bool recentlyUpdated: false
property string desc
property var image
property int count: 0 property int count: 0
property var onTapListener property var onTapListener
property Component iconDelegate property Component iconDelegate
property Component menuDelegate property Component menuDelegate
property Component editDelegate property Component editDelegate
property var extra
property bool showEdit property bool showEdit
signal tap signal tap
} }

View File

@ -8,21 +8,17 @@ QtObject {
property var _ext property var _ext
property var _parent property var _parent
property string title property string title
property int order : 0
property var url property var url
property bool disabled: false property bool disabled: false
property int icon property int icon
property bool iconVisible: true property bool iconVisible: true
property Component infoBadge property Component infoBadge
property bool recentlyAdded: false
property bool recentlyUpdated: false
property string desc
property var image
property int count: 0 property int count: 0
property var onTapListener property var onTapListener
property Component iconDelegate property Component iconDelegate
property Component menuDelegate property Component menuDelegate
property Component editDelegate property Component editDelegate
property var extra
property bool showEdit property bool showEdit
signal tap signal tap
} }