FluentUI/example/qml-Qt6/global/ItemsOriginal.qml

521 lines
18 KiB
QML
Raw Normal View History

2023-08-24 15:50:37 +08:00
pragma Singleton
import QtQuick
import FluentUI
FluObject{
property var navigationView
function rename(item, newName){
if(newName && newName.trim().length>0){
item.title = newName;
}
}
FluPaneItem{
id:item_home
count: 9
title:lang.home
infoBadge:FluBadge{
count: item_home.count
}
icon:FluentIcons.Home
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Home.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
2023-08-24 15:50:37 +08:00
onTap:{
if(navigationView.getCurrentUrl()){
item_home.count = 0
}
2023-08-26 17:20:30 +08:00
navigationView.push(url)
2023-08-24 15:50:37 +08:00
}
editDelegate: FluTextBox{
text:item_home.title
}
menuDelegate: FluMenu{
id:nav_item_right_menu
width: 120
FluMenuItem{
text: "重命名"
visible: true
onClicked: {
item_home.showEdit = true
}
}
}
}
FluPaneItemExpander{
id:item_expander_basic_input
title:lang.basic_input
icon:FluentIcons.CheckboxComposite
editDelegate: FluTextBox{
text:item_expander_basic_input.title
}
menuDelegate: FluMenu{
FluMenuItem{
text: "重命名"
visible: true
onClicked: {
item_expander_basic_input.showEdit = true
}
}
}
FluPaneItem{
id:item_buttons
count: 99
infoBadge:FluBadge{
count: item_buttons.count
}
title:"Buttons"
image:"qrc:/example/res/image/control/Button.png"
recentlyUpdated:true
desc:"A control that responds to user input and raisesa Click event."
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Buttons.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
2023-08-24 15:50:37 +08:00
onTap:{
item_buttons.count = 0
2023-08-26 17:20:30 +08:00
navigationView.push(url)
2023-08-24 15:50:37 +08:00
}
}
FluPaneItem{
id:item_text
title:"Text"
count: 5
infoBadge:FluBadge{
count: item_text.count
color: Qt.rgba(82/255,196/255,26/255,1)
}
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Text.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
2023-09-07 18:07:23 +08:00
onTap:{
item_text.count = 0
navigationView.push(url)
}
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Image"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Image.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Slider"
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."
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Slider.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"CheckBox"
image:"qrc:/example/res/image/control/Checkbox.png"
recentlyUpdated:true
desc:"A control that a user can select or clear."
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_CheckBox.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"RadioButton"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_RadioButton.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"ToggleSwitch"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_ToggleSwitch.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
2023-09-25 18:10:24 +08:00
FluPaneItem{
title:"PaneItem Disabled"
disabled: true
icon: FluentIcons.Error
}
2023-08-24 15:50:37 +08:00
}
FluPaneItemExpander{
title:lang.form
icon:FluentIcons.GridView
FluPaneItem{
title:"TextBox"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_TextBox.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"TimePicker"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_TimePicker.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"DatePicker"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_DatePicker.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"CalendarPicker"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_CalendarPicker.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"ColorPicker"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_ColorPicker.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
}
FluPaneItemExpander{
title:lang.surface
icon:FluentIcons.SurfaceHub
FluPaneItem{
title:"InfoBar"
image:"qrc:/example/res/image/control/InfoBar.png"
recentlyUpdated:true
desc:"An inline message to display app-wide statuschange information."
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_InfoBar.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Progress"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Progress.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"RatingControl"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_RatingControl.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Badge"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Badge.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Rectangle"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Rectangle.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
2023-09-27 15:18:10 +08:00
FluPaneItem{
title:"Clip"
url:"qrc:/example/qml/page/T_Clip.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
2023-08-24 15:50:37 +08:00
FluPaneItem{
title:"StatusView"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_StatusView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Carousel"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Carousel.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Expander"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Expander.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
2023-08-30 17:18:49 +08:00
FluPaneItem{
title:"StaggeredView"
url:"qrc:/example/qml/page/T_StaggeredView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
2023-08-24 15:50:37 +08:00
FluPaneItem{
title:"Watermark"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Watermark.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
}
FluPaneItemExpander{
title:lang.popus
icon:FluentIcons.ButtonMenu
FluPaneItem{
title:"Dialog"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Dialog.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
id:item_combobox
title:"ComboBox"
count: 9
infoBadge:FluBadge{
count: item_combobox.count
color: Qt.rgba(250/255,173/255,20/255,1)
}
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_ComboBox.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
2023-08-24 15:50:37 +08:00
onTap:{
item_combobox.count = 0
navigationView.push("qrc:/example/qml/page/T_ComboBox.qml")
}
}
FluPaneItem{
title:"Tooltip"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Tooltip.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Menu"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Menu.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
}
FluPaneItemExpander{
title:lang.navigation
icon:FluentIcons.AllApps
FluPaneItem{
title:"Pivot"
image:"qrc:/example/res/image/control/Pivot.png"
recentlyAdded:true
order:3
desc:"Presents information from different sources in atabbed view."
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Pivot.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"BreadcrumbBar"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_BreadcrumbBar.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"TabView"
image:"qrc:/example/res/image/control/TabView.png"
recentlyAdded:true
order:1
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_TabView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
2023-09-22 17:35:02 +08:00
title:"TreeView"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_TreeView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"TableView"
image:"qrc:/example/res/image/control/DataGrid.png"
recentlyAdded:true
order:4
desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_TableView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Pagination"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Pagination.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"MultiWindow"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_MultiWindow.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"FlipView"
image:"qrc:/example/res/image/control/FlipView.png"
recentlyAdded:true
order:2
desc:"Presents a collection of items that the user canflip through, one item at a time."
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_FlipView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
}
FluPaneItemExpander{
title:lang.theming
icon:FluentIcons.Brightness
FluPaneItem{
title:"Acrylic"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Acrylic.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Theme"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Theme.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Typography"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Typography.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Awesome"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Awesome.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
}
2023-09-25 18:10:24 +08:00
FluPaneItemExpander{
title:"PaneItemExpander Disabled"
icon: FluentIcons.Send
disabled: true
}
2023-08-24 15:50:37 +08:00
FluPaneItemSeparator{
spacing:10
size:1
}
FluPaneItemExpander{
title:lang.other
icon:FluentIcons.Shop
FluPaneItem{
title:"QRCode"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_QRCode.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Tour"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Tour.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Timeline"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Timeline.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
2023-09-08 00:21:28 +08:00
title:"Screenshot(Todo)"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Screenshot.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Captcha"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Captcha.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Chart"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Chart.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
title:"Http"
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_Http.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
2023-08-24 15:50:37 +08:00
}
FluPaneItem{
id:item_other
title:"RemoteLoader"
count: 99
infoBadge:FluBadge{
count: item_other.count
color: Qt.rgba(82/255,196/255,26/255,1)
}
2023-08-26 17:20:30 +08:00
url:"qrc:/example/qml/page/T_RemoteLoader.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
2023-08-24 15:50:37 +08:00
onTap:{
item_other.count = 0
navigationView.push("qrc:/example/qml/page/T_RemoteLoader.qml")
}
}
FluPaneItem{
title:"HotLoader"
2023-08-26 17:20:30 +08:00
onTapListener:function(){
2023-08-24 15:50:37 +08:00
FluApp.navigate("/hotload")
}
2023-08-26 17:20:30 +08:00
onDropped:{ FluApp.navigate("/hotload") }
2023-08-24 15:50:37 +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)
}
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.order-o1.order })
return arr
}
function getRecentlyUpdatedData(){
var arr = []
var items = navigationView.getItems();
for(var i=0;i<items.length;i++){
var item = items[i]
if(item instanceof FluPaneItem && item.recentlyUpdated){
arr.push(item)
}
}
return arr
}
function getSearchData(){
2023-09-17 20:36:33 +08:00
if(!navigationView){
return
}
2023-08-24 15:50:37 +08:00
var arr = []
var items = navigationView.getItems();
for(var i=0;i<items.length;i++){
var item = items[i]
if(item instanceof FluPaneItem){
if (item.parent instanceof FluPaneItemExpander)
{
arr.push({title:`${item.parent.title} -> ${item.title}`,key:item.key})
}
else
arr.push({title:item.title,key:item.key})
}
}
return arr
}
function startPageByItem(data){
navigationView.startPageByItem(data)
}
}