Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06e75f9473 | ||
|
|
007c9f4eca |
1 changed files with 82 additions and 11 deletions
|
|
@ -14,9 +14,11 @@ PanelWindow {
|
||||||
|
|
||||||
required property var screen
|
required property var screen
|
||||||
|
|
||||||
visible: S.DockState.open
|
visible: _winVisible
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
|
property bool _winVisible: false
|
||||||
|
|
||||||
WlrLayershell.layer: S.DockState.mode === "pinned" ? WlrLayer.Top : WlrLayer.Overlay
|
WlrLayershell.layer: S.DockState.mode === "pinned" ? WlrLayer.Top : WlrLayer.Overlay
|
||||||
WlrLayershell.exclusiveZone: S.DockState.mode === "pinned" ? _dockWidth : 0
|
WlrLayershell.exclusiveZone: S.DockState.mode === "pinned" ? _dockWidth : 0
|
||||||
WlrLayershell.namespace: "nova-dock"
|
WlrLayershell.namespace: "nova-dock"
|
||||||
|
|
@ -47,17 +49,51 @@ PanelWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Slide animation
|
// Slide animation - managed manually so window stays visible during hide
|
||||||
property real _slideX: S.DockState.open ? 0 : _dockWidth
|
property real _slideX: _dockWidth
|
||||||
|
|
||||||
Behavior on _slideX {
|
Connections {
|
||||||
enabled: !S.Theme.reducedMotion
|
target: S.DockState
|
||||||
NumberAnimation {
|
function onOpenChanged() {
|
||||||
duration: 200
|
if (S.DockState.open) {
|
||||||
easing.type: Easing.OutCubic
|
root._winVisible = true;
|
||||||
|
_hideAnim.stop();
|
||||||
|
if (S.Theme.reducedMotion) {
|
||||||
|
root._slideX = 0;
|
||||||
|
} else {
|
||||||
|
_showAnim.start();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_showAnim.stop();
|
||||||
|
if (S.Theme.reducedMotion) {
|
||||||
|
root._slideX = root._dockWidth;
|
||||||
|
root._winVisible = false;
|
||||||
|
} else {
|
||||||
|
_hideAnim.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NumberAnimation {
|
||||||
|
id: _showAnim
|
||||||
|
target: root
|
||||||
|
property: "_slideX"
|
||||||
|
to: 0
|
||||||
|
duration: 200
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
}
|
||||||
|
|
||||||
|
NumberAnimation {
|
||||||
|
id: _hideAnim
|
||||||
|
target: root
|
||||||
|
property: "_slideX"
|
||||||
|
to: root._dockWidth
|
||||||
|
duration: 200
|
||||||
|
easing.type: Easing.InCubic
|
||||||
|
onFinished: root._winVisible = false
|
||||||
|
}
|
||||||
|
|
||||||
// Overlay mode: close when cursor leaves
|
// Overlay mode: close when cursor leaves
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
id: _dockHover
|
id: _dockHover
|
||||||
|
|
@ -88,13 +124,47 @@ PanelWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accent border on the left edge
|
// Left edge gradient line - marks the virtual screen edge when pinned,
|
||||||
|
// simple accent line in overlay mode
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: _edgeLine
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
width: 1
|
width: 1
|
||||||
color: root._accent
|
|
||||||
|
gradient: S.DockState.mode === "pinned" ? _screenEdgeGradient : null
|
||||||
|
color: S.DockState.mode === "pinned" ? "transparent" : root._accent
|
||||||
|
opacity: _bg.opacity
|
||||||
|
|
||||||
|
transform: Translate {
|
||||||
|
x: root._slideX
|
||||||
|
}
|
||||||
|
|
||||||
|
Gradient {
|
||||||
|
id: _screenEdgeGradient
|
||||||
|
GradientStop {
|
||||||
|
position: 0
|
||||||
|
color: S.Theme.base0C
|
||||||
|
}
|
||||||
|
GradientStop {
|
||||||
|
position: 1
|
||||||
|
color: S.Theme.base09
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dock content border - 1px accent, inset from the edge line by the gap
|
||||||
|
Rectangle {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: S.Theme.groupSpacing
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.right: parent.right
|
||||||
|
color: "transparent"
|
||||||
|
border.color: root._accent
|
||||||
|
border.width: 1
|
||||||
|
radius: S.Theme.radius
|
||||||
opacity: _bg.opacity
|
opacity: _bg.opacity
|
||||||
|
|
||||||
transform: Translate {
|
transform: Translate {
|
||||||
|
|
@ -102,10 +172,11 @@ PanelWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Content
|
// Content - inset past the edge line + gap
|
||||||
Flickable {
|
Flickable {
|
||||||
id: _flickable
|
id: _flickable
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: S.Theme.groupSpacing + 1
|
||||||
contentHeight: _column.height
|
contentHeight: _column.height
|
||||||
clip: true
|
clip: true
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
|
|
|
||||||
Reference in a new issue