Slight restructure of the Dock so the Variants is in Dock.

This commit is contained in:
quadbyte 2025-08-07 20:26:13 -04:00
parent 4f199c0240
commit 9e78807071
2 changed files with 301 additions and 301 deletions

View file

@ -6,19 +6,12 @@ import Quickshell.Widgets
import qs.Settings
import qs.Components
PanelWindow {
id: taskbarWindow
visible: Settings.settings.showDock &&
(Settings.settings.dockMonitors.includes(modelData.name) ||
(Settings.settings.dockMonitors.length === 0))
screen: (typeof modelData !== 'undefined' ? modelData : null)
exclusionMode: ExclusionMode.Ignore
anchors.bottom: true
anchors.left: true
anchors.right: true
focusable: false
color: "transparent"
implicitHeight: 43
Variants {
model: Quickshell.screens
Item {
property var modelData
// Auto-hide properties
property bool autoHide: true
@ -28,7 +21,7 @@ PanelWindow {
property int hideAnimationDuration: 200
property int showAnimationDuration: 150
property int peekHeight: 2
property int fullHeight: taskbarContainer.height
property int fullHeight: dockContainer.height
// Track hover state
property bool dockHovered: false
@ -39,6 +32,21 @@ PanelWindow {
property var contextMenuTarget: null
property var contextMenuToplevel: null
PanelWindow {
id: dockWindow
visible: Settings.settings.showDock &&
(Settings.settings.dockMonitors.includes(modelData.name) ||
(Settings.settings.dockMonitors.length === 0))
screen: modelData
exclusionMode: ExclusionMode.Ignore
anchors.bottom: true
anchors.left: true
anchors.right: true
focusable: false
color: "transparent"
implicitHeight: 43
// Timer for auto-hide delay
Timer {
id: hideTimer
@ -78,8 +86,8 @@ PanelWindow {
margins.bottom: hidden ? -(fullHeight - peekHeight) : 0
Rectangle {
id: taskbarContainer
width: taskbar.width + 40
id: dockContainer
width: dock.width + 40
height: Settings.settings.taskbarIconSize + 20
topLeftRadius: 16
topRightRadius: 16
@ -108,7 +116,7 @@ PanelWindow {
}
Item {
id: taskbar
id: dock
width: runningAppsRow.width
height: parent.height - 10
anchors.centerIn: parent
@ -155,7 +163,7 @@ PanelWindow {
width: Math.max(20, Settings.settings.taskbarIconSize * 0.75)
height: Math.max(20, Settings.settings.taskbarIconSize * 0.75)
anchors.centerIn: parent
source: taskbar.getAppIcon(modelData)
source: dock.getAppIcon(modelData)
visible: source.toString() !== ""
}
@ -233,7 +241,7 @@ PanelWindow {
PanelWindow {
id: contextMenuWindow
visible: contextMenuVisible
screen: taskbarWindow.screen
screen: dockWindow.screen
exclusionMode: ExclusionMode.Ignore
anchors.bottom: true
anchors.left: true
@ -267,7 +275,7 @@ PanelWindow {
// Center horizontally above the icon
let xPos = pos.x + (contextMenuTarget.width - width) / 2;
// Constrain to screen edges
return Math.max(0, Math.min(xPos, taskbarWindow.width - width));
return Math.max(0, Math.min(xPos, dockWindow.width - width));
}
y: {
@ -347,4 +355,7 @@ PanelWindow {
}
}
}
}
}
}

View file

@ -16,7 +16,6 @@ import qs.Helpers
Scope {
id: root
property alias appLauncherPanel: appLauncherPanel
property var notificationHistoryWin: notificationHistoryLoader.active ? notificationHistoryLoader.item : null
property var settingsWindow: null
property bool pendingReload: false
@ -59,19 +58,9 @@ Scope {
Bar {
id: bar
shell: root
property var notificationHistoryWin: notificationHistoryLoader.active ? notificationHistoryLoader.item : null
}
Variants {
model: Quickshell.screens
Dock {
id: dock
property var modelData
}
}
Dock {
id: dock
}