Revert "Dock: add position option"

This reverts commit 6235d2b3d6.
This commit is contained in:
Ly-sec
2025-10-04 18:43:55 +02:00
parent 1f13fda4a4
commit b1e5f406e3
11 changed files with 27 additions and 399 deletions
+2 -25
View File
@@ -16,7 +16,6 @@ PopupWindow {
property real scaling: 1.0
property bool hovered: menuMouseArea.containsMouse
property var onAppClosed: null // Callback function for when an app is closed
property string dockPosition: Settings.data.dock.position || "bottom"
// Track which menu item is hovered
property int hoveredItem: -1 // -1: none, 0: focus, 1: pin, 2: close
@@ -56,8 +55,8 @@ PopupWindow {
}
anchor.item: anchorItem
anchor.rect.x: anchorItem ? getAnchorX() : 0
anchor.rect.y: anchorItem ? getAnchorY() : 0
anchor.rect.x: anchorItem ? (anchorItem.width - implicitWidth) / 2 : 0
anchor.rect.y: anchorItem ? -implicitHeight - (Style.marginM * scaling) : 0
function show(item, toplevelData) {
if (!item) {
@@ -74,28 +73,6 @@ PopupWindow {
visible = false
}
function getAnchorX() {
switch (dockPosition) {
case "left":
return anchorItem.width + (Style.marginM * scaling)
case "right":
return -implicitWidth - (Style.marginM * scaling)
default:
return (anchorItem.width - implicitWidth) / 2
}
}
function getAnchorY() {
switch (dockPosition) {
case "top":
return anchorItem.height + (Style.marginM * scaling)
case "bottom":
return -implicitHeight - (Style.marginM * scaling)
default:
return (anchorItem.height - implicitHeight) / 2
}
}
// Helper function to determine which menu item is under the mouse
function getHoveredItem(mouseY) {
const itemHeight = 32 * scaling