diff --git a/Modules/Bar/Bar.qml b/Modules/Bar/Bar.qml index 9516d6d..6907327 100644 --- a/Modules/Bar/Bar.qml +++ b/Modules/Bar/Bar.qml @@ -47,10 +47,10 @@ Variants { // Floating bar margins - only apply when floating is enabled margins { - top: Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling: 0 + top: Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0 bottom: Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0 - left: Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling: 0 - right: Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling: 0 + left: Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0 + right: Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0 } Item { diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index d6de7ac..1498b11 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -167,8 +167,14 @@ Variants { // Position above the bar if it's at bottom anchors.bottom: true - // TODO fixme - margins.bottom: barAtBottom ? barHeight + floatingMargin : floatingMargin + margins.bottom: { + switch (Settings.data.bar.position) { + case "bottom": + return (Style.barHeight + Style.marginM) * scaling + (Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0) + default: + return floatingMargin + } + } // Rectangle { // anchors.fill: parent diff --git a/Modules/Toast/ToastOverlay.qml b/Modules/Toast/ToastOverlay.qml index 195a8f5..05cf809 100644 --- a/Modules/Toast/ToastOverlay.qml +++ b/Modules/Toast/ToastOverlay.qml @@ -44,13 +44,43 @@ Variants { implicitHeight: Math.round(toast.visible ? toast.height + Style.marginM * scaling : 1) // Set margins based on bar position - margins.top: Settings.data.bar.position === "top" ? (Style.barHeight + Style.marginS + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0)) : 0 + margins.top: { + switch (Settings.data.bar.position) { + case "top": + return (Style.barHeight + Style.marginS) * scaling + (Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0) + default: + return 0 + } + } - margins.bottom: Settings.data.bar.position === "bottom" ? (Style.barHeight + Style.marginS + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0)) : 0 + margins.bottom: { + switch (Settings.data.bar.position) { + case "bottom": + return (Style.barHeight + Style.marginS) * scaling + (Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0) + default: + return 0 + } + } - margins.right: (Settings.data.bar.position === "left" || Settings.data.bar.position === "top" || Settings.data.bar.position === "bottom") ? Style.marginM * scaling : 0 + margins.right: { + switch (Settings.data.bar.position) { + case "left": + case "top": + case "bottom": + return Style.marginM * scaling + default: + return 0 + } + } - margins.left: Settings.data.bar.position === "right" ? Style.marginM * scaling : 0 + margins.left: { + switch (Settings.data.bar.position) { + case "right": + return Style.marginM * scaling + default: + return 0 + } + } // Transparent background color: Color.transparent @@ -67,8 +97,8 @@ Variants { // Simple positioning - margins already account for bar targetY: Style.marginS * scaling - // Hidden position based on bar location - hiddenY: Settings.data.bar.position === "top" ? -toast.height - 20 : toast.height + 20 + // Hidden position - always start from above the screen + hiddenY: -toast.height - 20 Component.onCompleted: { // Register this toast with the service diff --git a/Widgets/NPanel.qml b/Widgets/NPanel.qml index 842d627..ef286f1 100644 --- a/Widgets/NPanel.qml +++ b/Widgets/NPanel.qml @@ -186,8 +186,29 @@ Loader { anchors.left: true anchors.right: true anchors.bottom: true - margins.top: (barIsVisible && !barAtBottom) ? (barHeight + ((Settings.data.bar.floating && !panelAnchorVerticalCenter) ? Settings.data.bar.marginVertical : 0)) : 0 - margins.bottom: (barIsVisible && barAtBottom) ? (barHeight + ((Settings.data.bar.floating && !panelAnchorVerticalCenter) ? Settings.data.bar.marginVertical : 0)) : 0 + margins.top: { + if (!barIsVisible || barAtBottom) { + return 0 + } + switch (Settings.data.bar.position) { + case "top": + return (Style.barHeight + Style.marginM) * scaling + (Settings.data.bar.floating && !panelAnchorVerticalCenter ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0) + default: + return Style.marginM * scaling + } + } + + margins.bottom: { + if (!barIsVisible || !barAtBottom) { + return 0 + } + switch (Settings.data.bar.position) { + case "bottom": + return (Style.barHeight + Style.marginM) * scaling + (Settings.data.bar.floating && !panelAnchorVerticalCenter ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0) + default: + return 0 + } + } // Close any panel with Esc without requiring focus Shortcut {