FluentUI/example/page/MainPage.qml

273 lines
5.6 KiB
QML
Raw Normal View History

2023-02-26 23:47:07 +08:00
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtGraphicalEffects 1.15
2023-03-02 18:21:43 +08:00
2023-02-26 23:47:07 +08:00
import FluentUI 1.0
2023-02-27 18:46:39 +08:00
FluWindow {
2023-02-26 23:47:07 +08:00
id:rootwindow
2023-03-11 14:41:31 +08:00
width: 860
2023-03-13 18:23:46 +08:00
height: 600
2023-02-27 23:04:52 +08:00
title: "FluentUI"
2023-03-09 23:11:59 +08:00
minimumWidth: 500
2023-03-06 14:22:13 +08:00
minimumHeight: 400
2023-02-27 18:46:39 +08:00
FluAppBar{
id:appbar
title: "FluentUI"
}
2023-02-26 23:47:07 +08:00
2023-03-10 18:08:32 +08:00
FluObject{
id:original_items
FluPaneItemHeader{
title:"Inputs"
2023-03-06 18:08:01 +08:00
}
2023-03-10 18:08:32 +08:00
FluPaneItem{
title:"Buttons"
onTap:{
nav_view.push("qrc:/T_Buttons.qml")
}
2023-03-06 18:08:01 +08:00
}
2023-03-10 18:08:32 +08:00
FluPaneItem{
title:"Slider"
onTap:{
nav_view.push("qrc:/T_Slider.qml")
}
2023-03-06 18:08:01 +08:00
}
2023-03-10 18:08:32 +08:00
FluPaneItem{
title:"ToggleSwitch"
onTap:{
nav_view.push("qrc:/T_ToggleSwitch.qml")
}
2023-03-06 18:08:01 +08:00
}
2023-03-10 18:08:32 +08:00
FluPaneItemHeader{
title:"Form"
2023-03-06 18:08:01 +08:00
}
2023-03-10 18:08:32 +08:00
FluPaneItem{
title:"TextBox"
onTap:{
nav_view.push("qrc:/T_TextBox.qml")
}
2023-03-06 18:08:01 +08:00
}
2023-03-10 18:08:32 +08:00
2023-03-11 14:41:31 +08:00
FluPaneItem{
title:"TimePicker"
onTap:{
nav_view.push("qrc:/T_TimePicker.qml")
}
}
2023-03-12 14:26:03 +08:00
FluPaneItem{
title:"DatePicker"
onTap:{
nav_view.push("qrc:/T_DatePicker.qml")
}
}
2023-03-22 11:54:19 +08:00
FluPaneItem{
title:"CalendarPicker"
onTap:{
nav_view.push("qrc:/T_CalendarPicker.qml")
}
}
2023-03-10 18:08:32 +08:00
FluPaneItemHeader{
title:"Surface"
2023-03-06 18:08:01 +08:00
}
2023-03-10 18:08:32 +08:00
FluPaneItem{
title:"InfoBar"
onTap:{
nav_view.push("qrc:/T_InfoBar.qml")
}
2023-03-06 18:08:01 +08:00
}
2023-03-10 18:08:32 +08:00
FluPaneItem{
title:"Progress"
onTap:{
nav_view.push("qrc:/T_Progress.qml")
}
2023-03-08 18:14:21 +08:00
}
2023-03-14 18:23:12 +08:00
2023-03-21 18:19:46 +08:00
FluPaneItem{
2023-03-22 11:54:19 +08:00
title:"Calendar"
2023-03-21 18:19:46 +08:00
onTap:{
2023-03-22 11:54:19 +08:00
nav_view.push("qrc:/T_Calendar.qml")
2023-03-21 18:19:46 +08:00
}
}
2023-03-20 21:28:12 +08:00
FluPaneItem{
title:"Badge"
onTap:{
nav_view.push("qrc:/T_Badge.qml")
}
}
2023-03-10 18:08:32 +08:00
FluPaneItem{
title:"Rectangle"
onTap:{
nav_view.push("qrc:/T_Rectangle.qml")
}
2023-03-07 00:05:27 +08:00
}
2023-03-14 18:23:12 +08:00
FluPaneItem{
title:"Carousel"
onTap:{
nav_view.push("qrc:/T_Carousel.qml")
}
}
2023-03-10 18:08:32 +08:00
FluPaneItem{
title:"Expander"
onTap:{
nav_view.push("qrc:/T_Expander.qml")
}
2023-03-06 18:08:01 +08:00
}
2023-03-10 18:08:32 +08:00
FluPaneItemHeader{
title:"Popus"
2023-03-06 18:08:01 +08:00
}
2023-03-10 18:08:32 +08:00
FluPaneItem{
title:"Dialog"
onTap:{
nav_view.push("qrc:/T_Dialog.qml")
}
2023-02-28 23:57:55 +08:00
}
2023-03-02 18:21:43 +08:00
2023-03-20 18:22:32 +08:00
FluPaneItem{
title:"Tooltip"
onTap:{
nav_view.push("qrc:/T_Tooltip.qml")
}
}
2023-03-15 18:45:14 +08:00
FluPaneItem{
title:"Menu"
onTap:{
nav_view.push("qrc:/T_Menu.qml")
}
}
2023-03-10 18:08:32 +08:00
FluPaneItemHeader{
title:"Navigation"
}
FluPaneItem{
title:"TreeView"
onTap:{
nav_view.push("qrc:/T_TreeView.qml")
2023-03-02 23:58:50 +08:00
}
2023-03-10 18:08:32 +08:00
}
2023-03-13 18:23:46 +08:00
FluPaneItem{
title:"MultiWindow"
onTap:{
nav_view.push("qrc:/T_MultiWindow.qml")
}
}
2023-03-10 18:08:32 +08:00
FluPaneItemHeader{
title:"Theming"
}
FluPaneItem{
title:"Theme"
onTap:{
nav_view.push("qrc:/T_Theme.qml")
2023-03-02 23:58:50 +08:00
}
}
2023-03-10 18:08:32 +08:00
FluPaneItem{
title:"Awesome"
onTap:{
nav_view.push("qrc:/T_Awesome.qml")
}
}
FluPaneItem{
title:"Typography"
onTap:{
nav_view.push("qrc:/T_Typography.qml")
}
2023-02-26 23:47:07 +08:00
}
2023-03-10 18:08:32 +08:00
}
2023-02-26 23:47:07 +08:00
2023-03-10 18:08:32 +08:00
FluObject{
id:footer_items
FluPaneItemSeparator{}
FluPaneItem{
title:"意见反馈"
onTap:{
Qt.openUrlExternally("https://github.com/zhuzichu520/FluentUI/issues/new")
}
}
FluPaneItem{
title:"关于"
onTap:{
2023-03-13 18:23:46 +08:00
FluApp.navigate("/about")
2023-02-26 23:47:07 +08:00
}
}
}
2023-03-10 18:08:32 +08:00
FluNavigationView{
id:nav_view
2023-02-26 23:47:07 +08:00
anchors{
2023-02-27 18:46:39 +08:00
top: appbar.bottom
2023-03-10 18:08:32 +08:00
left: parent.left
2023-02-26 23:47:07 +08:00
right: parent.right
bottom: parent.bottom
}
2023-03-10 18:08:32 +08:00
items:original_items
footerItems:footer_items
2023-02-26 23:47:07 +08:00
2023-03-17 14:05:27 +08:00
actions:[
Image {
width: 30
height: 30
Layout.preferredWidth: 30
Layout.preferredHeight: 30
sourceSize: Qt.size(60,60)
source: "qrc:/res/image/logo_openai.png"
Layout.rightMargin: 5
MouseArea{
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
FluApp.navigate("/chat")
}
}
},
FluText{
text:"夜间模式"
fontStyle: FluText.Body
},
FluToggleSwitch{
selected: FluTheme.isDark
clickFunc:function(){
FluTheme.isDark = !FluTheme.isDark
}
}
]
2023-03-10 18:08:32 +08:00
Component.onCompleted: {
nav_view.setCurrentIndex(1)
nav_view.push("qrc:/T_Buttons.qml")
2023-02-26 23:47:07 +08:00
}
2023-03-10 18:08:32 +08:00
2023-02-26 23:47:07 +08:00
}
2023-03-10 18:08:32 +08:00
2023-02-26 23:47:07 +08:00
}