From 292ecd493b5d21e0cafcf26a6022afeafbdb892a Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Sun, 12 Oct 2025 09:33:04 -0400 Subject: [PATCH] More cleanup --- Assets/settings-default.json | 1 - Modules/Background/ScreenCorners.qml | 8 +- Modules/Bar/Bar.qml | 4 +- Modules/Bar/Extras/BarPillHorizontal.qml | 2 +- Modules/Bar/Extras/BarPillVertical.qml | 2 +- Modules/Bar/Extras/TrayMenu.qml | 2 +- Modules/Bar/Widgets/ActiveWindow.qml | 10 +- Modules/Bar/Widgets/Clock.qml | 6 +- Modules/Bar/Widgets/MediaMini.qml | 10 +- Modules/Bar/Widgets/SystemMonitor.qml | 18 ++-- Modules/Bar/Widgets/Taskbar.qml | 6 +- Modules/Bar/Widgets/Tray.qml | 8 +- Modules/Bar/Widgets/Workspace.qml | 10 +- Services/ScalingService.qml | 131 ----------------------- Widgets/NPanel.qml | 15 +-- 15 files changed, 46 insertions(+), 187 deletions(-) delete mode 100644 Services/ScalingService.qml diff --git a/Assets/settings-default.json b/Assets/settings-default.json index 9b63d3ae..e44e9bf9 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -173,7 +173,6 @@ "fontFixed": "DejaVu Sans Mono", "fontDefaultScale": 1, "fontFixedScale": 1, - "monitorsScaling": [], "idleInhibitorEnabled": false, "tooltipsEnabled": true }, diff --git a/Modules/Background/ScreenCorners.qml b/Modules/Background/ScreenCorners.qml index 781ac531..7ddda724 100644 --- a/Modules/Background/ScreenCorners.qml +++ b/Modules/Background/ScreenCorners.qml @@ -38,10 +38,10 @@ Loader { margins { // When bar is floating, corners should be at screen edges (no margins) // When bar is not floating, respect bar margins as before - top: !Settings.data.bar.floating && BarService.isVisible && ((modelData && Settings.data.bar.monitors.includes(modelData.name)) || (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "top" && Settings.data.bar.backgroundOpacity > 0 ? Math.round(Style.barHeight) : 0 - bottom: !Settings.data.bar.floating && BarService.isVisible && ((modelData && Settings.data.bar.monitors.includes(modelData.name)) || (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "bottom" && Settings.data.bar.backgroundOpacity > 0 ? Math.round(Style.barHeight) : 0 - left: !Settings.data.bar.floating && BarService.isVisible && ((modelData && Settings.data.bar.monitors.includes(modelData.name)) || (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "left" && Settings.data.bar.backgroundOpacity > 0 ? Math.round(Style.barHeight) : 0 - right: !Settings.data.bar.floating && BarService.isVisible && ((modelData && Settings.data.bar.monitors.includes(modelData.name)) || (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "right" && Settings.data.bar.backgroundOpacity > 0 ? Math.round(Style.barHeight) : 0 + top: !Settings.data.bar.floating && BarService.isVisible && ((modelData && Settings.data.bar.monitors.includes(modelData.name)) || (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "top" && Settings.data.bar.backgroundOpacity > 0 ? Style.barHeight : 0 + bottom: !Settings.data.bar.floating && BarService.isVisible && ((modelData && Settings.data.bar.monitors.includes(modelData.name)) || (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "bottom" && Settings.data.bar.backgroundOpacity > 0 ? Style.barHeight : 0 + left: !Settings.data.bar.floating && BarService.isVisible && ((modelData && Settings.data.bar.monitors.includes(modelData.name)) || (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "left" && Settings.data.bar.backgroundOpacity > 0 ? Style.barHeight : 0 + right: !Settings.data.bar.floating && BarService.isVisible && ((modelData && Settings.data.bar.monitors.includes(modelData.name)) || (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "right" && Settings.data.bar.backgroundOpacity > 0 ? Style.barHeight : 0 } mask: Region {} diff --git a/Modules/Bar/Bar.qml b/Modules/Bar/Bar.qml index 666d55cf..fa61bd95 100644 --- a/Modules/Bar/Bar.qml +++ b/Modules/Bar/Bar.qml @@ -25,8 +25,8 @@ Variants { WlrLayershell.namespace: "noctalia-bar" - implicitHeight: (Settings.data.bar.position === "left" || Settings.data.bar.position === "right") ? screen.height : Math.round(Style.barHeight) - implicitWidth: (Settings.data.bar.position === "left" || Settings.data.bar.position === "right") ? Math.round(Style.barHeight) : screen.width + implicitHeight: (Settings.data.bar.position === "left" || Settings.data.bar.position === "right") ? screen.height : Style.barHeight + implicitWidth: (Settings.data.bar.position === "left" || Settings.data.bar.position === "right") ? Style.barHeight : screen.width color: Color.transparent anchors { diff --git a/Modules/Bar/Extras/BarPillHorizontal.qml b/Modules/Bar/Extras/BarPillHorizontal.qml index 82fc6dc7..c24f58e9 100644 --- a/Modules/Bar/Extras/BarPillHorizontal.qml +++ b/Modules/Bar/Extras/BarPillHorizontal.qml @@ -38,7 +38,7 @@ Item { property bool showPill: false property bool shouldAnimateHide: false - readonly property int pillHeight: Math.round(Style.capsuleHeight) + readonly property int pillHeight: Style.capsuleHeight readonly property int pillPaddingHorizontal: Math.round(Style.capsuleHeight * 0.2) readonly property int pillOverlap: Math.round(Style.capsuleHeight * 0.5) readonly property int pillMaxWidth: Math.max(1, textItem.implicitWidth + pillPaddingHorizontal * 2 + pillOverlap) diff --git a/Modules/Bar/Extras/BarPillVertical.qml b/Modules/Bar/Extras/BarPillVertical.qml index 20ed1db4..3feed7e6 100644 --- a/Modules/Bar/Extras/BarPillVertical.qml +++ b/Modules/Bar/Extras/BarPillVertical.qml @@ -45,7 +45,7 @@ Item { property bool shouldAnimateHide: false // Sizing logic for vertical bars - readonly property int buttonSize: Math.round(Style.capsuleHeight) + readonly property int buttonSize: Style.capsuleHeight readonly property int pillHeight: buttonSize readonly property int pillPaddingVertical: 3 * 2 // Very precise adjustment don't replace by Style.margin readonly property int pillOverlap: buttonSize * 0.5 diff --git a/Modules/Bar/Extras/TrayMenu.qml b/Modules/Bar/Extras/TrayMenu.qml index 5d99ef9e..968d91bc 100644 --- a/Modules/Bar/Extras/TrayMenu.qml +++ b/Modules/Bar/Extras/TrayMenu.qml @@ -18,7 +18,7 @@ PopupWindow { readonly property int menuWidth: 180 - implicitWidth: Math.round(menuWidth) + implicitWidth: menuWidth // Use the content height of the Flickable for implicit height implicitHeight: Math.min(screen ? screen.height * 0.9 : Screen.height * 0.9, flickable.contentHeight + (Style.marginS * 2)) diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index 6ad19bfa..63248e92 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -43,7 +43,7 @@ Item { readonly property string scrollingMode: (widgetSettings.scrollingMode !== undefined) ? widgetSettings.scrollingMode : (widgetMetadata.scrollingMode !== undefined ? widgetMetadata.scrollingMode : "hover") readonly property int widgetWidth: (widgetSettings.width !== undefined) ? widgetSettings.width : Math.max(widgetMetadata.width, screen.width * 0.06) - implicitHeight: visible ? ((barPosition === "left" || barPosition === "right") ? calculatedVerticalHeight() : Math.round(Style.barHeight)) : 0 + implicitHeight: visible ? ((barPosition === "left" || barPosition === "right") ? calculatedVerticalHeight() : Style.barHeight) : 0 implicitWidth: visible ? ((barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8) : (widgetWidth)) : 0 opacity: !autoHide || hasActiveWindow ? 1.0 : 0 @@ -116,8 +116,8 @@ Item { anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter width: (barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8) : (widgetWidth) - height: (barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8) : Math.round(Style.capsuleHeight) - radius: (barPosition === "left" || barPosition === "right") ? width / 2 : Math.round(Style.radiusM) + height: (barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8) : Style.capsuleHeight + radius: (barPosition === "left" || barPosition === "right") ? width / 2 : Style.radiusM color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent Item { @@ -136,8 +136,8 @@ Item { // Window icon Item { - Layout.preferredWidth: Math.round(18) - Layout.preferredHeight: Math.round(18) + Layout.preferredWidth: 18 + Layout.preferredHeight: 18 Layout.alignment: Qt.AlignVCenter visible: showIcon diff --git a/Modules/Bar/Widgets/Clock.qml b/Modules/Bar/Widgets/Clock.qml index 657742a4..e775b882 100644 --- a/Modules/Bar/Widgets/Clock.qml +++ b/Modules/Bar/Widgets/Clock.qml @@ -40,11 +40,11 @@ Rectangle { readonly property string formatHorizontal: widgetSettings.formatHorizontal !== undefined ? widgetSettings.formatHorizontal : widgetMetadata.formatHorizontal readonly property string formatVertical: widgetSettings.formatVertical !== undefined ? widgetSettings.formatVertical : widgetMetadata.formatVertical - implicitWidth: isBarVertical ? Math.round(Style.capsuleHeight) : Math.round((isBarVertical ? verticalLoader.implicitWidth : horizontalLoader.implicitWidth) + Style.marginM * 2) + implicitWidth: isBarVertical ? Style.capsuleHeight : Math.round((isBarVertical ? verticalLoader.implicitWidth : horizontalLoader.implicitWidth) + Style.marginM * 2) - implicitHeight: isBarVertical ? Math.round(verticalLoader.implicitHeight + Style.marginS * 2) : Math.round(Style.capsuleHeight) + implicitHeight: isBarVertical ? Math.round(verticalLoader.implicitHeight + Style.marginS * 2) : Style.capsuleHeight - radius: Math.round(Style.radiusS) + radius: Style.radiusS color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent Item { diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 70d1d95c..4973e8b8 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -59,7 +59,7 @@ Item { return title } - implicitHeight: visible ? ((barPosition === "left" || barPosition === "right") ? calculatedVerticalHeight() : Math.round(Style.barHeight)) : 0 + implicitHeight: visible ? ((barPosition === "left" || barPosition === "right") ? calculatedVerticalHeight() : Style.barHeight) : 0 implicitWidth: visible ? ((barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8) : (widgetWidth)) : 0 opacity: !autoHide || hasActivePlayer || (!hasActivePlayer && !autoHide) ? 1.0 : 0 @@ -92,8 +92,8 @@ Item { anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter width: (barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8) : (widgetWidth) - height: (barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8) : Math.round(Style.capsuleHeight) - radius: (barPosition === "left" || barPosition === "right") ? width / 2 : Math.round(Style.radiusM) + height: (barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8) : Style.capsuleHeight + radius: (barPosition === "left" || barPosition === "right") ? width / 2 : Style.radiusM color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent Item { @@ -172,8 +172,8 @@ Item { spacing: 0 Item { - Layout.preferredWidth: Math.round(21) - Layout.preferredHeight: Math.round(21) + Layout.preferredWidth: 21 + Layout.preferredHeight: 21 NImageCircled { id: trackArt diff --git a/Modules/Bar/Widgets/SystemMonitor.qml b/Modules/Bar/Widgets/SystemMonitor.qml index d683a06b..699512dc 100644 --- a/Modules/Bar/Widgets/SystemMonitor.qml +++ b/Modules/Bar/Widgets/SystemMonitor.qml @@ -73,9 +73,9 @@ Rectangle { } anchors.centerIn: parent - implicitWidth: isVertical ? Math.round(Style.capsuleHeight) : Math.round(mainGrid.implicitWidth + Style.marginM * 2) - implicitHeight: isVertical ? Math.round(mainGrid.implicitHeight + Style.marginM * 2) : Math.round(Style.capsuleHeight) - radius: Math.round(Style.radiusM) + implicitWidth: isVertical ? Style.capsuleHeight : Math.round(mainGrid.implicitWidth + Style.marginM * 2) + implicitHeight: isVertical ? Math.round(mainGrid.implicitHeight + Style.marginM * 2) : Style.capsuleHeight + radius: Style.radiusM color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent GridLayout { @@ -90,7 +90,7 @@ Rectangle { // CPU Usage Component Item { Layout.preferredWidth: isVertical ? root.width : iconSize + percentTextWidth + (Style.marginXXS) - Layout.preferredHeight: Math.round(Style.capsuleHeight) + Layout.preferredHeight: Style.capsuleHeight Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter visible: showCpuUsage @@ -131,7 +131,7 @@ Rectangle { // CPU Temperature Component Item { Layout.preferredWidth: isVertical ? root.width : (iconSize + tempTextWidth) + (Style.marginXXS) - Layout.preferredHeight: Math.round(Style.capsuleHeight) + Layout.preferredHeight: Style.capsuleHeight Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter visible: showCpuTemp @@ -172,7 +172,7 @@ Rectangle { // Memory Usage Component Item { Layout.preferredWidth: isVertical ? root.width : iconSize + (showMemoryAsPercent ? percentTextWidth : memTextWidth) + (Style.marginXXS) - Layout.preferredHeight: Math.round(Style.capsuleHeight) + Layout.preferredHeight: Style.capsuleHeight Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter visible: showMemoryUsage @@ -213,7 +213,7 @@ Rectangle { // Network Download Speed Component Item { Layout.preferredWidth: isVertical ? root.width : iconSize + memTextWidth + (Style.marginXXS) - Layout.preferredHeight: Math.round(Style.capsuleHeight) + Layout.preferredHeight: Style.capsuleHeight Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter visible: showNetworkStats @@ -254,7 +254,7 @@ Rectangle { // Network Upload Speed Component Item { Layout.preferredWidth: isVertical ? root.width : iconSize + memTextWidth + (Style.marginXXS) - Layout.preferredHeight: Math.round(Style.capsuleHeight) + Layout.preferredHeight: Style.capsuleHeight Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter visible: showNetworkStats @@ -295,7 +295,7 @@ Rectangle { // Disk Usage Component (primary drive) Item { Layout.preferredWidth: isVertical ? root.width : iconSize + percentTextWidth + (Style.marginXXS) - Layout.preferredHeight: Math.round(Style.capsuleHeight) + Layout.preferredHeight: Style.capsuleHeight Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter visible: showDiskUsage diff --git a/Modules/Bar/Widgets/Taskbar.qml b/Modules/Bar/Widgets/Taskbar.qml index 8fa7558e..5cac6514 100644 --- a/Modules/Bar/Widgets/Taskbar.qml +++ b/Modules/Bar/Widgets/Taskbar.qml @@ -35,9 +35,9 @@ Rectangle { } // Always visible when there are toplevels - implicitWidth: isVerticalBar ? Math.round(Style.capsuleHeight) : Math.round(taskbarLayout.implicitWidth + Style.marginM * 2) - implicitHeight: isVerticalBar ? Math.round(taskbarLayout.implicitHeight + Style.marginM * 2) : Math.round(Style.capsuleHeight) - radius: Math.round(Style.radiusM) + implicitWidth: isVerticalBar ? Style.capsuleHeight : Math.round(taskbarLayout.implicitWidth + Style.marginM * 2) + implicitHeight: isVerticalBar ? Math.round(taskbarLayout.implicitHeight + Style.marginM * 2) : Style.capsuleHeight + radius: Style.radiusM color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent GridLayout { diff --git a/Modules/Bar/Widgets/Tray.qml b/Modules/Bar/Widgets/Tray.qml index dce3e7bc..984228a4 100644 --- a/Modules/Bar/Widgets/Tray.qml +++ b/Modules/Bar/Widgets/Tray.qml @@ -144,9 +144,9 @@ Rectangle { } visible: filteredItems.length > 0 - implicitWidth: isVertical ? Math.round(Style.capsuleHeight) : Math.round(trayFlow.implicitWidth + Style.marginM * 2) - implicitHeight: isVertical ? Math.round(trayFlow.implicitHeight + Style.marginM * 2) : Math.round(Style.capsuleHeight) - radius: Math.round(Style.radiusM) + implicitWidth: isVertical ? Style.capsuleHeight : Math.round(trayFlow.implicitWidth + Style.marginM * 2) + implicitHeight: isVertical ? Math.round(trayFlow.implicitHeight + Style.marginM * 2) : Style.capsuleHeight + radius: Style.radiusM color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent Layout.alignment: Qt.AlignVCenter @@ -239,7 +239,7 @@ Rectangle { } else { // For horizontal bars: center horizontally and position below menuX = (width / 2) - (trayMenu.item.width / 2) - menuY = Math.round(Style.barHeight) + menuY = Style.barHeight } trayMenu.item.menu = modelData.menu trayMenu.item.showAt(parent, menuX, menuY) diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index 8bdc8bbf..c0149cf4 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -62,8 +62,8 @@ Item { signal workspaceChanged(int workspaceId, color accentColor) - implicitWidth: isVertical ? Math.round(Style.barHeight) : computeWidth() - implicitHeight: isVertical ? computeHeight() : Math.round(Style.barHeight) + implicitWidth: isVertical ? Style.barHeight : computeWidth() + implicitHeight: isVertical ? computeHeight() : Style.barHeight function getWorkspaceWidth(ws) { const d = Style.capsuleHeight * root.baseDimensionRatio @@ -202,9 +202,9 @@ Item { Rectangle { id: workspaceBackground - width: isVertical ? Math.round(Style.capsuleHeight) : parent.width - height: isVertical ? parent.height : Math.round(Style.capsuleHeight) - radius: Math.round(Style.radiusM) + width: isVertical ? Style.capsuleHeight : parent.width + height: isVertical ? parent.height : Style.capsuleHeight + radius: Style.radiusM color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent anchors.horizontalCenter: parent.horizontalCenter diff --git a/Services/ScalingService.qml b/Services/ScalingService.qml deleted file mode 100644 index d85b9a3e..00000000 --- a/Services/ScalingService.qml +++ /dev/null @@ -1,131 +0,0 @@ -pragma Singleton - -import QtQuick -import Quickshell -import qs.Commons - -Singleton { - id: root - - // Cache for current scales - updated via signals - property var currentScales: ({}) - - // Signal emitted when scale changes - signal scaleChanged(string screenName, real scale) - - Component.onCompleted: { - Logger.log("Scaling", "Service started") - // Initialize cache from Settings once they are loaded on startup - var monitors = Settings.data.ui.monitorsScaling || [] - for (var i = 0; i < monitors.length; i++) { - if (monitors[i].name && monitors[i].scale !== undefined) { - currentScales[monitors[i].name] = monitors[i].scale - root.scaleChanged(monitors[i].name, monitors[i].scale) - Logger.log("Scaling", "Caching scaling for", monitors[i].name, ":", monitors[i].scale) - } - } - } - - // ------------------------------------------- - // Manual scaling via Settings - function getScreenScale(aScreen) { - try { - if (aScreen !== undefined && aScreen.name !== undefined) { - return getScreenScaleByName(aScreen.name) - } - } catch (e) { - - //Logger.warn(e) - } - return 1.0 - } - - // ------------------------------------------- - // Get scale from cache for better performance - function getScreenScaleByName(aScreenName) { - try { - var scale = currentScales[aScreenName] - if ((scale !== undefined) && (scale != null)) { - return scale - } - } catch (e) { - - //Logger.warn(e) - } - return 1.0 - } - - // ------------------------------------------- - function setScreenScale(aScreen, scale) { - try { - if (aScreen !== undefined && aScreen.name !== undefined) { - return setScreenScaleByName(aScreen.name, scale) - } - } catch (e) { - - //Logger.warn(e) - } - } - - // ------------------------------------------- - function setScreenScaleByName(aScreenName, scale) { - try { - // Check if scale actually changed - var oldScale = currentScales[aScreenName] || 1.0 - if (oldScale === scale) { - return - // No change needed - } - - // Update cache directly - currentScales[aScreenName] = scale - - // Update Settings with immutable update for proper persistence - var monitors = Settings.data.ui.monitorsScaling || [] - var found = false - - var newMonitors = monitors.map(function (monitor) { - if (monitor.name === aScreenName) { - found = true - return { - "name": aScreenName, - "scale": scale - } - } - return monitor - }) - - if (!found) { - newMonitors.push({ - "name": aScreenName, - "scale": scale - }) - } - - // Use slice() to ensure Settings detects the change - Settings.data.ui.monitorsScaling = newMonitors.slice() - - // Emit signal for components to react - root.scaleChanged(aScreenName, scale) - - Logger.log("Scaling", "Scale changed for", aScreenName, "to", scale) - } catch (e) { - Logger.warn("Scaling", "Error setting scale:", e) - } - } - - // ------------------------------------------- - // Dynamic scaling based on resolution - // Design reference resolution (for scale = 1.0) - readonly property int designScreenWidth: 2560 - readonly property int designScreenHeight: 1440 - function dynamicScale(aScreen) { - return 1.0 - // if (aScreen != null) { - // var ratioW = aScreen.width / designScreenWidth - // var ratioH = aScreen.height / designScreenHeight - // return Math.min(ratioW, ratioH) - // } - // return 1.0 - } -} diff --git a/Widgets/NPanel.qml b/Widgets/NPanel.qml index cacc5c2d..5651d8af 100644 --- a/Widgets/NPanel.qml +++ b/Widgets/NPanel.qml @@ -26,8 +26,6 @@ Loader { property bool panelAnchorLeft: false property bool panelAnchorRight: false - property bool isMasked: false - // Properties to support positioning relative to the opener (button) property bool useButtonPosition: false property point buttonPosition: Qt.point(0, 0) @@ -38,10 +36,8 @@ Loader { property bool backgroundClickEnabled: true // Animation properties - readonly property real originalScale: 0.5 - readonly property real originalOpacity: 0.0 + readonly property real originalScale: 0.0 property real scaleValue: originalScale - property real opacityValue: originalOpacity property real dimmingOpacity: 0 signal opened @@ -99,7 +95,6 @@ Loader { function close() { dimmingOpacity = 0 scaleValue = originalScale - opacityValue = originalOpacity root.closed() active = false useButtonPosition = false @@ -137,7 +132,7 @@ Loader { readonly property string barPosition: Settings.data.bar.position readonly property bool isVertical: barPosition === "left" || barPosition === "right" readonly property bool barIsVisible: (screen !== null) && (Settings.data.bar.monitors.includes(screen.name) || (Settings.data.bar.monitors.length === 0)) - readonly property real verticalBarWidth: Math.round(Style.barHeight) + readonly property real verticalBarWidth: Style.barHeight Component.onCompleted: { Logger.log("NPanel", "Opened", root.objectName, "on", screen.name) @@ -158,14 +153,12 @@ Loader { } visible: true - color: Settings.data.general.dimDesktop && !root.isMasked ? Qt.alpha(Color.mShadow, dimmingOpacity) : Color.transparent + color: Settings.data.general.dimDesktop ? Qt.alpha(Color.mShadow, dimmingOpacity) : Color.transparent WlrLayershell.exclusionMode: ExclusionMode.Ignore WlrLayershell.namespace: "noctalia-panel" WlrLayershell.keyboardFocus: root.panelKeyboardFocus ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None - mask: root.isMasked ? maskRegion : null - Region { id: maskRegion } @@ -231,7 +224,6 @@ Loader { } scale: root.scaleValue - opacity: root.isMasked ? 0 : root.opacityValue x: isDragged ? manualX : calculatedX y: isDragged ? manualY : calculatedY @@ -371,7 +363,6 @@ Loader { // Animate in when component is completed Component.onCompleted: { root.scaleValue = 1.0 - root.opacityValue = 1.0 } // Reset drag position when panel closes