forked from nuoqian-lgtm/QianWindow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WindowTilte.qml
128 lines (103 loc) · 2.96 KB
/
WindowTilte.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import QtQuick 2.12
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.14
import QtQuick.Controls.Material 2.12
import Qt.Singleton 1.0
import "qrc:/common"
Rectangle {
id: windowtitle
MouseArea {
anchors.fill: parent
onDoubleClicked: {
scaleInput.clicked();
}
}
RowLayout {
z: 2
anchors.fill: parent
anchors.leftMargin: 8
anchors.margins: 0
Layout.margins: 0
spacing: 0
Image {
antialiasing: true
source: "qrc:/windowRes/icon.png"
Layout.preferredWidth: 30
Layout.preferredHeight: 30
fillMode: Image.PreserveAspectFit
}
YaheiText {
text: rootWindow.title
font.pixelSize: 17
color: "#FFF"
Layout.fillWidth: true
Layout.leftMargin: 3
}
ImageButton {
imageSrc: "qrc:/windowRes/skin.png"
Layout.alignment: Qt.AlignTop | Qt.AlignRight
backHoverColor: "#22FFFFFF"
BaseToolTip {
visible: parent.hovered
text: "主题"
font.pixelSize: 12
delay: 1000
}
onClicked: {
skin_popup.open()
}
padding: 3
}
ImageButton {
imageSrc: "qrc:/windowRes/minimize.png"
Layout.alignment: Qt.AlignTop | Qt.AlignRight
backHoverColor: "#22FFFFFF"
BaseToolTip {
visible: parent.hovered
text: "最小化"
font.pixelSize: 12
delay: 1000
}
onClicked: {
showMinimized()
}
padding: 1
}
ScaleImageButton {
id: scaleInput
backHoverColor:"#22FFFFFF"
normalImage: "qrc:/windowRes/normal.png"
maxImage: "qrc:/windowRes/max.png"
BaseToolTip {
visible: parent.hovered
text: scaleInput.shrink ? "最大化" : "恢复"
font.pixelSize: 12
delay: 1000
}
Layout.alignment : Qt.AlignTop | Qt.AlignRight
focusPolicy: Qt.NoFocus
onShrinkChanged: {
rootWindow.maximized = !shrink
rootWindow.update();
}
padding: 3
}
ImageButton {
imageSrc: "qrc:/windowRes/close.png"
//hoverimageSrc:"qrc:/windowRes/close_hover.png"
Layout.alignment: Qt.AlignTop | Qt.AlignRight
backHoverColor: "#FA5151"
BaseToolTip {
visible: parent.hovered
text: "关闭"
font.pixelSize: 12
delay: 1000
}
onClicked: rootWindow.closeFunc()
padding: 3
}
}
SkinPopup {
id: skin_popup
}
}