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 { property Component color: Component {
ColorAnimation { ColorAnimation {
duration: 120 duration: 70
easing.type: Easing.BezierSpline easing.type: Easing.BezierSpline
easing.bezierCurve: transition.easing.bezierCurve.easeIn easing.bezierCurve: transition.easing.bezierCurve.easeIn
} }
@@ -64,8 +64,9 @@ Rectangle {
color: Looks.colors.bgPanelFooterBase color: Looks.colors.bgPanelFooterBase
implicitHeight: 174 implicitHeight: 174
ListView { ListView {
id: workspaceListView
anchors { anchors {
top: parent.top top: parent.top
bottom: parent.bottom bottom: parent.bottom
@@ -73,17 +74,19 @@ Rectangle {
topMargin: 5 topMargin: 5
bottomMargin: 5 bottomMargin: 5
} }
flickableDirection: Flickable.HorizontalFlick
orientation: ListView.Horizontal
interactive: width == parent.width
width: Math.min(contentWidth + leftMargin + rightMargin, parent.width) width: Math.min(contentWidth + leftMargin + rightMargin, parent.width)
leftMargin: 5 leftMargin: 5
rightMargin: 5 rightMargin: 5
clip: true clip: true
orientation: ListView.Horizontal
spacing: 4 spacing: 4
model: ScriptModel { model: ScriptModel {
values: { values: {
const maxWorkspaceId = Math.max.apply(null, HyprlandData.workspaces.map(ws => ws.id)) const maxWorkspaceId = Math.max.apply(null, HyprlandData.workspaces.map(ws => ws.id));
return Array(maxWorkspaceId) return Array(Math.max(maxWorkspaceId, 1));
} }
} }
delegate: TaskViewWorkspace { delegate: TaskViewWorkspace {
@@ -16,6 +16,7 @@ WMouseAreaButton {
required property int workspace required property int workspace
readonly property bool isActiveWorkspace: HyprlandData.activeWorkspace?.id === root.workspace
readonly property real screenWidth: QsWindow.window.width readonly property real screenWidth: QsWindow.window.width
readonly property real screenHeight: QsWindow.window.height readonly property real screenHeight: QsWindow.window.height
readonly property real screenAspectRatio: screenWidth / screenHeight readonly property real screenAspectRatio: screenWidth / screenHeight
@@ -30,6 +31,12 @@ WMouseAreaButton {
Hyprland.dispatch(`workspace ${root.workspace}`); 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 { ColumnLayout {
anchors { anchors {
fill: parent 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
}
}
} }