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
|
|
|
|
|
import FluentUI 1.0
|
|
|
|
|
|
2023-02-27 18:46:39 +08:00
|
|
|
|
FluWindow {
|
2023-02-26 23:47:07 +08:00
|
|
|
|
id:rootwindow
|
|
|
|
|
width: 800
|
|
|
|
|
height: 600
|
2023-02-27 23:04:52 +08:00
|
|
|
|
title: "FluentUI"
|
2023-03-01 11:58:30 +08:00
|
|
|
|
minimumSize: Qt.size(600,400)
|
|
|
|
|
// property var maximumSize
|
2023-02-27 18:46:39 +08:00
|
|
|
|
|
|
|
|
|
FluAppBar{
|
|
|
|
|
id:appbar
|
|
|
|
|
title: "FluentUI"
|
|
|
|
|
}
|
2023-02-26 23:47:07 +08:00
|
|
|
|
|
|
|
|
|
ListModel{
|
|
|
|
|
id:nav_items
|
|
|
|
|
ListElement{
|
2023-02-28 18:29:00 +08:00
|
|
|
|
text:"Buttons"
|
|
|
|
|
page:"qrc:/T_Buttons.qml"
|
|
|
|
|
}
|
2023-03-02 12:20:16 +08:00
|
|
|
|
ListElement{
|
|
|
|
|
text:"TextBox"
|
|
|
|
|
page:"qrc:/T_TextBox.qml"
|
|
|
|
|
}
|
2023-02-28 18:29:00 +08:00
|
|
|
|
ListElement{
|
|
|
|
|
text:"ToggleSwitch"
|
|
|
|
|
page:"qrc:/T_ToggleSwitch.qml"
|
|
|
|
|
}
|
2023-03-01 11:58:30 +08:00
|
|
|
|
ListElement{
|
|
|
|
|
text:"Slider"
|
|
|
|
|
page:"qrc:/T_Slider.qml"
|
|
|
|
|
}
|
2023-02-28 18:29:00 +08:00
|
|
|
|
ListElement{
|
|
|
|
|
text:"InfoBar"
|
|
|
|
|
page:"qrc:/T_InfoBar.qml"
|
|
|
|
|
}
|
2023-02-28 23:57:55 +08:00
|
|
|
|
ListElement{
|
|
|
|
|
text:"Progress"
|
|
|
|
|
page:"qrc:/T_Progress.qml"
|
|
|
|
|
}
|
2023-02-28 18:29:00 +08:00
|
|
|
|
ListElement{
|
|
|
|
|
text:"Rectangle"
|
2023-03-01 11:58:30 +08:00
|
|
|
|
page:"qrc:/T_Rectangle.qml"
|
2023-02-26 23:47:07 +08:00
|
|
|
|
}
|
2023-03-02 12:20:16 +08:00
|
|
|
|
ListElement{
|
|
|
|
|
text:"Awesome"
|
|
|
|
|
page:"qrc:/T_Awesome.qml"
|
|
|
|
|
}
|
2023-02-26 23:47:07 +08:00
|
|
|
|
ListElement{
|
|
|
|
|
text:"Typography"
|
|
|
|
|
page:"qrc:/T_Typography.qml"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ListView{
|
|
|
|
|
id:nav_list
|
|
|
|
|
anchors{
|
2023-02-27 18:46:39 +08:00
|
|
|
|
top: appbar.bottom
|
2023-02-26 23:47:07 +08:00
|
|
|
|
bottom: parent.bottom
|
|
|
|
|
topMargin: 20
|
|
|
|
|
bottomMargin: 20
|
|
|
|
|
}
|
|
|
|
|
width: 160
|
|
|
|
|
model: nav_items
|
|
|
|
|
delegate: Item{
|
|
|
|
|
height: 38
|
|
|
|
|
width: nav_list.width
|
|
|
|
|
|
|
|
|
|
Rectangle{
|
|
|
|
|
color: {
|
2023-02-27 23:04:52 +08:00
|
|
|
|
if(FluApp.isDark){
|
|
|
|
|
if(item_mouse.containsMouse){
|
|
|
|
|
return "#292929"
|
|
|
|
|
}
|
|
|
|
|
if(nav_list.currentIndex === index){
|
|
|
|
|
return "#2D2D2D"
|
|
|
|
|
}
|
|
|
|
|
return "#00000000"
|
|
|
|
|
}else{
|
|
|
|
|
if(item_mouse.containsMouse){
|
|
|
|
|
return "#EDEDED"
|
|
|
|
|
}
|
|
|
|
|
if(nav_list.currentIndex === index){
|
|
|
|
|
return "#EAEAEA"
|
|
|
|
|
}
|
|
|
|
|
return "#00000000"
|
2023-02-26 23:47:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
radius: 4
|
|
|
|
|
anchors{
|
|
|
|
|
top: parent.top
|
|
|
|
|
bottom: parent.bottom
|
|
|
|
|
left: parent.left
|
|
|
|
|
right: parent.right
|
|
|
|
|
topMargin: 2
|
|
|
|
|
bottomMargin: 2
|
|
|
|
|
leftMargin: 6
|
|
|
|
|
rightMargin: 6
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MouseArea{
|
|
|
|
|
id:item_mouse
|
|
|
|
|
hoverEnabled: true
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
onClicked: {
|
|
|
|
|
nav_list.currentIndex = index
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-27 23:04:52 +08:00
|
|
|
|
FluText{
|
2023-02-26 23:47:07 +08:00
|
|
|
|
text:model.text
|
|
|
|
|
anchors.centerIn: parent
|
2023-02-27 23:04:52 +08:00
|
|
|
|
fontStyle: FluText.Caption
|
2023-02-26 23:47:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Rectangle{
|
2023-02-27 18:46:39 +08:00
|
|
|
|
color: FluApp.isDark ? "#323232" : "#FFFFFF"
|
2023-02-26 23:47:07 +08:00
|
|
|
|
radius: 10
|
|
|
|
|
clip: true
|
|
|
|
|
anchors{
|
|
|
|
|
left: nav_list.right
|
|
|
|
|
leftMargin: 2
|
2023-02-27 18:46:39 +08:00
|
|
|
|
top: appbar.bottom
|
2023-02-26 23:47:07 +08:00
|
|
|
|
topMargin: 20
|
|
|
|
|
right: parent.right
|
|
|
|
|
rightMargin: 10
|
|
|
|
|
bottom: parent.bottom
|
|
|
|
|
bottomMargin: 20
|
|
|
|
|
}
|
|
|
|
|
border.width: 1
|
2023-02-28 18:29:00 +08:00
|
|
|
|
border.color: FluApp.isDark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(238/255,238/255,238/255,1)
|
2023-02-26 23:47:07 +08:00
|
|
|
|
|
|
|
|
|
Loader{
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
anchors.margins:20
|
|
|
|
|
source: nav_items.get(nav_list.currentIndex).page
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|