78 lines
2.3 KiB
QML
78 lines
2.3 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Hyprland
|
|
import Quickshell.Services.SystemTray
|
|
import "../../../colors"
|
|
|
|
Row { // Workspace Row
|
|
id: trayRow
|
|
spacing: 8
|
|
|
|
Repeater {
|
|
model: SystemTray.items
|
|
|
|
Rectangle { //trayItem
|
|
width: bar.height
|
|
height: bar.height
|
|
radius: 4
|
|
color: "transparent"
|
|
border.width: 2
|
|
|
|
// Text {
|
|
// id: iconName
|
|
// text: modelData.Name
|
|
// anchors.centerIn: parent
|
|
// color: "white"
|
|
// font.pixelSize: 18
|
|
// font.family: "Inter, sans-serif"
|
|
// }
|
|
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:
|
|
modelData.activate()
|
|
break
|
|
case Qt.MiddleButton:
|
|
modelData.secondaryActivate?.()
|
|
break
|
|
case Qt.RightButton:
|
|
modelData.activate()
|
|
break
|
|
}
|
|
}
|
|
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
} |