waffles: taskview: indicate active ws

This commit is contained in:
end-4
2025-12-12 09:18:55 +01:00
parent 2ead5fa4ab
commit 39a3a0c484
3 changed files with 32 additions and 5 deletions
@@ -177,7 +177,7 @@ Singleton {
property Component color: Component {
ColorAnimation {
duration: 120
duration: 70
easing.type: Easing.BezierSpline
easing.bezierCurve: transition.easing.bezierCurve.easeIn
}
@@ -64,8 +64,9 @@ Rectangle {
color: Looks.colors.bgPanelFooterBase
implicitHeight: 174
ListView {
id: workspaceListView
anchors {
top: parent.top
bottom: parent.bottom
@@ -73,17 +74,19 @@ Rectangle {
topMargin: 5
bottomMargin: 5
}
flickableDirection: Flickable.HorizontalFlick
orientation: ListView.Horizontal
interactive: width == parent.width
width: Math.min(contentWidth + leftMargin + rightMargin, parent.width)
leftMargin: 5
rightMargin: 5
clip: true
orientation: ListView.Horizontal
spacing: 4
model: ScriptModel {
values: {
const maxWorkspaceId = Math.max.apply(null, HyprlandData.workspaces.map(ws => ws.id))
return Array(maxWorkspaceId)
const maxWorkspaceId = Math.max.apply(null, HyprlandData.workspaces.map(ws => ws.id));
return Array(Math.max(maxWorkspaceId, 1));
}
}
delegate: TaskViewWorkspace {
@@ -16,6 +16,7 @@ WMouseAreaButton {
required property int workspace
readonly property bool isActiveWorkspace: HyprlandData.activeWorkspace?.id === root.workspace
readonly property real screenWidth: QsWindow.window.width
readonly property real screenHeight: QsWindow.window.height
readonly property real screenAspectRatio: screenWidth / screenHeight
@@ -30,6 +31,12 @@ WMouseAreaButton {
Hyprland.dispatch(`workspace ${root.workspace}`);
}
colBackground: ColorUtils.transparentize(Looks.colors.bg2, isActiveWorkspace ? 0 : 1)
Behavior on color {
animation: Looks.transition.color.createObject(this)
}
// Content
ColumnLayout {
anchors {
fill: parent
@@ -94,4 +101,21 @@ WMouseAreaButton {
}
}
}
// Active indicator
WFadeLoader {
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
}
shown: root.isActiveWorkspace
sourceComponent: Rectangle {
id: activeIndicator
implicitWidth: 32
implicitHeight: 3
color: Looks.colors.accent
radius: height / 2
}
}
}