This commit is contained in:
朱子楚\zhuzi
2023-03-02 00:35:58 +08:00
parent 875d8896d8
commit 744102e034
15 changed files with 1269 additions and 43 deletions

View File

@ -15,14 +15,22 @@ Rectangle{
property string title: "标题"
property bool resizable: {
if(Window.window == null){
return false
}
return !(Window.window.minimumHeight === Window.window.maximumHeight && Window.window.maximumWidth === Window.window.minimumWidth)
}
MouseArea{
property var lastClickTime: new Date()
anchors.fill: parent
anchors.topMargin: 5
acceptedButtons: Qt.LeftButton
hoverEnabled: true
onPressed: Window.window.startSystemMove()
onDoubleClicked: {
toggleMaximized();
if(resizable)
toggleMaximized();
}
}
@ -34,8 +42,6 @@ Rectangle{
}
}
FluText {
text: title
anchors{
@ -54,10 +60,10 @@ Rectangle{
spacing: 5
TFpsMonitor{
Layout.alignment: Qt.AlignVCenter
Layout.rightMargin: 12
Layout.topMargin: 5
visible: FluApp.isFps
Layout.alignment: Qt.AlignVCenter
Layout.rightMargin: 12
Layout.topMargin: 5
visible: FluApp.isFps
}
RowLayout{
@ -91,6 +97,7 @@ Rectangle{
return Window.Maximized === Window.window.visibility ? FluentIcons.FA_window_restore : FluentIcons.FA_window_maximize
}
Layout.alignment: Qt.AlignVCenter
visible: resizable
text:{
if(Window.window == null)
return ""

View File

@ -43,7 +43,7 @@ Rectangle {
color : FluApp.isDark ? "#202020" : "#F3F3F3"
Component.onCompleted: {
console.debug("Component.onCompleted:"+root.winId)
}
Connections{
@ -58,11 +58,7 @@ Rectangle {
if(maximumSize){
helper.setMaximumSize(maximumSize)
}
if(maximumSize&&minimumSize){
if(maximumSize.width === minimumSize.width && maximumSize.height === minimumSize.height){
helper.disResizable()
}
}
helper.refreshWindow()
}
}
}