Add separate file for workspaces list
This commit is contained in:
@@ -28,37 +28,8 @@ Item {
|
|||||||
id: workspaceHelpers
|
id: workspaceHelpers
|
||||||
}
|
}
|
||||||
|
|
||||||
// =====================
|
WorkspacesList {
|
||||||
// LEFT: Workspaces
|
id: workspacesList
|
||||||
// =====================
|
|
||||||
RowLayout {
|
|
||||||
spacing: 10
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: 10
|
|
||||||
|
|
||||||
Text {
|
|
||||||
required property int index
|
|
||||||
|
|
||||||
property int wsId: index + 1
|
|
||||||
property var ws: workspaceHelpers.getWorkspace(wsId)
|
|
||||||
|
|
||||||
text: wsId
|
|
||||||
|
|
||||||
color: workspaceHelpers.isWorkspaceActive(wsId) ? Colors.md3.primary : (ws ? Colors.md3.on_background : Colors.md3.on_secondary)
|
|
||||||
|
|
||||||
font {
|
|
||||||
family: Constants.fontFamily
|
|
||||||
pixelSize: Constants.fontSize
|
|
||||||
bold: true
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: Hyprland.dispatch("workspace " + wsId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spacer
|
// Spacer
|
||||||
|
|||||||
35
quickshell/ui/WorkspacesList.qml
Normal file
35
quickshell/ui/WorkspacesList.qml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import Quickshell.Hyprland
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
import "../constants"
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
spacing: 10
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: 10
|
||||||
|
|
||||||
|
Text {
|
||||||
|
required property int index
|
||||||
|
|
||||||
|
property int wsId: index + 1
|
||||||
|
property var ws: workspaceHelpers.getWorkspace(wsId)
|
||||||
|
|
||||||
|
text: wsId
|
||||||
|
|
||||||
|
color: workspaceHelpers.isWorkspaceActive(wsId) ? Colors.md3.primary : (ws ? Colors.md3.on_background : Colors.md3.on_secondary)
|
||||||
|
|
||||||
|
font {
|
||||||
|
family: Constants.fontFamily
|
||||||
|
pixelSize: Constants.fontSize
|
||||||
|
bold: true
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: Hyprland.dispatch("workspace " + wsId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user