summaryrefslogtreecommitdiff
path: root/bar/Workspace.qml
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-08-23 13:40:28 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-08-23 13:40:28 +0800
commit9e431a0947414b6fadc3e6c2b95e375ab629b2fc (patch)
tree19bbd7c5c7256574b7ad2429f45d4d6644155477 /bar/Workspace.qml
parent074d815725dd80a5407cc5772a7a8c23699cf4b6 (diff)
fix(Launcher): activeRect still lasting on old focus/selection
feat(Launcher): more animations and visual cues
Diffstat (limited to 'bar/Workspace.qml')
-rw-r--r--bar/Workspace.qml12
1 files changed, 5 insertions, 7 deletions
diff --git a/bar/Workspace.qml b/bar/Workspace.qml
index a0f5f0e..1366c2d 100644
--- a/bar/Workspace.qml
+++ b/bar/Workspace.qml
@@ -1,8 +1,6 @@
import QtQuick
import QtQuick.Layouts
-import Quickshell
import Quickshell.Hyprland
-import Quickshell.Wayland
import Qt5Compat.GraphicalEffects
import qs.config
import qs.components
@@ -57,7 +55,7 @@ Item {
}
IRect {
id: activeRect
- x: layout.x + activeIndex * Bar.wsIconSize + activeIndex * Bar.wsSpacing
+ x: layout.x + root.activeIndex * Bar.wsIconSize + root.activeIndex * Bar.wsSpacing
anchors.verticalCenter: layout.verticalCenter
implicitWidth: Bar.wsActiveIconSize
implicitHeight: Bar.wsIconSize - Bar.wsHorizontalSpacing
@@ -219,7 +217,7 @@ Item {
onPositionChanged: {
const abovedItemIndex = Math.round((mouseX - layout.x) / (Bar.wsIconSize + Bar.wsSpacing)) - 1; // TODO: workspaceActiveIconSize might be before
activeRect.x = mouseX - activeRect.width / 2;
- root.activeOccupied = getWorkspaceStats(abovedItemIndex).isOccupied || false;
+ root.activeOccupied = root.getWorkspaceStats(abovedItemIndex).isOccupied || false;
activeRect.implicitWidth = root.activeIndex === abovedItemIndex ? Bar.wsActiveIconSize : Bar.wsIconSize;
}
onExited: {
@@ -227,18 +225,18 @@ Item {
// just in case
activeRect.x = layout.x + root.activeIndex * Bar.wsIconSize + root.activeIndex * Bar.wsSpacing;
activeRect.implicitWidth = Bar.wsActiveIconSize;
- root.activeOccupied = getWorkspaceStats(root.activeIndex).isOccupied || false;
+ root.activeOccupied = root.getWorkspaceStats(root.activeIndex).isOccupied || false;
}
}
onWheel: event => {
// no idea wats wrong w/ prev so we just unify it to use +/- 1
if (event.angleDelta.y < 0) {
- if (activeIndex + 1 < Bar.wss)
+ if (root.activeIndex + 1 < Bar.wss)
Hyprland.dispatch(`hl.dsp.focus({ workspace = '+1' })`);
else
Hyprland.dispatch(`hl.dsp.focus({ workspace = '1' })`);
} else if (event.angleDelta.y > 0) {
- if (activeIndex + 1 > 1) {
+ if (root.activeIndex + 1 > 1) {
Hyprland.dispatch(`hl.dsp.focus({ workspace = '1' })`);
} else if (Bar.wss > 1) {
Hyprland.dispatch(`hl.dsp.focus({ workspace = '${Bar.wss}' })`);