dock: pinned mode acts as screen split - bar shrinks, corners adjust, opaque background
This commit is contained in:
parent
c22eb51dcd
commit
f501f977d1
9 changed files with 52 additions and 21 deletions
|
|
@ -14,11 +14,11 @@ PanelWindow {
|
|||
|
||||
required property var screen
|
||||
|
||||
visible: D.DockState.open
|
||||
visible: S.DockState.open
|
||||
color: "transparent"
|
||||
|
||||
WlrLayershell.layer: D.DockState.mode === "pinned" ? WlrLayer.Top : WlrLayer.Overlay
|
||||
WlrLayershell.exclusiveZone: D.DockState.mode === "pinned" ? _dockWidth : 0
|
||||
WlrLayershell.layer: S.DockState.mode === "pinned" ? WlrLayer.Top : WlrLayer.Overlay
|
||||
WlrLayershell.exclusiveZone: S.DockState.mode === "pinned" ? _dockWidth : 0
|
||||
WlrLayershell.namespace: "nova-dock"
|
||||
|
||||
anchors.top: true
|
||||
|
|
@ -31,8 +31,21 @@ PanelWindow {
|
|||
|
||||
implicitWidth: _dockWidth
|
||||
|
||||
// Set reserved width for bar/corners when pinned
|
||||
onVisibleChanged: {
|
||||
if (S.DockState.mode === "pinned")
|
||||
S.DockState.reservedWidth = _dockWidth;
|
||||
}
|
||||
Connections {
|
||||
target: S.DockState
|
||||
function onModeChanged() {
|
||||
if (S.DockState.mode === "pinned")
|
||||
S.DockState.reservedWidth = root._dockWidth;
|
||||
}
|
||||
}
|
||||
|
||||
// Slide animation
|
||||
property real _slideX: D.DockState.open ? 0 : _dockWidth
|
||||
property real _slideX: S.DockState.open ? 0 : _dockWidth
|
||||
|
||||
Behavior on _slideX {
|
||||
enabled: !S.Theme.reducedMotion
|
||||
|
|
@ -46,7 +59,7 @@ PanelWindow {
|
|||
HoverHandler {
|
||||
id: _dockHover
|
||||
onHoveredChanged: {
|
||||
if (!hovered && D.DockState.mode === "overlay")
|
||||
if (!hovered && S.DockState.mode === "overlay")
|
||||
_overlayCloseTimer.restart();
|
||||
else
|
||||
_overlayCloseTimer.stop();
|
||||
|
|
@ -56,16 +69,16 @@ PanelWindow {
|
|||
Timer {
|
||||
id: _overlayCloseTimer
|
||||
interval: 200
|
||||
onTriggered: if (D.DockState.mode === "overlay")
|
||||
D.DockState.close()
|
||||
onTriggered: if (S.DockState.mode === "overlay")
|
||||
S.DockState.close()
|
||||
}
|
||||
|
||||
// Background
|
||||
// Background - fully opaque when pinned, semi-transparent in overlay
|
||||
Rectangle {
|
||||
id: _bg
|
||||
anchors.fill: parent
|
||||
color: S.Theme.base00
|
||||
opacity: Math.max(S.Theme.barOpacity, 0.85)
|
||||
opacity: S.DockState.mode === "pinned" ? 1.0 : Math.max(S.Theme.barOpacity, 0.85)
|
||||
|
||||
transform: Translate {
|
||||
x: root._slideX
|
||||
|
|
@ -355,7 +368,7 @@ PanelWindow {
|
|||
_runner.command = cmd;
|
||||
_runner.running = true;
|
||||
}
|
||||
onDismiss: D.DockState.close()
|
||||
onDismiss: S.DockState.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -370,13 +383,13 @@ PanelWindow {
|
|||
M.ProcessList {
|
||||
id: _cpuProcs
|
||||
sortBy: "cpu"
|
||||
active: _cpuCard.expanded && D.DockState.open
|
||||
active: _cpuCard.expanded && S.DockState.open
|
||||
}
|
||||
|
||||
M.ProcessList {
|
||||
id: _memProcs
|
||||
sortBy: "mem"
|
||||
active: _memCard.expanded && D.DockState.open
|
||||
active: _memCard.expanded && S.DockState.open
|
||||
}
|
||||
|
||||
PwObjectTracker {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import "." as D
|
||||
import "../services" as S
|
||||
|
||||
// Invisible 2px-wide PanelWindow at the right screen edge.
|
||||
// When cursor enters, opens the dock in overlay mode.
|
||||
|
|
@ -10,7 +10,7 @@ PanelWindow {
|
|||
|
||||
required property var screen
|
||||
|
||||
visible: !D.DockState.open
|
||||
visible: !S.DockState.open
|
||||
color: "transparent"
|
||||
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
|
@ -25,8 +25,8 @@ PanelWindow {
|
|||
|
||||
HoverHandler {
|
||||
onHoveredChanged: {
|
||||
if (hovered && !D.DockState.open)
|
||||
D.DockState.openOverlay();
|
||||
if (hovered && !S.DockState.open)
|
||||
S.DockState.openOverlay();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,5 +3,4 @@ module dock
|
|||
AppletDock 1.0 AppletDock.qml
|
||||
DockCard 1.0 DockCard.qml
|
||||
DockEdgeTrigger 1.0 DockEdgeTrigger.qml
|
||||
singleton DockState 1.0 DockState.qml
|
||||
# keep-sorted end
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ PanelWindow {
|
|||
right: true
|
||||
}
|
||||
|
||||
margins.right: S.DockState.reservedWidth
|
||||
|
||||
implicitHeight: S.Theme.barHeight
|
||||
exclusiveZone: implicitHeight
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
import QtQuick
|
||||
import "." as M
|
||||
import "../services" as S
|
||||
import "../dock" as D
|
||||
|
||||
M.BarModule {
|
||||
id: root
|
||||
tooltip: D.DockState.open ? "Close dock" : "Open dock"
|
||||
onTapped: D.DockState.toggle()
|
||||
tooltip: S.DockState.open ? "Close dock" : "Open dock"
|
||||
onTapped: S.DockState.toggle()
|
||||
|
||||
M.BarIcon {
|
||||
icon: D.DockState.open ? "\uDB80\uDD8B" : "\uDB80\uDD89"
|
||||
icon: S.DockState.open ? "\uDB80\uDD8B" : "\uDB80\uDD89"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ Item {
|
|||
corner: 1
|
||||
anchors.top: true
|
||||
anchors.right: true
|
||||
margins.right: S.DockState.reservedWidth
|
||||
}
|
||||
Corner {
|
||||
corner: 2
|
||||
|
|
@ -90,5 +91,6 @@ Item {
|
|||
corner: 3
|
||||
anchors.bottom: true
|
||||
anchors.right: true
|
||||
margins.right: S.DockState.reservedWidth
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,15 @@ QtObject {
|
|||
property string mode: "closed"
|
||||
readonly property bool open: mode !== "closed"
|
||||
|
||||
// Screen space reserved by the dock when pinned.
|
||||
// Bar, screen corners, etc. read this to adjust layout.
|
||||
property int reservedWidth: 0
|
||||
|
||||
onModeChanged: {
|
||||
if (mode !== "pinned")
|
||||
reservedWidth = 0;
|
||||
}
|
||||
|
||||
function openPinned() {
|
||||
mode = "pinned";
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ NotifItem 1.0 NotifItem.qml
|
|||
singleton BacklightService 1.0 BacklightService.qml
|
||||
singleton BatteryService 1.0 BatteryService.qml
|
||||
singleton BluetoothService 1.0 BluetoothService.qml
|
||||
singleton DockState 1.0 DockState.qml
|
||||
singleton IdleInhibitService 1.0 IdleInhibitService.qml
|
||||
singleton LockService 1.0 LockService.qml
|
||||
singleton Modules 1.0 Modules.qml
|
||||
|
|
|
|||
|
|
@ -33,7 +33,10 @@ shell/modules/BarModule.qml: Member "accentColor" not found on type "QQuickItem"
|
|||
shell/modules/BarModule.qml: Member "keepOpen" not found on type "QObject" [missing-property]
|
||||
shell/modules/BarModule.qml: Member "screen" not found on type "QObject" [missing-property]
|
||||
shell/modules/BarModule.qml: Unqualified access [unqualified]
|
||||
shell/modules/Bar.qml: Could not find property "right". [missing-property]
|
||||
shell/modules/Bar.qml: Type margins is used but it is not resolved [unresolved-type]
|
||||
shell/modules/Bar.qml: Type PanelWindow is not creatable. [uncreatable-type]
|
||||
shell/modules/Bar.qml: unknown grouped property scope margins. [unqualified]
|
||||
shell/modules/BatteryModule.qml: Unqualified access [unqualified]
|
||||
shell/modules/BluetoothModule.qml: Unqualified access [unqualified]
|
||||
shell/modules/ClockModule.qml: Unqualified access [unqualified]
|
||||
|
|
@ -58,7 +61,10 @@ shell/modules/NotifPopup.qml: Unqualified access [unqualified]
|
|||
shell/modules/OverviewBackdrop.qml: Type PanelWindow is not creatable. [uncreatable-type]
|
||||
shell/modules/PowerModule.qml: Unqualified access [unqualified]
|
||||
shell/modules/ScreenCapture.qml: Type PanelWindow is not creatable. [uncreatable-type]
|
||||
shell/modules/ScreenCorners.qml: Could not find property "right". [missing-property]
|
||||
shell/modules/ScreenCorners.qml: Type margins is used but it is not resolved [unresolved-type]
|
||||
shell/modules/ScreenCorners.qml: Type PanelWindow is not creatable. [uncreatable-type]
|
||||
shell/modules/ScreenCorners.qml: unknown grouped property scope margins. [unqualified]
|
||||
shell/modules/ScreenCorners.qml: Unqualified access [unqualified]
|
||||
shell/modules/TemperatureModule.qml: Unqualified access [unqualified]
|
||||
shell/modules/ThemedIcon.qml: Unqualified access [unqualified]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue