Compare commits
3
Commits
main
...
honney/tray
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02606e5ab3 | ||
|
|
c7b0ed957a | ||
|
|
c011c76900 |
@@ -72,6 +72,7 @@ PanelWindow {
|
|||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
||||||
// TODO: Add bluetooth, network, audio, power, maybe HW monitor
|
// TODO: Add bluetooth, network, audio, power, maybe HW monitor
|
||||||
|
Tray{}
|
||||||
Network {}
|
Network {}
|
||||||
PowerButton {}
|
PowerButton {}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
import Quickshell.Services.SystemTray
|
||||||
|
import Quickshell.Io
|
||||||
|
import "../../../colors"
|
||||||
|
|
||||||
|
Row { // Workspace Row
|
||||||
|
id: trayRow
|
||||||
|
spacing: 8
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: SystemTray.items
|
||||||
|
|
||||||
|
Rectangle { //trayItem
|
||||||
|
id: trayItem
|
||||||
|
width: bar.height
|
||||||
|
height: bar.height
|
||||||
|
radius: 4
|
||||||
|
color: "transparent"
|
||||||
|
border.width: 2
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: steamRunner
|
||||||
|
command: ["steam", "steam://open/main"]
|
||||||
|
running: false
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: workspaceButton
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||||
|
onClicked: (mouse) => {
|
||||||
|
switch (mouse.button) {
|
||||||
|
case Qt.LeftButton:
|
||||||
|
if (!modelData.onlyMenu) {
|
||||||
|
modelData.activate()
|
||||||
|
console.log('Activcate function of ', modelData.title)
|
||||||
|
}
|
||||||
|
if (modelData.title.trim()==="Steam") {
|
||||||
|
steamRunner.startDetached()
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case Qt.MiddleButton:
|
||||||
|
modelData.secondaryActivate()
|
||||||
|
break
|
||||||
|
// case Qt.RightButton:
|
||||||
|
// if (modelData.hasMenu) {
|
||||||
|
// console.log('Activcate menu of ', modelData.title)
|
||||||
|
// menuAnchor.open()
|
||||||
|
// }
|
||||||
|
// break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// QsMenuAnchor {
|
||||||
|
// id: menuAnchor
|
||||||
|
// menu: modelData.menu
|
||||||
|
// anchor.window: menuHost
|
||||||
|
// }
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: workspaceButton.containsMouse ? Colors.tertiaryContainer
|
||||||
|
: modelData.active ? Colors.primaryContainer
|
||||||
|
: Colors.secondaryContainer
|
||||||
|
border.color: workspaceButton.containsMouse ? Colors.tertiaryContainer_fg
|
||||||
|
: modelData.active ? Colors.primaryContainer_fg
|
||||||
|
: Colors.secondaryContainer_fg
|
||||||
|
radius: 6
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Image { // Image
|
||||||
|
id: iconImage
|
||||||
|
source: modelData.icon
|
||||||
|
fillMode: Image.PreserveAspectCrop
|
||||||
|
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
width: bar.height*0.75
|
||||||
|
height: bar.height*0.75
|
||||||
|
|
||||||
|
asynchronous: true
|
||||||
|
cache: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user