Kylin/Fluent/qml/Window.qml
2024-08-21 23:26:43 +08:00

43 lines
1.2 KiB
QML

import QtQuick as Quick
import Fluent
Quick.Window {
id: root
property string windowIcon: App.windowIcon
property bool showStayTop: false
property bool showMaximize: true
property bool showMinimize: true
property bool showClose: true
property bool showDark: false
property bool fixSize: false
property bool stayTop: false
property Quick.Item appBar: AppBar {
title: root.title
height: 30
showDark: root.showDark
showClose: root.showClose
showMinimize: root.showMinimize
showMaximize: root.showMaximize
showStayTop: root.showStayTop
icon: root.windowIcon
}
Frameless {
id: frameless
appBar: root.appBar
maximizeButton: appBar.buttonMaximize
fixSize: root.fixSize
topmost: root.stayTop
disabled: App.useSystemAppBar
Quick.Component.onCompleted: {
frameless.setHitTestVisible(appBar.layoutMacosButtons)
frameless.setHitTestVisible(appBar.layoutStandardbuttons)
}
Quick.Component.onDestruction: {
frameless.onDestruction()
}
}
Quick.Component.onCompleted: {
Router.addWindow(root)
}
}