FluentUI/example/qml/global/ItemsOriginal.qml

339 lines
9.9 KiB
QML
Raw Normal View History

2023-03-30 17:16:57 +08:00
pragma Singleton
2023-03-30 21:52:55 +08:00
import QtQuick
import FluentUI
2023-03-30 17:16:57 +08:00
FluObject{
property var navigationView
FluPaneItem{
2023-04-14 17:07:54 +08:00
title:lang.home
2023-05-09 19:52:35 +08:00
icon:FluentIcons.Home
// cusIcon: Image{
// anchors.centerIn: parent
// source: FluTheme.dark ? "qrc:/example/res/svg/home_dark.svg" : "qrc:/example/res/svg/home.svg"
// sourceSize: Qt.size(30,30)
// width: 18
// height: 18
// }
2023-03-30 17:16:57 +08:00
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Home.qml")
2023-03-30 17:16:57 +08:00
}
}
2023-03-31 22:05:25 +08:00
FluPaneItemExpander{
2023-04-14 17:07:54 +08:00
title:lang.basic_input
2023-03-31 22:05:25 +08:00
icon:FluentIcons.CheckboxComposite
FluPaneItem{
title:"Buttons"
2023-04-27 09:38:57 +08:00
image:"qrc:/example/res/image/control/Button.png"
2023-03-31 22:05:25 +08:00
recentlyUpdated:true
desc:"A control that responds to user input and raisesa Click event."
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Buttons.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-05-09 19:52:35 +08:00
FluPaneItem{
title:"Text"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Text.qml")
}
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"Slider"
2023-04-27 09:38:57 +08:00
image:"qrc:/example/res/image/control/Slider.png"
2023-03-31 22:05:25 +08:00
recentlyUpdated:true
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Slider.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"CheckBox"
2023-04-27 09:38:57 +08:00
image:"qrc:/example/res/image/control/Checkbox.png"
2023-03-31 22:05:25 +08:00
recentlyUpdated:true
desc:"A control that a user can select or clear."
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_CheckBox.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"ToggleSwitch"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_ToggleSwitch.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
}
2023-03-31 22:05:25 +08:00
FluPaneItemExpander{
2023-04-14 17:07:54 +08:00
title:lang.form
2023-03-31 22:05:25 +08:00
icon:FluentIcons.GridView
FluPaneItem{
title:"TextBox"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_TextBox.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"TimePicker"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_TimePicker.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"DatePicker"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_DatePicker.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"CalendarPicker"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_CalendarPicker.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"ColorPicker"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_ColorPicker.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
}
2023-03-31 22:05:25 +08:00
FluPaneItemExpander{
2023-04-14 17:07:54 +08:00
title:lang.surface
2023-03-31 22:05:25 +08:00
icon:FluentIcons.SurfaceHub
FluPaneItem{
title:"InfoBar"
2023-04-27 09:38:57 +08:00
image:"qrc:/example/res/image/control/InfoBar.png"
2023-03-31 22:05:25 +08:00
recentlyUpdated:true
desc:"An inline message to display app-wide statuschange information."
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_InfoBar.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"Progress"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Progress.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-04-14 15:18:08 +08:00
FluPaneItem{
title:"RatingControl"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_RatingControl.qml")
2023-04-14 15:18:08 +08:00
}
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"Badge"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Badge.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"Rectangle"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Rectangle.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-04-09 19:29:50 +08:00
FluPaneItem{
title:"StatusView"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_StatusView.qml")
2023-04-09 19:29:50 +08:00
}
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"Carousel"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Carousel.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"Expander"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Expander.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
}
2023-03-31 22:05:25 +08:00
FluPaneItemExpander{
2023-04-14 17:07:54 +08:00
title:lang.popus
2023-03-31 22:05:25 +08:00
icon:FluentIcons.ButtonMenu
FluPaneItem{
title:"Dialog"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Dialog.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"Tooltip"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Tooltip.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"Menu"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Menu.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
}
2023-03-31 22:05:25 +08:00
FluPaneItemExpander{
2023-04-14 17:07:54 +08:00
title:lang.navigation
2023-03-31 22:05:25 +08:00
icon:FluentIcons.AllApps
2023-04-04 15:09:34 +08:00
FluPaneItem{
title:"Pivot"
2023-04-27 09:38:57 +08:00
image:"qrc:/example/res/image/control/Pivot.png"
2023-04-04 15:09:34 +08:00
recentlyAdded:true
order:3
desc:"Presents information from different sources in atabbed view."
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Pivot.qml")
2023-04-04 15:09:34 +08:00
}
}
2023-04-24 17:02:26 +08:00
FluPaneItem{
title:"BreadcrumbBar"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_BreadcrumbBar.qml")
2023-04-24 17:02:26 +08:00
}
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"TabView"
2023-04-27 09:38:57 +08:00
image:"qrc:/example/res/image/control/TabView.png"
2023-03-31 22:05:25 +08:00
recentlyAdded:true
2023-04-02 14:05:54 +08:00
order:1
2023-03-31 22:05:25 +08:00
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_TabView.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"TreeView"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_TreeView.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-04-07 18:27:50 +08:00
FluPaneItem{
title:"TableView"
2023-04-27 09:38:57 +08:00
image:"qrc:/example/res/image/control/DataGrid.png"
2023-04-07 20:19:18 +08:00
recentlyAdded:true
order:4
desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"
2023-04-07 18:27:50 +08:00
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_TableView.qml")
2023-04-07 18:27:50 +08:00
}
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"MultiWindow"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_MultiWindow.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-04-02 14:05:54 +08:00
FluPaneItem{
title:"FlipView"
2023-04-27 09:38:57 +08:00
image:"qrc:/example/res/image/control/FlipView.png"
2023-04-02 14:05:54 +08:00
recentlyAdded:true
order:2
desc:"Presents a collection of items that the user canflip through, one item at a time."
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_FlipView.qml")
2023-04-02 14:05:54 +08:00
}
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItemExpander{
2023-04-14 17:07:54 +08:00
title:lang.theming
2023-03-31 22:05:25 +08:00
icon:FluentIcons.Brightness
2023-05-12 19:26:49 +08:00
FluPaneItem{
title:"Acrylic"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Acrylic.qml")
}
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
title:"Theme"
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Theme.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
2023-04-06 17:32:21 +08:00
title:"Typography"
2023-03-31 22:05:25 +08:00
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Typography.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
2023-03-31 22:05:25 +08:00
FluPaneItem{
2023-04-06 17:32:21 +08:00
title:"Awesome"
2023-03-31 22:05:25 +08:00
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_Awesome.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
}
2023-03-31 22:05:25 +08:00
FluPaneItemExpander{
2023-04-14 17:07:54 +08:00
title:lang.media
2023-03-31 22:05:25 +08:00
icon:FluentIcons.Media
FluPaneItem{
title:"MediaPlayer"
2023-04-27 09:38:57 +08:00
image:"qrc:/example/res/image/control/MediaPlayerElement.png"
2023-03-31 22:05:25 +08:00
recentlyAdded:true
2023-04-02 14:05:54 +08:00
order:0
2023-03-31 22:05:25 +08:00
desc:"A control to display video and image content."
onTap:{
2023-04-27 09:38:57 +08:00
navigationView.push("qrc:/example/qml/page/T_MediaPlayer.qml")
2023-03-31 22:05:25 +08:00
}
2023-03-30 17:16:57 +08:00
}
}
function getRecentlyAddedData(){
var arr = []
for(var i=0;i<children.length;i++){
var item = children[i]
if(item instanceof FluPaneItem && item.recentlyAdded){
arr.push(item)
}
2023-03-31 22:05:25 +08:00
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)
}
}
}
2023-03-30 17:16:57 +08:00
}
2023-04-02 14:05:54 +08:00
arr.sort(function(o1,o2){ return o2.order-o1.order })
2023-03-30 17:16:57 +08:00
return arr
}
function getRecentlyUpdatedData(){
var arr = []
2023-03-31 22:05:25 +08:00
var items = navigationView.getItems();
for(var i=0;i<items.length;i++){
var item = items[i]
2023-03-30 17:16:57 +08:00
if(item instanceof FluPaneItem && item.recentlyUpdated){
arr.push(item)
}
}
return arr
}
function getSearchData(){
var arr = []
2023-03-31 22:05:25 +08:00
var items = navigationView.getItems();
for(var i=0;i<items.length;i++){
var item = items[i]
2023-03-30 17:16:57 +08:00
if(item instanceof FluPaneItem){
arr.push({title:item.title,key:item.key})
}
}
return arr
}
2023-03-31 22:05:25 +08:00
function startPageByItem(data){
2023-04-11 16:30:07 +08:00
navigationView.startPageByItem(data)
2023-03-30 17:16:57 +08:00
}
}