2022-04-23 14:32:36 +02:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Window
|
|
|
|
import Qt.labs.platform
|
2022-05-05 13:02:54 +02:00
|
|
|
import ScreenPlayApp
|
|
|
|
import ScreenPlay
|
2022-04-23 14:32:36 +02:00
|
|
|
|
|
|
|
SystemTrayIcon {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property Window window
|
|
|
|
visible: true
|
2022-04-30 13:22:17 +02:00
|
|
|
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/app.ico"
|
2022-04-23 14:32:36 +02:00
|
|
|
tooltip: qsTr("ScreenPlay - Double click to change you settings.")
|
|
|
|
onActivated: function (reason) {
|
|
|
|
switch (reason) {
|
|
|
|
case SystemTrayIcon.Unknown:
|
|
|
|
break
|
|
|
|
case SystemTrayIcon.Context:
|
|
|
|
break
|
|
|
|
case SystemTrayIcon.DoubleClick:
|
|
|
|
window.show()
|
|
|
|
break
|
|
|
|
case SystemTrayIcon.Trigger:
|
|
|
|
break
|
|
|
|
case SystemTrayIcon.MiddleClick:
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
menu: Menu {
|
|
|
|
MenuItem {
|
|
|
|
text: qsTr("Open ScreenPlay")
|
|
|
|
onTriggered: {
|
2022-12-27 22:07:44 +01:00
|
|
|
App.showDockIcon(true);
|
2022-04-23 14:32:36 +02:00
|
|
|
window.show()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
id: miMuteAll
|
|
|
|
|
|
|
|
property bool isMuted: true
|
|
|
|
|
|
|
|
text: qsTr("Mute all")
|
|
|
|
onTriggered: {
|
|
|
|
if (miMuteAll.isMuted) {
|
|
|
|
isMuted = false
|
|
|
|
miMuteAll.text = qsTr("Mute all")
|
2022-04-30 12:07:54 +02:00
|
|
|
App.screenPlayManager.setAllWallpaperValue("muted",
|
2022-04-23 14:32:36 +02:00
|
|
|
"true")
|
|
|
|
} else {
|
|
|
|
isMuted = true
|
|
|
|
miMuteAll.text = qsTr("Unmute all")
|
2022-04-30 12:07:54 +02:00
|
|
|
App.screenPlayManager.setAllWallpaperValue("muted",
|
2022-04-23 14:32:36 +02:00
|
|
|
"false")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
id: miStopAll
|
|
|
|
|
|
|
|
property bool isPlaying: false
|
|
|
|
|
|
|
|
text: qsTr("Pause all")
|
|
|
|
onTriggered: {
|
|
|
|
if (miStopAll.isPlaying) {
|
|
|
|
isPlaying = false
|
|
|
|
miStopAll.text = qsTr("Pause all")
|
2022-04-30 12:07:54 +02:00
|
|
|
App.screenPlayManager.setAllWallpaperValue(
|
2022-04-23 14:32:36 +02:00
|
|
|
"isPlaying", "true")
|
|
|
|
} else {
|
|
|
|
isPlaying = true
|
|
|
|
miStopAll.text = qsTr("Play all")
|
2022-04-30 12:07:54 +02:00
|
|
|
App.screenPlayManager.setAllWallpaperValue(
|
2022-04-23 14:32:36 +02:00
|
|
|
"isPlaying", "false")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
2022-11-02 12:07:04 +01:00
|
|
|
text: qsTr("Quit ScreenPlay")
|
2022-04-30 12:07:54 +02:00
|
|
|
onTriggered: App.exit()
|
2022-04-23 14:32:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|