2021-05-19 18:31:18 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-05-19 18:31:18 +00:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: statusMacWindowButtons
|
|
|
|
|
2021-06-03 08:29:14 +00:00
|
|
|
signal close()
|
|
|
|
signal minimised()
|
|
|
|
signal maximized()
|
|
|
|
|
2021-05-19 18:31:18 +00:00
|
|
|
hoverEnabled: true
|
|
|
|
|
|
|
|
width: layout.implicitWidth
|
|
|
|
height: layout.implicitHeight
|
|
|
|
|
2021-06-02 15:20:19 +00:00
|
|
|
readonly property color inactive: Style.current.name === Constants.lightThemeName ? "#10000000"
|
|
|
|
: "#10FFFFFF"
|
|
|
|
readonly property color inactiveBorder: Style.current.name === Constants.lightThemeName ? "#10000000"
|
|
|
|
: "#10FFFFFF"
|
|
|
|
|
2021-05-19 18:31:18 +00:00
|
|
|
Row {
|
|
|
|
id: layout
|
|
|
|
spacing: 8
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
width: 12
|
|
|
|
height: 12
|
|
|
|
radius: width / 2
|
|
|
|
antialiasing: true
|
|
|
|
|
2021-12-08 21:20:43 +00:00
|
|
|
color: closeSensor.pressed ? "#B24F47" : (Global.applicationWindow.active || statusMacWindowButtons.containsMouse ? Qt.lighter("#E9685C", 1.07)
|
2021-05-19 18:31:18 +00:00
|
|
|
: inactive )
|
2021-12-08 21:20:43 +00:00
|
|
|
border.color:closeSensor.pressed ? "#943229" : (Global.applicationWindow.active ? "#D14C40"
|
2021-05-19 18:31:18 +00:00
|
|
|
: inactiveBorder)
|
|
|
|
border.width: Style.current.name === Constants.lightThemeName ? 0.5 : 0
|
|
|
|
|
|
|
|
Image {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
visible: statusMacWindowButtons.containsMouse
|
2021-09-28 15:04:06 +00:00
|
|
|
source: Style.png("traffic_lights/" + (closeSensor.pressed ? "close_pressed" : "close"))
|
2021-05-19 18:31:18 +00:00
|
|
|
scale: 0.25
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: closeSensor
|
|
|
|
anchors.fill: parent
|
|
|
|
|
2021-06-03 08:29:14 +00:00
|
|
|
onClicked: statusMacWindowButtons.close()
|
2021-05-19 18:31:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
width: 12
|
|
|
|
height: 12
|
|
|
|
radius: width / 2
|
|
|
|
antialiasing: true
|
|
|
|
|
2021-12-08 21:20:43 +00:00
|
|
|
color: miniSensor.pressed ? "#878E3B" : (Global.applicationWindow.active || statusMacWindowButtons.containsMouse ? Qt.lighter("#EDB84C", 1.07)
|
2021-05-19 18:31:18 +00:00
|
|
|
: inactive)
|
2021-12-08 21:20:43 +00:00
|
|
|
border.color:miniSensor.pressed ? "#986E29" : (Global.applicationWindow.active ? "#D79F3D"
|
2021-05-19 18:31:18 +00:00
|
|
|
: inactiveBorder)
|
|
|
|
border.width: Style.current.name === Constants.lightThemeName ? 0.5 : 0
|
|
|
|
|
|
|
|
Image {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
anchors.verticalCenterOffset: -0.25
|
|
|
|
visible: statusMacWindowButtons.containsMouse
|
2021-09-28 15:04:06 +00:00
|
|
|
source: Style.png("traffic_lights/" + (miniSensor.pressed ? "minimise_pressed" : "minimise"))
|
2021-05-19 18:31:18 +00:00
|
|
|
scale: 0.27
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: miniSensor
|
|
|
|
anchors.fill: parent
|
|
|
|
|
2021-06-03 08:29:14 +00:00
|
|
|
onClicked: statusMacWindowButtons.minimised()
|
2021-05-19 18:31:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
width: 12
|
|
|
|
height: 12
|
|
|
|
radius: width / 2
|
|
|
|
antialiasing: true
|
|
|
|
|
2021-12-08 21:20:43 +00:00
|
|
|
color: maxiSensor.pressed ? "#48943f" : (Global.applicationWindow.active || statusMacWindowButtons.containsMouse ? Qt.lighter("#62C454", 1.06)
|
2021-05-19 18:31:18 +00:00
|
|
|
: inactive)
|
2021-12-08 21:20:43 +00:00
|
|
|
border.color: maxiSensor.pressed ? "#357225" : (Global.applicationWindow.active ? "#53A73E"
|
2021-05-19 18:31:18 +00:00
|
|
|
: inactiveBorder)
|
|
|
|
border.width: Style.current.name === Constants.lightThemeName ? 0.5 : 0
|
|
|
|
|
|
|
|
Image {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
visible: statusMacWindowButtons.containsMouse
|
2021-09-28 15:04:06 +00:00
|
|
|
source: Style.png("traffic_lights/" + (maxiSensor.pressed ? "maximize_pressed" : "maximize"))
|
2021-05-19 18:31:18 +00:00
|
|
|
scale: 0.25
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: maxiSensor
|
|
|
|
anchors.fill: parent
|
|
|
|
|
2021-06-03 08:29:14 +00:00
|
|
|
onClicked: statusMacWindowButtons.maximized()
|
2021-05-19 18:31:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|