initial commit
This commit is contained in:
51
bar/Workspaces.qml
Normal file
51
bar/Workspaces.qml
Normal file
@@ -0,0 +1,51 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import QtQuick.Layouts
|
||||
|
||||
Rectangle {
|
||||
|
||||
implicitWidth: content.implicitWidth
|
||||
implicitHeight: content.implicitHeight
|
||||
color: "transparent"
|
||||
|
||||
Row {
|
||||
id: content
|
||||
anchors.fill: parent
|
||||
|
||||
|
||||
Repeater {
|
||||
model: ScriptModel {
|
||||
values: Hyprland.workspaces.values.filter(e => e.id >= 0)
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
required property HyprlandWorkspace modelData
|
||||
property bool hovered: false
|
||||
|
||||
width: 25
|
||||
height: 20
|
||||
color: "transparent"
|
||||
|
||||
Text {
|
||||
text: modelData.name
|
||||
color: modelData.active ? "#09608c" : "#cccccc"
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: 14
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
modelData.activate()
|
||||
parent.hovered = false
|
||||
}
|
||||
|
||||
onEntered: parent.hovered = !modelData.active
|
||||
onExited: parent.hovered = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user