diff --git a/Modules/Bar/Bar.qml b/Modules/Bar/Bar.qml index 0622e9d..11a618d 100644 --- a/Modules/Bar/Bar.qml +++ b/Modules/Bar/Bar.qml @@ -109,7 +109,7 @@ Variants { "sectionWidgetIndex": index, "sectionWidgetsCount": Settings.data.bar.widgets.left.length } - Layout.alignment: Qt.AlignHCenter + Layout.alignment: Qt.AlignHCenter } } } @@ -132,7 +132,7 @@ Variants { "sectionWidgetIndex": index, "sectionWidgetsCount": Settings.data.bar.widgets.center.length } - Layout.alignment: Qt.AlignHCenter + Layout.alignment: Qt.AlignHCenter } } } @@ -156,7 +156,7 @@ Variants { "sectionWidgetIndex": index, "sectionWidgetsCount": Settings.data.bar.widgets.right.length } - Layout.alignment: Qt.AlignHCenter + Layout.alignment: Qt.AlignHCenter } } } @@ -169,7 +169,7 @@ Variants { anchors.fill: parent // Left Section - RowLayout{ + RowLayout { id: leftSection objectName: "leftSection" anchors.left: parent.left diff --git a/Modules/Bar/Extras/TrayMenu.qml b/Modules/Bar/Extras/TrayMenu.qml index 88d4e6c..be43621 100644 --- a/Modules/Bar/Extras/TrayMenu.qml +++ b/Modules/Bar/Extras/TrayMenu.qml @@ -178,7 +178,7 @@ PopupWindow { font.pointSize: Style.fontSizeS * scaling verticalAlignment: Text.AlignVCenter visible: modelData?.hasChildren ?? false - color: (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface) + color: (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface) } } @@ -220,9 +220,32 @@ PopupWindow { const submenuWidth = menuWidth * scaling // Assuming a similar width as the parent const overlap = 4 * scaling // A small overlap to bridge the mouse path - // Check if there's enough space on the right + // Determine submenu opening direction based on bar position and available space + let openLeft = false + + // Check bar position first + const barPosition = Settings.data.bar.position const globalPos = entry.mapToGlobal(0, 0) - const openLeft = (globalPos.x + entry.width + submenuWidth > (screen ? screen.width : Screen.width)) + + if (barPosition === "right") { + // Bar is on the right, prefer opening submenus to the left + openLeft = true + } else if (barPosition === "left") { + // Bar is on the left, prefer opening submenus to the right + openLeft = false + } else { + // Bar is horizontal (top/bottom) or undefined, use space-based logic + openLeft = (globalPos.x + entry.width + submenuWidth > (screen ? screen.width : Screen.width)) + + // Secondary check: ensure we don't open off-screen + if (openLeft && globalPos.x - submenuWidth < 0) { + // Would open off the left edge, force right opening + openLeft = false + } else if (!openLeft && globalPos.x + entry.width + submenuWidth > (screen ? screen.width : Screen.width)) { + // Would open off the right edge, force left opening + openLeft = true + } + } // Position with overlap const anchorX = openLeft ? -submenuWidth + overlap : entry.width - overlap diff --git a/Widgets/NPillHorizontal.qml b/Widgets/NPillHorizontal.qml index 2e598dd..ea7885e 100644 --- a/Widgets/NPillHorizontal.qml +++ b/Widgets/NPillHorizontal.qml @@ -78,7 +78,7 @@ Item { font.family: Settings.data.ui.fontFixed font.pointSize: Style.fontSizeXS * scaling font.weight: Style.fontWeightBold - color: forceOpen ? Color.mOnSurface : Color.mPrimary + color: forceOpen ? Color.mOnSurface : Color.mPrimary visible: revealed } diff --git a/Widgets/NSlider.qml b/Widgets/NSlider.qml index 462beca..5c069f8 100644 --- a/Widgets/NSlider.qml +++ b/Widgets/NSlider.qml @@ -34,25 +34,39 @@ Slider { width: root.visualPosition * parent.width height: parent.height radius: parent.radius - + // Animated gradient fill gradient: Gradient { orientation: Gradient.Horizontal - GradientStop { + GradientStop { position: 0.0 color: Qt.darker(Color.mPrimary, 1.2) - Behavior on color { ColorAnimation { duration: 300 } } + Behavior on color { + ColorAnimation { + duration: 300 + } + } } - GradientStop { + GradientStop { position: 0.5 color: Color.mPrimary SequentialAnimation on position { loops: Animation.Infinite - NumberAnimation { from: 0.3; to: 0.7; duration: 2000; easing.type: Easing.InOutSine } - NumberAnimation { from: 0.7; to: 0.3; duration: 2000; easing.type: Easing.InOutSine } + NumberAnimation { + from: 0.3 + to: 0.7 + duration: 2000 + easing.type: Easing.InOutSine + } + NumberAnimation { + from: 0.7 + to: 0.3 + duration: 2000 + easing.type: Easing.InOutSine + } } } - GradientStop { + GradientStop { position: 1.0 color: Qt.lighter(Color.mPrimary, 1.2) } @@ -94,4 +108,4 @@ Slider { } } } -} \ No newline at end of file +}