Compare commits
3 commits
a660da8f25
...
41293c02a9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41293c02a9 | ||
|
|
23297d2c4b | ||
|
|
f57dd0ea5a |
6 changed files with 30 additions and 14 deletions
|
|
@ -68,6 +68,8 @@ Item {
|
|||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: 6
|
||||
width: Math.min(implicitWidth, root.width - root.height)
|
||||
clip: implicitWidth > root.width - root.height
|
||||
|
||||
Repeater {
|
||||
model: root.buffer.length
|
||||
|
|
|
|||
|
|
@ -17,15 +17,7 @@ PanelWindow {
|
|||
right: true
|
||||
}
|
||||
|
||||
margins.right: S.DockState.reservedWidth
|
||||
|
||||
Behavior on margins.right {
|
||||
enabled: !S.Theme.reducedMotion
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
margins.right: S.DockState.reservedWidthAnimated
|
||||
|
||||
implicitHeight: S.Theme.barHeight
|
||||
exclusiveZone: implicitHeight
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ Item {
|
|||
if (!scr)
|
||||
return 0.5;
|
||||
const gx = mapToGlobal(width / 2, 0).x - scr.x;
|
||||
const effectiveWidth = scr.width - (S.DockState.reservedWidth ?? 0);
|
||||
const effectiveWidth = scr.width - (S.DockState.reservedWidthAnimated ?? 0);
|
||||
return Math.max(0, Math.min(1, gx / (effectiveWidth > 0 ? effectiveWidth : scr.width)));
|
||||
}
|
||||
property color borderColor: Qt.rgba(S.Theme.base0C.r + (S.Theme.base09.r - S.Theme.base0C.r) * _posFrac, S.Theme.base0C.g + (S.Theme.base09.g - S.Theme.base0C.g) * _posFrac, S.Theme.base0C.b + (S.Theme.base09.b - S.Theme.base0C.b) * _posFrac, 1)
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ Item {
|
|||
corner: 1
|
||||
anchors.top: true
|
||||
anchors.right: true
|
||||
margins.right: S.DockState.reservedWidth
|
||||
margins.right: S.DockState.reservedWidthAnimated
|
||||
}
|
||||
Corner {
|
||||
corner: 2
|
||||
|
|
@ -91,6 +91,6 @@ Item {
|
|||
corner: 3
|
||||
anchors.bottom: true
|
||||
anchors.right: true
|
||||
margins.right: S.DockState.reservedWidth
|
||||
margins.right: S.DockState.reservedWidthAnimated
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,19 @@ QtObject {
|
|||
// Bar, screen corners, etc. read this to adjust layout.
|
||||
property int reservedWidth: 0
|
||||
|
||||
// Animated version for smooth visual transitions.
|
||||
// Consumers that need coordinated movement use this instead.
|
||||
property int reservedWidthAnimated: 0
|
||||
|
||||
Behavior on reservedWidthAnimated {
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
}
|
||||
|
||||
onReservedWidthChanged: reservedWidthAnimated = reservedWidth
|
||||
|
||||
onModeChanged: {
|
||||
if (mode !== "pinned")
|
||||
reservedWidth = 0;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,15 @@ ShellRoot {
|
|||
id: scope
|
||||
required property var modelData
|
||||
|
||||
readonly property bool _isRightmost: {
|
||||
let maxX = -Infinity;
|
||||
for (let i = 0; i < Quickshell.screens.length; i++) {
|
||||
if (Quickshell.screens[i].x > maxX)
|
||||
maxX = Quickshell.screens[i].x;
|
||||
}
|
||||
return scope.modelData.x >= maxX;
|
||||
}
|
||||
|
||||
Bar {
|
||||
screen: scope.modelData
|
||||
}
|
||||
|
|
@ -61,14 +70,14 @@ ShellRoot {
|
|||
}
|
||||
|
||||
LazyLoader {
|
||||
active: Modules.dock.enable
|
||||
active: Modules.dock.enable && scope._isRightmost
|
||||
Dock.AppletDock {
|
||||
screen: scope.modelData
|
||||
}
|
||||
}
|
||||
|
||||
LazyLoader {
|
||||
active: Modules.dock.enable
|
||||
active: Modules.dock.enable && scope._isRightmost
|
||||
Dock.DockEdgeTrigger {
|
||||
screen: scope.modelData
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue