Slight restructure of the Dock so the Variants is in Dock.
This commit is contained in:
parent
4f199c0240
commit
9e78807071
2 changed files with 301 additions and 301 deletions
|
|
@ -6,19 +6,12 @@ import Quickshell.Widgets
|
||||||
import qs.Settings
|
import qs.Settings
|
||||||
import qs.Components
|
import qs.Components
|
||||||
|
|
||||||
PanelWindow {
|
|
||||||
id: taskbarWindow
|
Variants {
|
||||||
visible: Settings.settings.showDock &&
|
model: Quickshell.screens
|
||||||
(Settings.settings.dockMonitors.includes(modelData.name) ||
|
|
||||||
(Settings.settings.dockMonitors.length === 0))
|
Item {
|
||||||
screen: (typeof modelData !== 'undefined' ? modelData : null)
|
property var modelData
|
||||||
exclusionMode: ExclusionMode.Ignore
|
|
||||||
anchors.bottom: true
|
|
||||||
anchors.left: true
|
|
||||||
anchors.right: true
|
|
||||||
focusable: false
|
|
||||||
color: "transparent"
|
|
||||||
implicitHeight: 43
|
|
||||||
|
|
||||||
// Auto-hide properties
|
// Auto-hide properties
|
||||||
property bool autoHide: true
|
property bool autoHide: true
|
||||||
|
|
@ -28,7 +21,7 @@ PanelWindow {
|
||||||
property int hideAnimationDuration: 200
|
property int hideAnimationDuration: 200
|
||||||
property int showAnimationDuration: 150
|
property int showAnimationDuration: 150
|
||||||
property int peekHeight: 2
|
property int peekHeight: 2
|
||||||
property int fullHeight: taskbarContainer.height
|
property int fullHeight: dockContainer.height
|
||||||
|
|
||||||
// Track hover state
|
// Track hover state
|
||||||
property bool dockHovered: false
|
property bool dockHovered: false
|
||||||
|
|
@ -39,6 +32,21 @@ PanelWindow {
|
||||||
property var contextMenuTarget: null
|
property var contextMenuTarget: null
|
||||||
property var contextMenuToplevel: 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 for auto-hide delay
|
||||||
Timer {
|
Timer {
|
||||||
id: hideTimer
|
id: hideTimer
|
||||||
|
|
@ -78,8 +86,8 @@ PanelWindow {
|
||||||
margins.bottom: hidden ? -(fullHeight - peekHeight) : 0
|
margins.bottom: hidden ? -(fullHeight - peekHeight) : 0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: taskbarContainer
|
id: dockContainer
|
||||||
width: taskbar.width + 40
|
width: dock.width + 40
|
||||||
height: Settings.settings.taskbarIconSize + 20
|
height: Settings.settings.taskbarIconSize + 20
|
||||||
topLeftRadius: 16
|
topLeftRadius: 16
|
||||||
topRightRadius: 16
|
topRightRadius: 16
|
||||||
|
|
@ -108,7 +116,7 @@ PanelWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: taskbar
|
id: dock
|
||||||
width: runningAppsRow.width
|
width: runningAppsRow.width
|
||||||
height: parent.height - 10
|
height: parent.height - 10
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
@ -155,7 +163,7 @@ PanelWindow {
|
||||||
width: Math.max(20, Settings.settings.taskbarIconSize * 0.75)
|
width: Math.max(20, Settings.settings.taskbarIconSize * 0.75)
|
||||||
height: Math.max(20, Settings.settings.taskbarIconSize * 0.75)
|
height: Math.max(20, Settings.settings.taskbarIconSize * 0.75)
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
source: taskbar.getAppIcon(modelData)
|
source: dock.getAppIcon(modelData)
|
||||||
visible: source.toString() !== ""
|
visible: source.toString() !== ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -233,7 +241,7 @@ PanelWindow {
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: contextMenuWindow
|
id: contextMenuWindow
|
||||||
visible: contextMenuVisible
|
visible: contextMenuVisible
|
||||||
screen: taskbarWindow.screen
|
screen: dockWindow.screen
|
||||||
exclusionMode: ExclusionMode.Ignore
|
exclusionMode: ExclusionMode.Ignore
|
||||||
anchors.bottom: true
|
anchors.bottom: true
|
||||||
anchors.left: true
|
anchors.left: true
|
||||||
|
|
@ -267,7 +275,7 @@ PanelWindow {
|
||||||
// Center horizontally above the icon
|
// Center horizontally above the icon
|
||||||
let xPos = pos.x + (contextMenuTarget.width - width) / 2;
|
let xPos = pos.x + (contextMenuTarget.width - width) / 2;
|
||||||
// Constrain to screen edges
|
// 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: {
|
y: {
|
||||||
|
|
@ -348,3 +356,6 @@ PanelWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
11
shell.qml
11
shell.qml
|
|
@ -16,7 +16,6 @@ import qs.Helpers
|
||||||
Scope {
|
Scope {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property alias appLauncherPanel: appLauncherPanel
|
|
||||||
property var notificationHistoryWin: notificationHistoryLoader.active ? notificationHistoryLoader.item : null
|
property var notificationHistoryWin: notificationHistoryLoader.active ? notificationHistoryLoader.item : null
|
||||||
property var settingsWindow: null
|
property var settingsWindow: null
|
||||||
property bool pendingReload: false
|
property bool pendingReload: false
|
||||||
|
|
@ -59,19 +58,9 @@ Scope {
|
||||||
|
|
||||||
Bar {
|
Bar {
|
||||||
id: bar
|
id: bar
|
||||||
shell: root
|
|
||||||
property var notificationHistoryWin: notificationHistoryLoader.active ? notificationHistoryLoader.item : null
|
property var notificationHistoryWin: notificationHistoryLoader.active ? notificationHistoryLoader.item : null
|
||||||
}
|
}
|
||||||
|
|
||||||
Variants {
|
|
||||||
model: Quickshell.screens
|
|
||||||
|
|
||||||
Dock {
|
|
||||||
id: dock
|
|
||||||
property var modelData
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Dock {
|
Dock {
|
||||||
id: dock
|
id: dock
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue