main
朱子楚\zhuzi 2023-05-16 21:09:37 +08:00
parent fb48ed543b
commit 09fa471a10
3 changed files with 112 additions and 47 deletions

View File

@ -2,61 +2,68 @@
import QtQuick.Window import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Qt.labs.platform
import FluentUI import FluentUI
import "qrc:///example/qml/global/"
FluWindow {
Window {
id:window id:window
title: "132" title: "FluentUI"
width: 1000
height: 640
closeDestory:false
minimumWidth: 520
minimumHeight: 460
launchMode: FluWindow.SingleTask
visible: true visible: true
width: 600
color: "#00000000"
height: 480
FluInfoBar{ FluNavigationView2{
id:info_bar id:nav_view
root: window
}
Rectangle{
anchors.fill: parent anchors.fill: parent
color: "#FFFFFF" items: ItemsOriginal
} footerItems:ItemsFooter
z:11
FluButton{ displayMode:MainEvent.displayMode
x: 23 logo: "qrc:/example/res/image/favicon.ico"
y: 31 title:"FluentUI"
text:"123" autoSuggestBox:FluAutoSuggestBox{
onClicked: { width: 280
info_bar.showSuccess("asdasd")
}
}
FluFilledButton{
x: 23
y: 95
text: "asdasd"
onClicked: {
info_bar.showInfo("123132")
}
}
FluTextBox{
text: "asdasd"
anchors.verticalCenterOffset: -59
anchors.horizontalCenterOffset: -127
anchors.centerIn: parent anchors.centerIn: parent
iconSource: FluentIcons.Search
items: ItemsOriginal.getSearchData()
placeholderText: lang.search
onItemClicked:
(data)=>{
ItemsOriginal.startPageByItem(data)
} }
FluProgressBar{
x: 23
y: 238
} }
actionItem:Item{
FluProgressRing{ height: 40
x: 18 width: 148
y: 283 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)
}
} }
} }

View File

@ -0,0 +1,57 @@
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.Basic
import QtQuick.Layouts
import FluentUI
Item {
property url logo
property string title: ""
property FluObject items
property FluObject footerItems
property int displayMode: FluNavigationView.Auto
property Component autoSuggestBox
property Component actionItem
id:control
Item {
id:nav_app_bar
width: parent.width
height: 40
RowLayout{
height:parent.height
spacing: 0
FluIconButton{
iconSource: FluentIcons.ChromeBack
Layout.leftMargin: 5
Layout.preferredWidth: 30
Layout.preferredHeight: 30
Layout.alignment: Qt.AlignVCenter
iconSize: 15
}
FluIconButton{
id:btn_nav
iconSource: FluentIcons.GlobalNavButton
iconSize: 15
Layout.preferredWidth: 30
Layout.preferredHeight: 30
Layout.alignment: Qt.AlignVCenter
}
Image{
Layout.preferredHeight: 20
Layout.preferredWidth: 20
source: control.logo
Layout.leftMargin: 12
sourceSize: Qt.size(40,40)
Layout.alignment: Qt.AlignVCenter
}
FluText{
Layout.alignment: Qt.AlignVCenter
text:control.title
Layout.leftMargin: 12
font: FluTextStyle.Body
}
}
}
}

View File

@ -32,6 +32,7 @@ Window {
} }
signal initArgument(var argument) signal initArgument(var argument)
id:window id:window
color:Qt.rgba(0,0,0,0)
onClosing:(event)=>closeFunc(event) onClosing:(event)=>closeFunc(event)
Component.onCompleted: { Component.onCompleted: {
helper.initWindow(window) helper.initWindow(window)