Workspace overview

This commit is contained in:
2026-08-25 18:35:44 -07:00
parent 1edfc40c6e
commit d30423779e
5 changed files with 94 additions and 6 deletions

View File

@@ -21,7 +21,6 @@ WlSessionLock {
color: "transparent" color: "transparent"
Rectangle { Rectangle {
id: content
anchors.fill: parent anchors.fill: parent
opacity: !lock.animate || capture.ready opacity: !lock.animate || capture.ready
color: "#000" color: "#000"
@@ -30,7 +29,7 @@ WlSessionLock {
radius: 16 radius: 16
color: "#141414" color: "#141414"
Image { Image {
source: Quickshell.shellPath("lockbg") source: Quickshell.shellPath("assets/lockbg")
anchors.fill: parent anchors.fill: parent
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
} }

74
Panes/Overview.qml Normal file
View File

@@ -0,0 +1,74 @@
import QtQuick
import Quickshell
import Quickshell.Hyprland
import Quickshell.Widgets
import Quickshell.Wayland
Grid {
id: overview
anchors {
top: parent.top
horizontalCenter: parent.horiontalCenter
}
spacing: 6
padding: 6
columns: 5
horizontalItemAlignment: Grid.AlignHCenter
verticalItemAlignment: Grid.AlignVCenter
component WorkspaceView: ClippingRectangle {
color: "#282828"
width: 192
radius: 8
topLeftRadius: modelData == 0 ? 12 : this.radius
topRightRadius: modelData == 4 ? 12 : this.radius
bottomLeftRadius: modelData == 5 ? 12 : this.radius
height: this.width * Hyprland.focusedMonitor?.height / Hyprland.focusedMonitor?.width
border {
width: 2
color: {
if (Hyprland.focusedWorkspace?.id == modelData + 1) {
return "#ffffffff"
}
if (hover.hovered) {
return "#aaffffff"
}
return "#00ffffff"
}
Behavior on color { ColorAnimation {duration: 150} }
}
required property var modelData
Image {
anchors.fill: parent
source: Quickshell.shellPath('assets/wallpaper')
fillMode: Image.PreserveAspectCrop
}
Repeater {
model: Hyprland.toplevels.values.filter(tl => tl.workspace?.id == modelData + 1)
delegate: ClippingRectangle {
x: modelData.lastIpcObject.at[0] / 10 - 2
y: modelData.lastIpcObject.at[1] / 10 - 2
width: modelData.lastIpcObject.size[0] / 10
height: modelData.lastIpcObject.size[1] / 10
ScreencopyView {
anchors.fill: parent
captureSource: modelData.wayland
live: background.index == 7
}
}
}
TapHandler { onTapped: {
Hyprland.dispatch(`hl.dsp.focus({workspace = ${modelData + 1}})`)
root.close()
}}
HoverHandler { id: hover }
}
Repeater {
model: 9
WorkspaceView {}
}
WorkspaceView {
modelData: -100
bottomRightRadius: 12
}
}

View File

@@ -48,6 +48,11 @@ PanelWindow {
} }
} }
mask: Region {
x: background.x; y: background.y
width: background.width; height: background.height
}
function open() { function open() {
root.visible = true root.visible = true
background.exit.stop() background.exit.stop()
@@ -159,6 +164,7 @@ PanelWindow {
Pane { Panes.Notifications {} } Pane { Panes.Notifications {} }
Pane { Panes.Volume {} } Pane { Panes.Volume {} }
Pane { Panes.Brightness {} } Pane { Panes.Brightness {} }
Pane { Panes.Overview {} }
property var entry: SequentialAnimation { property var entry: SequentialAnimation {
PauseAnimation {duration: 2} PauseAnimation {duration: 2}

View File

@@ -24,11 +24,11 @@ Variants {
ClippingRectangle { ClippingRectangle {
anchors.fill: parent anchors.fill: parent
Image { Image {
source: Quickshell.shellPath("wallpaper") source: Quickshell.shellPath("assets/wallpaper")
anchors.fill: parent anchors.fill: parent
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
} }
radius: 16 radius: 14
// PropertyAnimation on radius { // PropertyAnimation on radius {
// id: radiusAnimation // id: radiusAnimation
// running: false // running: false

View File

@@ -5,7 +5,14 @@ import Quickshell.Hyprland
import Quickshell import Quickshell
Item { Item {
width: children[0].width width: children[1].width + 16
Rectangle {
anchors.fill: parent
anchors.margins: 4
radius: 12
color: hover.hovered ? "#11ffffff": "#00ffffff"
Behavior on color {ColorAnimation {duration: 150}}
}
Row { Row {
id: workspaceRow id: workspaceRow
height: parent.height height: parent.height
@@ -51,7 +58,7 @@ Item {
} }
} }
Rectangle { Rectangle {
x: (Hyprland.focusedWorkspace.id-1) * (workspaceRow.children[0].width + workspaceRow.spacing) + 2 x: (Hyprland.focusedWorkspace.id-1) * (workspaceRow.children[0].width + workspaceRow.spacing) + 10
y: 2 y: 2
Behavior on x {NumberAnimation { Behavior on x {NumberAnimation {
duration: 300 duration: 300
@@ -61,6 +68,8 @@ Item {
height: 4 height: 4
radius: height/2 radius: height/2
} }
HoverHandler {id: hover}
TapHandler { onTapped: background.index = 7 }
Connections { Connections {
target: Hyprland target: Hyprland
function onActiveToplevelChanged() {Hyprland.refreshToplevels()} function onActiveToplevelChanged() {Hyprland.refreshToplevels()}