FluentUI/example/qml/TestWindow.qml

70 lines
1.8 KiB
QML
Raw Normal View History

2023-05-11 18:24:58 +08:00
import QtQuick
2023-05-14 19:06:10 +08:00
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Layouts
2023-05-16 21:09:37 +08:00
import Qt.labs.platform
2023-05-11 18:24:58 +08:00
import FluentUI
2023-05-16 21:09:37 +08:00
import "qrc:///example/qml/global/"
FluWindow {
2023-05-11 18:24:58 +08:00
id:window
2023-05-16 21:09:37 +08:00
title: "FluentUI"
width: 1000
height: 640
closeDestory:false
minimumWidth: 520
minimumHeight: 460
launchMode: FluWindow.SingleTask
2023-05-11 18:24:58 +08:00
visible: true
2023-05-14 19:06:10 +08:00
2023-05-16 21:09:37 +08:00
FluNavigationView2{
id:nav_view
2023-05-14 19:06:10 +08:00
anchors.fill: parent
2023-05-16 21:09:37 +08:00
items: ItemsOriginal
footerItems:ItemsFooter
z:11
displayMode:MainEvent.displayMode
logo: "qrc:/example/res/image/favicon.ico"
title:"FluentUI"
autoSuggestBox:FluAutoSuggestBox{
width: 280
anchors.centerIn: parent
iconSource: FluentIcons.Search
items: ItemsOriginal.getSearchData()
placeholderText: lang.search
onItemClicked:
(data)=>{
ItemsOriginal.startPageByItem(data)
}
2023-05-14 19:06:10 +08:00
}
2023-05-16 21:09:37 +08:00
actionItem:Item{
height: 40
width: 148
RowLayout{
anchors.centerIn: parent
spacing: 5
FluText{
text:lang.dark_mode
}
FluToggleSwitch{
selected: FluTheme.dark
clickFunc:function(){
if(FluTheme.dark){
FluTheme.darkMode = FluDarkMode.Light
}else{
FluTheme.darkMode = FluDarkMode.Dark
}
}
}
}
}
Component.onCompleted: {
ItemsOriginal.navigationView = nav_view
ItemsFooter.navigationView = nav_view
// nav_view.setCurrentIndex(0)
2023-05-14 19:06:10 +08:00
}
2023-05-11 18:24:58 +08:00
}
}