Minor tweaks.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2020-05-17 20:57:59 +08:00
parent d28e3d167c
commit f525b720ce
1 changed files with 7 additions and 8 deletions

View File

@ -3,7 +3,7 @@ import QtQuick.Window 2.15
import wangwenx190.Utils 1.0 import wangwenx190.Utils 1.0
Window { Window {
id: root id: window
visible: true visible: true
width: 800 width: 800
height: 600 height: 600
@ -24,7 +24,7 @@ Window {
Text { Text {
id: titleBarText id: titleBarText
text: root.title text: window.title
font.family: "Noto Sans CJK SC" font.family: "Noto Sans CJK SC"
font.pointSize: 13 font.pointSize: 13
color: "black" color: "black"
@ -39,20 +39,19 @@ Window {
MinimizeButton { MinimizeButton {
id: minimizeButton id: minimizeButton
onClicked: root.showMinimized() onClicked: window.showMinimized()
Component.onCompleted: framelessHelper.addIgnoreObject( Component.onCompleted: framelessHelper.addIgnoreObject(
minimizeButton) minimizeButton)
} }
MaximizeButton { MaximizeButton {
id: maximizeButton id: maximizeButton
// QWindow::Visibility::Maximized maximized: window.visibility === Window.Maximized
maximized: root.visibility === 4
onClicked: { onClicked: {
if (maximized) { if (maximized) {
root.showNormal() window.showNormal()
} else { } else {
root.showMaximized() window.showMaximized()
} }
} }
Component.onCompleted: framelessHelper.addIgnoreObject( Component.onCompleted: framelessHelper.addIgnoreObject(
@ -61,7 +60,7 @@ Window {
CloseButton { CloseButton {
id: closeButton id: closeButton
onClicked: root.close() onClicked: window.close()
Component.onCompleted: framelessHelper.addIgnoreObject( Component.onCompleted: framelessHelper.addIgnoreObject(
closeButton) closeButton)
} }