This commit is contained in:
朱子楚\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") anchors.centerIn: parent
iconSource: FluentIcons.Search
items: ItemsOriginal.getSearchData()
placeholderText: lang.search
onItemClicked:
(data)=>{
ItemsOriginal.startPageByItem(data)
}
} }
} actionItem:Item{
height: 40
FluFilledButton{ width: 148
x: 23 RowLayout{
y: 95 anchors.centerIn: parent
text: "asdasd" spacing: 5
onClicked: { FluText{
info_bar.showInfo("123132") 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)
} }
}
FluTextBox{
text: "asdasd"
anchors.verticalCenterOffset: -59
anchors.horizontalCenterOffset: -127
anchors.centerIn: parent
}
FluProgressBar{
x: 23
y: 238
}
FluProgressRing{
x: 18
y: 283
} }
} }

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)