AicsKnowledgeBase_client/AicsKnowledgeBase/qml/MainWindow.qml

123 lines
2.9 KiB
QML

import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.Basic
import FluentUI
import org.wangwenx190.FramelessHelper
import "qrc:///AicsKnowledgeBase/qml/global"
import "qrc:///AicsKnowledgeBase/qml/page"
FluWindow {
id: window
width: 1000
height: 640
FluAppBar {
id: title_bar
title: window.title
anchors {
left: parent.left
right: parent.right
top: parent.top
leftMargin: 35
}
}
RowLayout {
anchors.top: parent.top
anchors.right: parent.right
anchors.rightMargin: 140
height: 44
layoutDirection: Qt.RightToLeft
// Rectangle{
// anchors.fill: parent
// color: "red"
// }
Rectangle {
color: FluColors.White
radius: 50
width: 32
height: 32
}
Text {
Layout.margins: {
right: 10
}
text: "用户名"
}
}
RowLayout {
anchors.fill: parent
FluNavigationView {
id: nav_view
Layout.fillHeight: true
Layout.preferredWidth: 400
Layout.bottomMargin: 4
z: 999
items: NavItems
footerItems: FooterItems
topPadding: 5
displayMode: FluNavigationView.Compact
logo: "qrc:/AicsKnowledgeBase/res/logo.png"
title: "智能客服知识库"
Behavior on rotation {
NumberAnimation {
duration: 167
}
}
transformOrigin: Item.Center
Component.onCompleted: {
NavItems.navigationView = nav_view
FooterItems.navigationView = nav_view
setCurrentIndex(0)
}
}
ContentPage {
Layout.fillHeight: true
Layout.fillWidth: true
Layout.topMargin: 45
Layout.bottomMargin: 4
Layout.rightMargin: 4
}
/*
FluArea {
Layout.fillHeight: true
Layout.fillWidth: true
paddings: 10
Layout.topMargin: 45
Layout.bottomMargin: 4
Layout.rightMargin: 4
FluText {
Layout.topMargin: 20
text: "Content"
}
}*/
}
FramelessHelper {
id: framless_helper
onReady: {
setTitleBarItem(title_bar)
moveWindowToDesktopCenter()
setHitTestVisible(title_bar.minimizeButton())
setHitTestVisible(title_bar.maximizeButton())
setHitTestVisible(title_bar.closeButton())
title_bar.maximizeButton.visible = true
// window.backgroundVisible = false
window.show()
}
}
}