diff --git a/Modules/Background/ScreenCorners.qml b/Modules/Background/ScreenCorners.qml index 7dc5076..59e88de 100644 --- a/Modules/Background/ScreenCorners.qml +++ b/Modules/Background/ScreenCorners.qml @@ -15,6 +15,8 @@ NLoader { id: root required property ShellScreen modelData + readonly property real scaling: Scaling.scale(screen) + screen: modelData // Visible ring color property color ringColor: Colors.mSurface @@ -25,7 +27,7 @@ NLoader { property int innerRadius: 20 color: "transparent" - screen: modelData + WlrLayershell.exclusionMode: ExclusionMode.Ignore WlrLayershell.namespace: "quickshell-corner" // Do not take keyboard focus and make the surface click-through @@ -39,7 +41,7 @@ NLoader { } margins { - top: Math.round(Style.barHeight * Scaling.scale(screen)) + top: Math.floor(Style.barHeight * scaling) } // Source we want to show only as a ring diff --git a/Modules/Bar/Bar.qml b/Modules/Bar/Bar.qml index 22d41fd..cc1b5be 100644 --- a/Modules/Bar/Bar.qml +++ b/Modules/Bar/Bar.qml @@ -14,12 +14,12 @@ Variants { required property ShellScreen modelData readonly property real scaling: Scaling.scale(screen) - screen: modelData + implicitHeight: Style.barHeight * scaling color: "transparent" - // If no bar display activated in settings, then show them all + // If no bar activated in settings, then show them all visible: modelData ? (Settings.data.bar.monitors.includes(modelData.name) || (Settings.data.bar.monitors.length === 0)) : false diff --git a/Modules/Bar/NotificationHistory.qml b/Modules/Bar/NotificationHistory.qml index d4c3b47..f6ae033 100644 --- a/Modules/Bar/NotificationHistory.qml +++ b/Modules/Bar/NotificationHistory.qml @@ -9,7 +9,6 @@ import qs.Widgets NIconButton { id: root - readonly property real scaling: Scaling.scale(screen) sizeMultiplier: 0.8 showBorder: false icon: "notifications" diff --git a/Modules/Bar/Tray.qml b/Modules/Bar/Tray.qml index e35a7ac..615749f 100644 --- a/Modules/Bar/Tray.qml +++ b/Modules/Bar/Tray.qml @@ -9,7 +9,6 @@ import qs.Services import qs.Widgets Item { - readonly property real scaling: Scaling.scale(screen) readonly property real itemSize: 24 * scaling width: tray.width diff --git a/Modules/Bar/TrayMenu.qml b/Modules/Bar/TrayMenu.qml index da52e96..dd94d8d 100644 --- a/Modules/Bar/TrayMenu.qml +++ b/Modules/Bar/TrayMenu.qml @@ -8,7 +8,6 @@ import qs.Widgets PopupWindow { id: trayMenu - readonly property real scaling: Scaling.scale(screen) property QsMenuHandle menu property var anchorItem: null property real anchorX diff --git a/Modules/Bar/WiFi.qml b/Modules/Bar/WiFi.qml index 5bd5c89..ef28f39 100644 --- a/Modules/Bar/WiFi.qml +++ b/Modules/Bar/WiFi.qml @@ -9,7 +9,6 @@ import qs.Widgets NIconButton { id: root - readonly property real scaling: Scaling.scale(screen) readonly property bool wifiEnabled: Settings.data.network.wifiEnabled sizeMultiplier: 0.8 showBorder: false diff --git a/Modules/Bar/Workspace.qml b/Modules/Bar/Workspace.qml index 79ef0b9..669192b 100644 --- a/Modules/Bar/Workspace.qml +++ b/Modules/Bar/Workspace.qml @@ -12,16 +12,13 @@ Item { property bool isDestroying: false property bool hovered: false - // Unified scale - readonly property real s: Scaling.scale(screen) - property ListModel localWorkspaces: ListModel {} property real masterProgress: 0.0 property bool effectsActive: false property color effectColor: Colors.mPrimary - property int horizontalPadding: Math.round(16 * s) - property int spacingBetweenPills: Math.round(8 * s) + property int horizontalPadding: Math.round(16 * scaling) + property int spacingBetweenPills: Math.round(8 * scaling) signal workspaceChanged(int workspaceId, color accentColor) @@ -30,18 +27,18 @@ Item { for (var i = 0; i < localWorkspaces.count; i++) { const ws = localWorkspaces.get(i) if (ws.isFocused) - total += Math.round(44 * s) + total += Math.round(44 * scaling) else if (ws.isActive) - total += Math.round(28 * s) + total += Math.round(28 * scaling) else - total += Math.round(16 * s) + total += Math.round(16 * scaling) } total += Math.max(localWorkspaces.count - 1, 0) * spacingBetweenPills total += horizontalPadding * 2 return total } - height: Math.round(36 * s) + height: Math.round(36 * scaling) Component.onCompleted: { localWorkspaces.clear() @@ -116,14 +113,14 @@ Item { Rectangle { id: workspaceBackground - width: parent.width - Math.round(15 * s) - height: Math.round(26 * s) + width: parent.width - Math.round(15 * scaling) + height: Math.round(26 * scaling) anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - radius: Math.round(12 * s) + radius: Math.round(12 * scaling) color: Colors.mSurfaceVariant border.color: Colors.mOutlineVariant - border.width: Math.max(1, Math.round(1 * s)) + border.width: Math.max(1, Math.round(1 * scaling)) layer.enabled: true layer.effect: MultiEffect { shadowColor: Colors.mShadow @@ -144,14 +141,14 @@ Item { model: localWorkspaces Item { id: workspacePillContainer - height: Math.round(12 * s) + height: Math.round(12 * scaling) width: { if (model.isFocused) - return Math.round(44 * s) + return Math.round(44 * scaling) else if (model.isActive) - return Math.round(28 * s) + return Math.round(28 * scaling) else - return Math.round(16 * s) + return Math.round(16 * scaling) } Rectangle { @@ -159,10 +156,10 @@ Item { anchors.fill: parent radius: { if (model.isFocused) - return Math.round(12 * s) + return Math.round(12 * scaling) else // half of focused height (if you want to animate this too) - return Math.round(6 * s) + return Math.round(6 * scaling) } color: { if (model.isFocused) @@ -248,7 +245,7 @@ Item { radius: width / 2 color: "transparent" border.color: root.effectColor - border.width: Math.max(1, Math.round((2 + 6 * (1.0 - root.masterProgress)) * s)) + border.width: Math.max(1, Math.round((2 + 6 * (1.0 - root.masterProgress)) * scaling)) opacity: root.effectsActive && model.isFocused ? (1.0 - root.masterProgress) * 0.7 : 0 visible: root.effectsActive && model.isFocused z: 1 diff --git a/Modules/Calendar/Calendar.qml b/Modules/Calendar/Calendar.qml index d1dd99a..d433718 100644 --- a/Modules/Calendar/Calendar.qml +++ b/Modules/Calendar/Calendar.qml @@ -13,8 +13,6 @@ NLoader { NPanel { id: calendarPanel - readonly property real scaling: Scaling.scale(screen) - // Override hide function to animate first function hide() { // Start hide animation diff --git a/Modules/Demo/DemoPanel.qml b/Modules/Demo/DemoPanel.qml index fa238f1..cd02fd7 100644 --- a/Modules/Demo/DemoPanel.qml +++ b/Modules/Demo/DemoPanel.qml @@ -13,8 +13,6 @@ NLoader { NPanel { id: demoPanel - readonly property real scaling: Scaling.scale(screen) - // Override hide function to animate first function hide() { // Start hide animation @@ -73,7 +71,7 @@ NLoader { border.color: Colors.mOutlineVariant border.width: Math.max(1, Style.borderThin * scaling) width: 500 * scaling - height: 700 * scaling + height: 900 * scaling anchors.centerIn: parent // Animation properties @@ -312,7 +310,7 @@ NLoader { } NText { - text: `Brightness: ${Math.round(Brightness.brightness)}%` + text: `Brightness: ${Math.round(BrightnessService.brightness)}%` Layout.alignment: Qt.AlignVCenter } @@ -322,30 +320,30 @@ NLoader { icon: "brightness_low" fontPointSize: Style.fontSizeLarge * scaling onClicked: { - Brightness.decreaseBrightness() + BrightnessService.decreaseBrightness() } } NSlider { from: 0 to: 100 stepSize: 1 - value: Brightness.brightness + value: BrightnessService.brightness implicitWidth: bgRect.width * 0.5 onMoved: { - Brightness.setBrightnessDebounced(value) + BrightnessService.setBrightnessDebounced(value) } } NIconButton { icon: "brightness_high" fontPointSize: Style.fontSizeLarge * scaling onClicked: { - Brightness.increaseBrightness() + BrightnessService.increaseBrightness() } } } NText { - text: `Method: ${Brightness.currentMethod} | Available: ${Brightness.available}` + text: `Method: ${BrightnessService.currentMethod} | Available: ${BrightnessService.available}` color: Colors.mOnSurfaceVariant font.pointSize: Style.fontSizeSmall * scaling Layout.alignment: Qt.AlignHCenter diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index 701ac7d..a22e490 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -14,9 +14,12 @@ NLoader { Variants { model: Quickshell.screens - Item { - property var modelData - readonly property real scaling: Scaling.scale(modelData) + PanelWindow { + id: dockWindow + + required property ShellScreen modelData + readonly property real scaling: Scaling.scale(screen) + screen: modelData // Auto-hide properties property bool autoHide: Settings.data.dock.autoHide @@ -37,320 +40,314 @@ NLoader { property var contextMenuTarget: null property var contextMenuToplevel: null - PanelWindow { - id: dockWindow + // Dock is only shown if explicitely toggled + visible: modelData ? Settings.data.dock.monitors.includes(modelData.name) : false - // Dock is only shown if explicitely toggled - visible: modelData ? Settings.data.dock.monitors.includes(modelData.name) : false + exclusionMode: ExclusionMode.Ignore + anchors.bottom: true + anchors.left: true + anchors.right: true + focusable: false + color: "transparent" + implicitHeight: 60 - screen: modelData - exclusionMode: ExclusionMode.Ignore - anchors.bottom: true - anchors.left: true - anchors.right: true - focusable: false - color: "transparent" - implicitHeight: 60 + // Timer for auto-hide delay + Timer { + id: hideTimer + interval: hideDelay + onTriggered: if (autoHide && !dockHovered && !anyAppHovered) + hidden = true + } - // Timer for auto-hide delay - Timer { - id: hideTimer - interval: hideDelay - onTriggered: if (autoHide && !dockHovered && !anyAppHovered) - hidden = true + // Timer for show delay + Timer { + id: showTimer + interval: showDelay + onTriggered: hidden = false + } + + // Behavior for smooth hide/show animations + Behavior on margins.bottom { + NumberAnimation { + duration: hidden ? hideAnimationDuration : showAnimationDuration + easing.type: Easing.InOutQuad } + } - // Timer for show delay - Timer { - id: showTimer - interval: showDelay - onTriggered: hidden = false + // Mouse area at screen bottom to detect entry and keep dock visible + MouseArea { + id: screenEdgeMouseArea + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + height: 10 + hoverEnabled: true + propagateComposedEvents: true + + onEntered: if (autoHide && hidden) + showTimer.start() + onExited: if (autoHide && !hidden && !dockHovered && !anyAppHovered) + hideTimer.start() + } + + margins.bottom: hidden ? -(fullHeight - peekHeight) : 0 + + MouseArea { + anchors.fill: parent + enabled: contextMenuVisible + onClicked: { + contextMenuVisible = false + contextMenuTarget = null + contextMenuToplevel = null } + } - // Behavior for smooth hide/show animations - Behavior on margins.bottom { - NumberAnimation { - duration: hidden ? hideAnimationDuration : showAnimationDuration - easing.type: Easing.InOutQuad - } - } + Rectangle { + id: dockContainer + width: dock.width + 40 + height: 50 + color: Colors.mSurface + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + topLeftRadius: 20 + topRightRadius: 20 - // Mouse area at screen bottom to detect entry and keep dock visible MouseArea { - id: screenEdgeMouseArea - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - height: 10 + id: dockMouseArea + anchors.fill: parent hoverEnabled: true propagateComposedEvents: true - onEntered: if (autoHide && hidden) - showTimer.start() - onExited: if (autoHide && !hidden && !dockHovered && !anyAppHovered) - hideTimer.start() - } - - margins.bottom: hidden ? -(fullHeight - peekHeight) : 0 - - MouseArea { - anchors.fill: parent - enabled: contextMenuVisible - onClicked: { - contextMenuVisible = false - contextMenuTarget = null - contextMenuToplevel = null + onEntered: { + dockHovered = true + if (autoHide) { + showTimer.stop() + hideTimer.stop() + hidden = false + } + } + onExited: { + dockHovered = false + if (autoHide && !anyAppHovered && !contextMenuVisible) + hideTimer.start() } } - Rectangle { - id: dockContainer - width: dock.width + 40 - height: 50 - color: Colors.mSurface - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - topLeftRadius: 20 - topRightRadius: 20 + Item { + id: dock + width: runningAppsRow.width + height: parent.height - 10 + anchors.centerIn: parent - MouseArea { - id: dockMouseArea - anchors.fill: parent - hoverEnabled: true - propagateComposedEvents: true - - onEntered: { - dockHovered = true - if (autoHide) { - showTimer.stop() - hideTimer.stop() - hidden = false - } - } - onExited: { - dockHovered = false - if (autoHide && !anyAppHovered && !contextMenuVisible) - hideTimer.start() - } + NTooltip { + id: appTooltip + visible: false + positionAbove: true } - Item { - id: dock - width: runningAppsRow.width - height: parent.height - 10 + function getAppIcon(toplevel: Toplevel): string { + if (!toplevel) + return "" + let icon = Quickshell.iconPath(toplevel.appId?.toLowerCase(), true) + if (!icon) + icon = Quickshell.iconPath(toplevel.appId, true) + if (!icon) + icon = Quickshell.iconPath(toplevel.title?.toLowerCase(), true) + if (!icon) + icon = Quickshell.iconPath(toplevel.title, true) + return icon || Quickshell.iconPath("application-x-executable", true) + } + + Row { + id: runningAppsRow + spacing: 8 + height: parent.height anchors.centerIn: parent - NTooltip { - id: appTooltip - visible: false - positionAbove: true - } + Repeater { + model: ToplevelManager ? ToplevelManager.toplevels : null - function getAppIcon(toplevel: Toplevel): string { - if (!toplevel) - return "" - let icon = Quickshell.iconPath(toplevel.appId?.toLowerCase(), true) - if (!icon) - icon = Quickshell.iconPath(toplevel.appId, true) - if (!icon) - icon = Quickshell.iconPath(toplevel.title?.toLowerCase(), true) - if (!icon) - icon = Quickshell.iconPath(toplevel.title, true) - return icon || Quickshell.iconPath("application-x-executable", true) - } + delegate: Rectangle { + id: appButton + width: 36 + height: 36 + radius: 18 + color: "transparent" - Row { - id: runningAppsRow - spacing: 8 - height: parent.height - anchors.centerIn: parent + property bool isActive: ToplevelManager.activeToplevel && ToplevelManager.activeToplevel === modelData + property bool hovered: appMouseArea.containsMouse + property string appId: modelData ? modelData.appId : "" + property string appTitle: modelData ? modelData.title : "" - Repeater { - model: ToplevelManager ? ToplevelManager.toplevels : null + Behavior on color { + ColorAnimation { + duration: 150 + } + } - delegate: Rectangle { - id: appButton - width: 36 - height: 36 - radius: 18 - color: "transparent" + Image { + id: appIcon + width: 28 + height: 28 + anchors.centerIn: parent + source: dock.getAppIcon(modelData) + visible: source.toString() !== "" + smooth: false + mipmap: false + antialiasing: false + fillMode: Image.PreserveAspectFit + } - property bool isActive: ToplevelManager.activeToplevel - && ToplevelManager.activeToplevel === modelData - property bool hovered: appMouseArea.containsMouse - property string appId: modelData ? modelData.appId : "" - property string appTitle: modelData ? modelData.title : "" + Text { + anchors.centerIn: parent + visible: !appIcon.visible + text: appButton.appId ? appButton.appId.charAt(0).toUpperCase() : "?" + font.pixelSize: 14 + font.bold: true + color: appButton.isActive ? Colors.mPrimary : Colors.mOnSurface + } - Behavior on color { - ColorAnimation { - duration: 150 + MouseArea { + id: appMouseArea + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton + + onEntered: { + anyAppHovered = true + const appName = appButton.appTitle || appButton.appId || "Unknown" + appTooltip.text = appName.length > 40 ? appName.substring(0, 37) + "..." : appName + appTooltip.target = appButton + appTooltip.isVisible = true + if (autoHide) { + showTimer.stop() + hideTimer.stop() + hidden = false } } - Image { - id: appIcon - width: 28 - height: 28 - anchors.centerIn: parent - source: dock.getAppIcon(modelData) - visible: source.toString() !== "" - smooth: false - mipmap: false - antialiasing: false - fillMode: Image.PreserveAspectFit + onExited: { + anyAppHovered = false + appTooltip.hide() + if (autoHide && !dockHovered && !contextMenuVisible) + hideTimer.start() } - Text { - anchors.centerIn: parent - visible: !appIcon.visible - text: appButton.appId ? appButton.appId.charAt(0).toUpperCase() : "?" - font.pixelSize: 14 - font.bold: true - color: appButton.isActive ? Colors.mPrimary : Colors.mOnSurface - } - - MouseArea { - id: appMouseArea - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton - - onEntered: { - anyAppHovered = true - const appName = appButton.appTitle || appButton.appId || "Unknown" - appTooltip.text = appName.length > 40 ? appName.substring(0, 37) + "..." : appName - appTooltip.target = appButton - appTooltip.isVisible = true - if (autoHide) { - showTimer.stop() - hideTimer.stop() - hidden = false - } + onClicked: function (mouse) { + if (mouse.button === Qt.MiddleButton && modelData?.close) { + modelData.close() } - - onExited: { - anyAppHovered = false + if (mouse.button === Qt.LeftButton && modelData?.activate) { + modelData.activate() + } + if (mouse.button === Qt.RightButton) { appTooltip.hide() - if (autoHide && !dockHovered && !contextMenuVisible) - hideTimer.start() - } - - onClicked: function (mouse) { - if (mouse.button === Qt.MiddleButton && modelData?.close) { - modelData.close() - } - if (mouse.button === Qt.LeftButton && modelData?.activate) { - modelData.activate() - } - if (mouse.button === Qt.RightButton) { - appTooltip.hide() - contextMenuTarget = appButton - contextMenuToplevel = modelData - contextMenuVisible = true - } + contextMenuTarget = appButton + contextMenuToplevel = modelData + contextMenuVisible = true } } + } - Rectangle { - visible: isActive - width: 20 - height: 3 - color: Colors.mPrimary - radius: 1.5 - anchors.bottom: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottomMargin: 2 - } + Rectangle { + visible: isActive + width: 20 + height: 3 + color: Colors.mPrimary + radius: 1.5 + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottomMargin: 2 } } } } } + } - // Context Menu - PanelWindow { - id: contextMenuWindow - visible: contextMenuVisible - screen: dockWindow.screen - exclusionMode: ExclusionMode.Ignore - anchors.bottom: true - anchors.left: true - anchors.right: true - color: "transparent" - focusable: false + // Context Menu + PanelWindow { + id: contextMenuWindow + visible: contextMenuVisible + screen: dockWindow.screen + exclusionMode: ExclusionMode.Ignore + anchors.bottom: true + anchors.left: true + anchors.right: true + color: "transparent" + focusable: false + + MouseArea { + anchors.fill: parent + onClicked: { + contextMenuVisible = false + contextMenuTarget = null + contextMenuToplevel = null + hidden = true // Hide dock when context menu closes + } + } + + Rectangle { + id: contextMenuContainer + width: 80 + height: 32 + radius: 8 + color: closeMouseArea.containsMouse ? Colors.mTertiary : Colors.mSurface + border.color: Colors.mOutline + border.width: 1 + + x: { + if (!contextMenuTarget) + return 0 + const pos = contextMenuTarget.mapToItem(null, 0, 0) + let xPos = pos.x + (contextMenuTarget.width - width) / 2 + return Math.max(0, Math.min(xPos, dockWindow.width - width)) + } + + y: { + if (!contextMenuTarget) + return 0 + const pos = contextMenuTarget.mapToItem(null, 0, 0) + return pos.y - height + 32 + } + + Text { + anchors.centerIn: parent + text: "Close" + font.pixelSize: 14 + color: Colors.mOnSurface + } MouseArea { + id: closeMouseArea anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: { + if (contextMenuToplevel?.close) + contextMenuToplevel.close() contextMenuVisible = false - contextMenuTarget = null - contextMenuToplevel = null - hidden = true // Hide dock when context menu closes + hidden = true } } - Rectangle { - id: contextMenuContainer - width: 80 - height: 32 - radius: 8 - color: closeMouseArea.containsMouse ? Colors.mTertiary : Colors.mSurface - border.color: Colors.mOutline - border.width: 1 + // Animation + scale: contextMenuVisible ? 1 : 0.9 + opacity: contextMenuVisible ? 1 : 0 + transformOrigin: Item.Bottom - x: { - if (!contextMenuTarget) - return 0 - const pos = contextMenuTarget.mapToItem(null, 0, 0) - let xPos = pos.x + (contextMenuTarget.width - width) / 2 - return Math.max(0, Math.min(xPos, dockWindow.width - width)) + Behavior on scale { + NumberAnimation { + duration: 150 + easing.type: Easing.OutBack } + } - y: { - if (!contextMenuTarget) - return 0 - const pos = contextMenuTarget.mapToItem(null, 0, 0) - return pos.y - height + 32 - } - - Text { - anchors.centerIn: parent - text: "Close" - font.pixelSize: 14 - color: Colors.mOnSurface - } - - MouseArea { - id: closeMouseArea - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onClicked: { - if (contextMenuToplevel?.close) - contextMenuToplevel.close() - contextMenuVisible = false - hidden = true - } - } - - // Animation - scale: contextMenuVisible ? 1 : 0.9 - opacity: contextMenuVisible ? 1 : 0 - transformOrigin: Item.Bottom - - Behavior on scale { - NumberAnimation { - duration: 150 - easing.type: Easing.OutBack - } - } - - Behavior on opacity { - NumberAnimation { - duration: 100 - } + Behavior on opacity { + NumberAnimation { + duration: 100 } } } diff --git a/Modules/Notification/Notification.qml b/Modules/Notification/Notification.qml index 5858e4e..9ce4234 100644 --- a/Modules/Notification/Notification.qml +++ b/Modules/Notification/Notification.qml @@ -16,6 +16,7 @@ Variants { required property ShellScreen modelData readonly property real scaling: Scaling.scale(screen) + screen: modelData // Access the notification model from the service property ListModel notificationModel: NotificationService.notificationModel @@ -23,7 +24,6 @@ Variants { // Track notifications being removed for animation property var removingNotifications: ({}) - screen: modelData color: "transparent" // If no notification display activated in settings, then show them all diff --git a/Modules/Settings/SettingsPanel.qml b/Modules/Settings/SettingsPanel.qml index 6db4056..06ea2df 100644 --- a/Modules/Settings/SettingsPanel.qml +++ b/Modules/Settings/SettingsPanel.qml @@ -31,7 +31,6 @@ NLoader { NPanel { id: panel - readonly property real scaling: Scaling.scale(screen) property int currentTabIndex: 0 // Override hide function to animate first diff --git a/Modules/SidePanel/Cards/ProfileCard.qml b/Modules/SidePanel/Cards/ProfileCard.qml index b1b1bbf..d8921d3 100644 --- a/Modules/SidePanel/Cards/ProfileCard.qml +++ b/Modules/SidePanel/Cards/ProfileCard.qml @@ -13,7 +13,6 @@ import qs.Widgets NBox { id: root - readonly property real scaling: Scaling.scale(screen) property string uptimeText: "--" Layout.fillWidth: true diff --git a/Modules/SidePanel/Cards/SystemMonitorCard.qml b/Modules/SidePanel/Cards/SystemMonitorCard.qml index 90d4345..a4633b1 100644 --- a/Modules/SidePanel/Cards/SystemMonitorCard.qml +++ b/Modules/SidePanel/Cards/SystemMonitorCard.qml @@ -7,8 +7,6 @@ import qs.Widgets NBox { id: root - readonly property real scaling: Scaling.scale(screen) - Layout.preferredWidth: 84 * scaling implicitHeight: content.implicitHeight + Style.marginTiny * 2 * scaling diff --git a/Modules/SidePanel/Cards/WeatherCard.qml b/Modules/SidePanel/Cards/WeatherCard.qml index 9a3a84e..5063108 100644 --- a/Modules/SidePanel/Cards/WeatherCard.qml +++ b/Modules/SidePanel/Cards/WeatherCard.qml @@ -8,7 +8,6 @@ import qs.Widgets NBox { id: root - readonly property real scaling: Scaling.scale(screen) readonly property bool weatherReady: (Location.data.weather !== null) // TBC weatherReady is not turning to false when we reset weather... diff --git a/Modules/SidePanel/SidePanel.qml b/Modules/SidePanel/SidePanel.qml index e9d89cb..8f187ac 100644 --- a/Modules/SidePanel/SidePanel.qml +++ b/Modules/SidePanel/SidePanel.qml @@ -32,7 +32,6 @@ NLoader { NPanel { id: sidePanel - readonly property real scaling: Scaling.scale(screen) // Single source of truth for spacing between cards (both axes) property real cardSpacing: Style.marginLarge * scaling // X coordinate from the bar to align this panel under diff --git a/Widgets/NBox.qml b/Widgets/NBox.qml index d418638..a29d07d 100644 --- a/Widgets/NBox.qml +++ b/Widgets/NBox.qml @@ -6,8 +6,6 @@ import qs.Services Rectangle { id: root - readonly property real scaling: Scaling.scale(screen) - implicitWidth: childrenRect.width implicitHeight: childrenRect.height diff --git a/Widgets/NBusyIndicator.qml b/Widgets/NBusyIndicator.qml index 7c2b2da..8098fde 100644 --- a/Widgets/NBusyIndicator.qml +++ b/Widgets/NBusyIndicator.qml @@ -4,8 +4,6 @@ import qs.Services Item { id: root - readonly property real scaling: Scaling.scale(screen) - property bool running: true property color color: Colors.mPrimary property int size: Style.baseWidgetSize * scaling diff --git a/Widgets/NCard.qml b/Widgets/NCard.qml index f468091..c173a8a 100644 --- a/Widgets/NCard.qml +++ b/Widgets/NCard.qml @@ -5,8 +5,6 @@ import qs.Services Rectangle { id: root - readonly property real scaling: Scaling.scale(screen) - implicitWidth: childrenRect.width implicitHeight: childrenRect.height diff --git a/Widgets/NCircleStat.qml b/Widgets/NCircleStat.qml index 46fc207..acf7243 100644 --- a/Widgets/NCircleStat.qml +++ b/Widgets/NCircleStat.qml @@ -5,7 +5,6 @@ import qs.Services Rectangle { id: root - readonly property real scaling: Scaling.scale(screen) property real value: 0 // 0..100 (or any range visually mapped) property string icon: "" property string suffix: "%" diff --git a/Widgets/NClock.qml b/Widgets/NClock.qml index c249c01..25ab5c4 100644 --- a/Widgets/NClock.qml +++ b/Widgets/NClock.qml @@ -5,8 +5,6 @@ import qs.Widgets Rectangle { id: root - readonly property real scaling: Scaling.scale(screen) - signal entered signal exited signal clicked diff --git a/Widgets/NComboBox.qml b/Widgets/NComboBox.qml index 0c36869..a89d6bc 100644 --- a/Widgets/NComboBox.qml +++ b/Widgets/NComboBox.qml @@ -7,7 +7,6 @@ import qs.Widgets ColumnLayout { id: root - readonly property real scaling: Scaling.scale(screen) readonly property real preferredHeight: Style.baseWidgetSize * 1.25 * scaling property string label: "" diff --git a/Widgets/NIconButton.qml b/Widgets/NIconButton.qml index d3ebf16..933411d 100644 --- a/Widgets/NIconButton.qml +++ b/Widgets/NIconButton.qml @@ -6,7 +6,6 @@ import qs.Services Rectangle { id: root - readonly property real scaling: Scaling.scale(screen) // Multiplier to control how large the button container is relative to Style.baseWidgetSize property real sizeMultiplier: 1.0 property real size: Style.baseWidgetSize * sizeMultiplier * scaling diff --git a/Widgets/NImageRounded.qml b/Widgets/NImageRounded.qml index f1a37d9..6fb2ba8 100644 --- a/Widgets/NImageRounded.qml +++ b/Widgets/NImageRounded.qml @@ -10,7 +10,6 @@ Rectangle { property real imageRadius: width * 0.5 radius: imageRadius - readonly property real scaling: Scaling.scale(screen) property string imagePath: "" property string fallbackIcon: "" property color borderColor: "transparent" diff --git a/Widgets/NPanel.qml b/Widgets/NPanel.qml index a3d76e3..0c6878b 100644 --- a/Widgets/NPanel.qml +++ b/Widgets/NPanel.qml @@ -7,10 +7,10 @@ PanelWindow { id: root readonly property real scaling: Scaling.scale(screen) + property bool showOverlay: Settings.data.general.dimDesktop property int topMargin: Style.barHeight * scaling property color overlayColor: showOverlay ? Colors.applyOpacity(Colors.mShadow, "AA") : "transparent" - signal dismissed function hide() { @@ -37,7 +37,7 @@ PanelWindow { color: visible ? overlayColor : "transparent" visible: false WlrLayershell.exclusionMode: ExclusionMode.Ignore - screen: (typeof modelData !== 'undefined' ? modelData : null) + anchors.top: true anchors.left: true anchors.right: true diff --git a/Widgets/NPill.qml b/Widgets/NPill.qml index 58bbef3..07b9c70 100644 --- a/Widgets/NPill.qml +++ b/Widgets/NPill.qml @@ -5,8 +5,6 @@ import qs.Services Item { id: root - readonly property real scaling: Scaling.scale(screen) - property string icon: "" property string text: "" property string tooltipText: "" diff --git a/Widgets/NSlider.qml b/Widgets/NSlider.qml index 13d748f..875f988 100644 --- a/Widgets/NSlider.qml +++ b/Widgets/NSlider.qml @@ -6,14 +6,12 @@ import qs.Services Slider { id: root - readonly property real scaling: Scaling.scale(screen) readonly property real knobDiameter: Style.baseWidgetSize * 0.75 * scaling readonly property real trackHeight: knobDiameter * 0.5 readonly property real cutoutExtra: Style.baseWidgetSize * 0.1 * scaling // Optional color to cut the track beneath the knob (should match surrounding background) property var cutoutColor - property var screen property bool snapAlways: true snapMode: snapAlways ? Slider.SnapAlways : Slider.SnapOnRelease diff --git a/Widgets/NText.qml b/Widgets/NText.qml index 7e8ddb3..ca0f1fb 100644 --- a/Widgets/NText.qml +++ b/Widgets/NText.qml @@ -5,8 +5,6 @@ import qs.Widgets Text { id: root - readonly property real scaling: Scaling.scale(screen) - font.family: Settings.data.ui.fontFamily font.pointSize: Style.fontSizeMedium * scaling font.weight: Style.fontWeightRegular diff --git a/Widgets/NTextInput.qml b/Widgets/NTextInput.qml index ccfd832..db61e2d 100644 --- a/Widgets/NTextInput.qml +++ b/Widgets/NTextInput.qml @@ -6,7 +6,6 @@ import qs.Services Item { id: root - readonly property real scaling: Scaling.scale(screen) property string label: "" property string description: "" property bool readOnly: false diff --git a/Widgets/NToggle.qml b/Widgets/NToggle.qml index 8974340..fd42e39 100644 --- a/Widgets/NToggle.qml +++ b/Widgets/NToggle.qml @@ -6,7 +6,6 @@ import qs.Services RowLayout { id: root - readonly property real scaling: Scaling.scale(screen) property string label: "" property string description: "" property bool value: false diff --git a/Widgets/NTooltip.qml b/Widgets/NTooltip.qml index 70d3079..28bfd55 100644 --- a/Widgets/NTooltip.qml +++ b/Widgets/NTooltip.qml @@ -4,7 +4,6 @@ import qs.Services Window { id: root - readonly property real scaling: Scaling.scale(screen) property bool isVisible: false property string text: "Placeholder" property Item target: null