diff --git a/Modules/Bar/Extras/TrayMenu.qml b/Modules/Bar/Extras/TrayMenu.qml index 811bc6342..477c6d9d1 100644 --- a/Modules/Bar/Extras/TrayMenu.qml +++ b/Modules/Bar/Extras/TrayMenu.qml @@ -138,7 +138,7 @@ PopupWindow { if (isSubMenu) { return anchorY; } - return anchorY + (Settings.getBarPositionForScreen(root.screen?.name) === "bottom" ? -implicitHeight : Style.barHeight); + return anchorY + (Settings.getBarPositionForScreen(root.screen?.name) === "bottom" ? -implicitHeight : Style.getBarHeightForScreen(root.screen?.name)); } function showAt(item, x, y) { diff --git a/Modules/Bar/Widgets/Spacer.qml b/Modules/Bar/Widgets/Spacer.qml index 549b99ada..cb7edde0f 100644 --- a/Modules/Bar/Widgets/Spacer.qml +++ b/Modules/Bar/Widgets/Spacer.qml @@ -29,10 +29,11 @@ Item { readonly property string barPosition: Settings.getBarPositionForScreen(screen?.name) readonly property bool isBarVertical: barPosition === "left" || barPosition === "right" + readonly property real barHeight: Style.getBarHeightForScreen(screen?.name) readonly property int spacerSize: widgetSettings.width !== undefined ? widgetSettings.width : widgetMetadata.width - implicitWidth: isBarVertical ? Style.barHeight : spacerSize - implicitHeight: isBarVertical ? spacerSize : Style.barHeight + implicitWidth: isBarVertical ? barHeight : spacerSize + implicitHeight: isBarVertical ? spacerSize : barHeight width: implicitWidth height: implicitHeight } diff --git a/Modules/Bar/Widgets/Taskbar.qml b/Modules/Bar/Widgets/Taskbar.qml index 55edf3315..273264c60 100644 --- a/Modules/Bar/Widgets/Taskbar.qml +++ b/Modules/Bar/Widgets/Taskbar.qml @@ -22,6 +22,7 @@ Rectangle { readonly property string barPosition: Settings.getBarPositionForScreen(screen?.name) readonly property bool isVerticalBar: barPosition === "left" || barPosition === "right" + readonly property real barHeight: Style.getBarHeightForScreen(screen?.name) property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId] property var widgetSettings: { @@ -742,13 +743,13 @@ Rectangle { let menuX, menuY; if (root.barPosition === "top") { menuX = globalPos.x + (item.width / 2) - (contextMenu.implicitWidth / 2); - menuY = Style.barHeight + Style.marginS; + menuY = barHeight + Style.marginS; } else if (root.barPosition === "bottom") { const menuHeight = 12 + contextMenu.model.length * contextMenu.itemHeight; menuX = globalPos.x + (item.width / 2) - (contextMenu.implicitWidth / 2); menuY = -menuHeight - Style.marginS; } else if (root.barPosition === "left") { - menuX = Style.barHeight + Style.marginS; + menuX = barHeight + Style.marginS; menuY = globalPos.y + (item.height / 2) - (contextMenu.implicitHeight / 2); } else { // right diff --git a/Modules/Bar/Widgets/Tray.qml b/Modules/Bar/Widgets/Tray.qml index 736c4f1d0..fd823600b 100644 --- a/Modules/Bar/Widgets/Tray.qml +++ b/Modules/Bar/Widgets/Tray.qml @@ -55,6 +55,7 @@ Rectangle { readonly property string barPosition: Settings.getBarPositionForScreen(screen?.name) readonly property bool isVertical: barPosition === "left" || barPosition === "right" + readonly property real barHeight: Style.getBarHeightForScreen(screen?.name) readonly property bool density: Settings.data.bar.density readonly property int iconSize: Style.toOdd(Style.capsuleHeight * 0.65) @@ -418,7 +419,7 @@ Rectangle { } else { // For horizontal bars: center horizontally and position below menuX = (width / 2) - (trayMenu.item.width / 2); - menuY = (barPosition === "top") ? Style.barHeight + Style.marginS - 2 : Style.barHeight + Style.marginS - 2; + menuY = (barPosition === "top") ? barHeight + Style.marginS - 2 : barHeight + Style.marginS - 2; } trayMenu.item.trayItem = modelData; trayMenu.item.widgetSection = root.section; diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index ebb419195..619a835f7 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -36,6 +36,7 @@ Item { readonly property string barPosition: Settings.getBarPositionForScreen(screen?.name) readonly property bool isVertical: barPosition === "left" || barPosition === "right" + readonly property real barHeight: Style.getBarHeightForScreen(screen?.name) readonly property real baseDimensionRatio: 0.65 * (widgetSettings.labelMode === "none" ? 0.75 : 1) readonly property string labelMode: (widgetSettings.labelMode !== undefined) ? widgetSettings.labelMode : widgetMetadata.labelMode @@ -101,8 +102,8 @@ Item { signal workspaceChanged(int workspaceId, color accentColor) - implicitWidth: showApplications ? (isVertical ? groupedGrid.implicitWidth : Math.round(groupedGrid.implicitWidth + horizontalPadding * hasLabel)) : (isVertical ? Style.barHeight : computeWidth()) - implicitHeight: showApplications ? (isVertical ? Math.round(groupedGrid.implicitHeight + horizontalPadding * 0.6 * hasLabel) : Style.barHeight) : (isVertical ? computeHeight() : Style.barHeight) + implicitWidth: showApplications ? (isVertical ? groupedGrid.implicitWidth : Math.round(groupedGrid.implicitWidth + horizontalPadding * hasLabel)) : (isVertical ? barHeight : computeWidth()) + implicitHeight: showApplications ? (isVertical ? Math.round(groupedGrid.implicitHeight + horizontalPadding * 0.6 * hasLabel) : barHeight) : (isVertical ? computeHeight() : barHeight) function getWorkspaceWidth(ws) { const d = Math.round(Style.capsuleHeight * root.baseDimensionRatio); diff --git a/Modules/DesktopWidgets/DesktopWidgets.qml b/Modules/DesktopWidgets/DesktopWidgets.qml index 4a35d0581..a4de4ecb3 100644 --- a/Modules/DesktopWidgets/DesktopWidgets.qml +++ b/Modules/DesktopWidgets/DesktopWidgets.qml @@ -309,18 +309,19 @@ Variants { readonly property string barPos: Settings.getBarPositionForScreen(window.screen?.name) readonly property bool barFloating: Settings.data.bar.floating || false + readonly property real barHeight: Style.getBarHeightForScreen(window.screen?.name) readonly property int barOffsetTop: { if (barPos !== "top") return Style.marginM; const floatMarginV = barFloating ? Math.ceil(Settings.data.bar.marginVertical) : 0; - return Style.barHeight + floatMarginV + Style.marginM; + return barHeight + floatMarginV + Style.marginM; } readonly property int barOffsetRight: { if (barPos !== "right") return Style.marginM; const floatMarginH = barFloating ? Math.ceil(Settings.data.bar.marginHorizontal) : 0; - return Style.barHeight + floatMarginH + Style.marginM; + return barHeight + floatMarginH + Style.marginM; } // Internal state for drag tracking (session-only, resets on restart) diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index 0a22b384a..ea5bb13d7 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -84,7 +84,7 @@ Loader { // Bar detection and positioning properties readonly property bool hasBar: modelData && modelData.name ? (Settings.data.bar.monitors.includes(modelData.name) || (Settings.data.bar.monitors.length === 0)) : false readonly property bool barAtSameEdge: hasBar && Settings.getBarPositionForScreen(modelData?.name) === dockPosition - readonly property int barHeight: Style.barHeight + readonly property int barHeight: Style.getBarHeightForScreen(modelData?.name) // Shared state between windows property bool dockHovered: false @@ -312,10 +312,10 @@ Loader { color: "transparent" // When bar is at same edge, position peek window past the bar so it receives mouse events - margins.top: dockPosition === "top" && barAtSameEdge ? (Style.barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0)) : 0 - margins.bottom: dockPosition === "bottom" && barAtSameEdge ? (Style.barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0)) : 0 - margins.left: dockPosition === "left" && barAtSameEdge ? (Style.barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal : 0)) : 0 - margins.right: dockPosition === "right" && barAtSameEdge ? (Style.barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal : 0)) : 0 + margins.top: dockPosition === "top" && barAtSameEdge ? (barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0)) : 0 + margins.bottom: dockPosition === "bottom" && barAtSameEdge ? (barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0)) : 0 + margins.left: dockPosition === "left" && barAtSameEdge ? (barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal : 0)) : 0 + margins.right: dockPosition === "right" && barAtSameEdge ? (barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal : 0)) : 0 WlrLayershell.namespace: "noctalia-dock-peek-" + (screen?.name || "unknown") WlrLayershell.exclusionMode: ExclusionMode.Ignore @@ -391,10 +391,10 @@ Loader { anchors.right: dockPosition === "right" // Offset past bar when at same edge (skip bar offset if dock is exclusive - exclusion zones stack) - margins.top: dockPosition === "top" ? (barAtSameEdge && !exclusive ? Style.barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0) + floatingMargin : floatingMargin) : 0 - margins.bottom: dockPosition === "bottom" ? (barAtSameEdge && !exclusive ? Style.barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0) + floatingMargin : floatingMargin) : 0 - margins.left: dockPosition === "left" ? (barAtSameEdge && !exclusive ? Style.barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal : 0) + floatingMargin : floatingMargin) : 0 - margins.right: dockPosition === "right" ? (barAtSameEdge && !exclusive ? Style.barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal : 0) + floatingMargin : floatingMargin) : 0 + margins.top: dockPosition === "top" ? (barAtSameEdge && !exclusive ? barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0) + floatingMargin : floatingMargin) : 0 + margins.bottom: dockPosition === "bottom" ? (barAtSameEdge && !exclusive ? barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0) + floatingMargin : floatingMargin) : 0 + margins.left: dockPosition === "left" ? (barAtSameEdge && !exclusive ? barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal : 0) + floatingMargin : floatingMargin) : 0 + margins.right: dockPosition === "right" ? (barAtSameEdge && !exclusive ? barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal : 0) + floatingMargin : floatingMargin) : 0 // Container wrapper for animations Item { @@ -408,10 +408,10 @@ Loader { readonly property bool barOnBottom: hasBar && screenBarPosition === "bottom" && !Settings.data.bar.floating // Calculate padding needed to shift center to match exclusive mode - readonly property int extraTop: (isVertical && !exclusive && barOnTop) ? Style.barHeight : 0 - readonly property int extraBottom: (isVertical && !exclusive && barOnBottom) ? Style.barHeight : 0 - readonly property int extraLeft: (!isVertical && !exclusive && barOnLeft) ? Style.barHeight : 0 - readonly property int extraRight: (!isVertical && !exclusive && barOnRight) ? Style.barHeight : 0 + readonly property int extraTop: (isVertical && !exclusive && barOnTop) ? barHeight : 0 + readonly property int extraBottom: (isVertical && !exclusive && barOnBottom) ? barHeight : 0 + readonly property int extraLeft: (!isVertical && !exclusive && barOnLeft) ? barHeight : 0 + readonly property int extraRight: (!isVertical && !exclusive && barOnRight) ? barHeight : 0 width: dockContainer.width + extraLeft + extraRight height: dockContainer.height + extraTop + extraBottom diff --git a/Modules/Notification/Notification.qml b/Modules/Notification/Notification.qml index 0579589c5..97c1f8c28 100644 --- a/Modules/Notification/Notification.qml +++ b/Modules/Notification/Notification.qml @@ -78,6 +78,7 @@ Variants { readonly property string barPos: Settings.getBarPositionForScreen(notifWindow.screen?.name) readonly property bool isFloating: Settings.data.bar.floating + readonly property real barHeight: Style.getBarHeightForScreen(notifWindow.screen?.name) readonly property int notifWidth: Math.round(440 * Style.uiScaleRatio) readonly property int shadowPadding: Style.shadowBlurMax + Style.marginL @@ -87,28 +88,28 @@ Variants { if (barPos !== "top") return 0; const floatMarginV = isFloating ? Math.ceil(Settings.data.bar.marginVertical) : 0; - return Style.barHeight + floatMarginV; + return barHeight + floatMarginV; } readonly property int barOffsetBottom: { if (barPos !== "bottom") return 0; const floatMarginV = isFloating ? Math.ceil(Settings.data.bar.marginVertical) : 0; - return Style.barHeight + floatMarginV; + return barHeight + floatMarginV; } readonly property int barOffsetLeft: { if (barPos !== "left") return 0; const floatMarginH = isFloating ? Math.ceil(Settings.data.bar.marginHorizontal) : 0; - return Style.barHeight + floatMarginH; + return barHeight + floatMarginH; } readonly property int barOffsetRight: { if (barPos !== "right") return 0; const floatMarginH = isFloating ? Math.ceil(Settings.data.bar.marginHorizontal) : 0; - return Style.barHeight + floatMarginH; + return barHeight + floatMarginH; } // Anchoring diff --git a/Modules/OSD/OSD.qml b/Modules/OSD/OSD.qml index aa8b0a436..a71d7817d 100644 --- a/Modules/OSD/OSD.qml +++ b/Modules/OSD/OSD.qml @@ -421,6 +421,7 @@ Variants { anchors.right: isRight readonly property string screenBarPosition: Settings.getBarPositionForScreen(root.modelData?.name) + readonly property real barHeight: Style.getBarHeightForScreen(root.modelData?.name) function calculateMargin(isAnchored, position) { if (!isAnchored) @@ -430,7 +431,7 @@ Variants { if (screenBarPosition === position) { const isVertical = position === "top" || position === "bottom"; const floatExtra = Math.ceil(Settings.data.bar.floating ? (isVertical ? Settings.data.bar.marginVertical : Settings.data.bar.marginHorizontal) : 0); - return Style.barHeight + base + floatExtra; + return barHeight + base + floatExtra; } return base; } diff --git a/Modules/Toast/ToastScreen.qml b/Modules/Toast/ToastScreen.qml index f52da250d..9ed66c3ac 100644 --- a/Modules/Toast/ToastScreen.qml +++ b/Modules/Toast/ToastScreen.qml @@ -145,34 +145,35 @@ Item { readonly property string barPos: Settings.getBarPositionForScreen(panel.screen?.name) readonly property bool isFloating: Settings.data.bar.floating + readonly property real barHeight: Style.getBarHeightForScreen(panel.screen?.name) // Calculate bar offsets for each edge separately readonly property int barOffsetTop: { if (barPos !== "top") return 0; const floatMarginV = isFloating ? Math.ceil(Settings.data.bar.marginVertical) : 0; - return Style.barHeight + floatMarginV; + return barHeight + floatMarginV; } readonly property int barOffsetBottom: { if (barPos !== "bottom") return 0; const floatMarginV = isFloating ? Math.ceil(Settings.data.bar.marginVertical) : 0; - return Style.barHeight + floatMarginV; + return barHeight + floatMarginV; } readonly property int barOffsetLeft: { if (barPos !== "left") return 0; const floatMarginH = isFloating ? Math.ceil(Settings.data.bar.marginHorizontal) : 0; - return Style.barHeight + floatMarginH; + return barHeight + floatMarginH; } readonly property int barOffsetRight: { if (barPos !== "right") return 0; const floatMarginH = isFloating ? Math.ceil(Settings.data.bar.marginHorizontal) : 0; - return Style.barHeight + floatMarginH; + return barHeight + floatMarginH; } readonly property int shadowPadding: Style.shadowBlurMax + Style.marginL diff --git a/Widgets/NPopupContextMenu.qml b/Widgets/NPopupContextMenu.qml index 6fe0ec47e..58777ee82 100644 --- a/Widgets/NPopupContextMenu.qml +++ b/Widgets/NPopupContextMenu.qml @@ -22,6 +22,7 @@ PopupWindow { property real calculatedWidth: 180 readonly property string barPosition: Settings.getBarPositionForScreen(screen?.name) + readonly property real barHeight: Style.getBarHeightForScreen(screen?.name) signal triggered(string action, var item) @@ -144,7 +145,7 @@ PopupWindow { baseY = -(implicitHeight + Style.marginM); } else if (root.barPosition === "top") { // For top bar: position menu below bar - baseY = Style.barHeight + Style.marginM; + baseY = barHeight + Style.marginM; } else { // For left/right bar: vertically center on anchor baseY = anchorCenterY - (implicitHeight / 2); @@ -169,7 +170,7 @@ PopupWindow { if (root.barPosition === "bottom") { return -implicitHeight - Style.marginM; } - return Style.barHeight; + return barHeight; } Component.onCompleted: {