From f4b27380c32a52a7b400988e33295a5a7cd17a93 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Sun, 12 Oct 2025 08:23:24 -0400 Subject: [PATCH] Qt-Scaling: first cleanup pass --- Modules/Background/ScreenCorners.qml | 22 +- Modules/Bar/Bar.qml | 48 ++-- .../Bar/Bluetooth/BluetoothDevicesList.qml | 34 +-- Modules/Bar/Bluetooth/BluetoothPanel.qml | 32 +-- Modules/Bar/Calendar/CalendarPanel.qml | 94 +++--- Modules/Bar/Extras/BarPillHorizontal.qml | 10 +- Modules/Bar/Extras/BarPillVertical.qml | 6 +- Modules/Bar/Extras/BarWidgetLoader.qml | 10 - Modules/Bar/Extras/TrayMenu.qml | 48 ++-- Modules/Bar/WiFi/WiFiPanel.qml | 152 +++++----- Modules/Bar/Widgets/ActiveWindow.qml | 45 ++- Modules/Bar/Widgets/Battery.qml | 1 - Modules/Bar/Widgets/Bluetooth.qml | 1 - Modules/Bar/Widgets/Brightness.qml | 1 - Modules/Bar/Widgets/Clock.qml | 17 +- Modules/Bar/Widgets/ControlCenter.qml | 1 - Modules/Bar/Widgets/CustomButton.qml | 1 - Modules/Bar/Widgets/DarkMode.qml | 1 - Modules/Bar/Widgets/KeepAwake.qml | 1 - Modules/Bar/Widgets/KeyboardLayout.qml | 1 - Modules/Bar/Widgets/MediaMini.qml | 63 ++-- Modules/Bar/Widgets/Microphone.qml | 1 - Modules/Bar/Widgets/NightLight.qml | 1 - Modules/Bar/Widgets/NotificationHistory.qml | 7 +- Modules/Bar/Widgets/PowerProfile.qml | 1 - Modules/Bar/Widgets/ScreenRecorder.qml | 1 - Modules/Bar/Widgets/SessionMenu.qml | 1 - Modules/Bar/Widgets/Spacer.qml | 5 +- Modules/Bar/Widgets/SystemMonitor.qml | 65 +++-- Modules/Bar/Widgets/Taskbar.qml | 27 +- Modules/Bar/Widgets/Tray.qml | 17 +- Modules/Bar/Widgets/Volume.qml | 1 - Modules/Bar/Widgets/WallpaperSelector.qml | 1 - Modules/Bar/Widgets/WiFi.qml | 1 - Modules/Bar/Widgets/Workspace.qml | 27 +- Modules/ControlCenter/Cards/AudioCard.qml | 27 +- Modules/ControlCenter/Cards/MediaCard.qml | 60 ++-- .../ControlCenter/Cards/PowerProfilesCard.qml | 3 +- Modules/ControlCenter/Cards/ProfileCard.qml | 17 +- .../ControlCenter/Cards/SystemMonitorCard.qml | 16 +- Modules/ControlCenter/Cards/TopCard.qml | 23 +- Modules/ControlCenter/Cards/UtilitiesCard.qml | 3 +- Modules/ControlCenter/Cards/WeatherCard.qml | 25 +- Modules/ControlCenter/ControlCenterPanel.qml | 21 +- .../Extras/ControlCenterWidgetLoader.qml | 10 - Modules/ControlCenter/Widgets/Bluetooth.qml | 1 - Modules/ControlCenter/Widgets/KeepAwake.qml | 1 - Modules/ControlCenter/Widgets/NightLight.qml | 1 - .../ControlCenter/Widgets/Notifications.qml | 1 - .../ControlCenter/Widgets/PowerProfile.qml | 2 +- .../ControlCenter/Widgets/ScreenRecorder.qml | 1 - .../Widgets/WallpaperSelector.qml | 1 - Modules/ControlCenter/Widgets/WiFi.qml | 1 - Modules/Dock/Dock.qml | 34 +-- Modules/Dock/DockMenu.qml | 30 +- Modules/Launcher/Launcher.qml | 50 ++-- Modules/LockScreen/LockScreen.qml | 269 +++++++++--------- Modules/Notification/Notification.qml | 95 +++---- .../Notification/NotificationHistoryPanel.qml | 68 ++--- Modules/OSD/OSD.qml | 79 +++-- Modules/SessionMenu/SessionMenu.qml | 42 +-- .../Settings/Bar/BarWidgetSettingsDialog.qml | 16 +- .../WidgetSettings/ActiveWindowSettings.qml | 4 +- .../Bar/WidgetSettings/BatterySettings.qml | 4 +- .../Bar/WidgetSettings/BrightnessSettings.qml | 4 +- .../Bar/WidgetSettings/ClockSettings.qml | 40 +-- .../WidgetSettings/ControlCenterSettings.qml | 12 +- .../WidgetSettings/CustomButtonSettings.qml | 6 +- .../WidgetSettings/KeyboardLayoutSettings.qml | 4 +- .../Bar/WidgetSettings/MediaMiniSettings.qml | 6 +- .../Bar/WidgetSettings/MicrophoneSettings.qml | 4 +- .../NotificationHistorySettings.qml | 2 +- .../Bar/WidgetSettings/SpacerSettings.qml | 2 +- .../WidgetSettings/SystemMonitorSettings.qml | 2 +- .../Bar/WidgetSettings/TaskbarSettings.qml | 2 +- .../Bar/WidgetSettings/TraySettings.qml | 32 +-- .../Bar/WidgetSettings/VolumeSettings.qml | 4 +- .../Bar/WidgetSettings/WorkspaceSettings.qml | 4 +- Modules/Settings/Extras/SectionEditor.qml | 62 ++-- Modules/Settings/SettingsPanel.qml | 44 +-- Modules/Settings/Tabs/AboutTab.qml | 40 +-- Modules/Settings/Tabs/AudioTab.qml | 62 ++-- Modules/Settings/Tabs/BarTab.qml | 36 +-- Modules/Settings/Tabs/ColorSchemeTab.qml | 62 ++-- Modules/Settings/Tabs/ControlCenterTab.qml | 18 +- Modules/Settings/Tabs/DisplayTab.qml | 118 ++------ Modules/Settings/Tabs/DockTab.qml | 16 +- Modules/Settings/Tabs/GeneralTab.qml | 62 ++-- Modules/Settings/Tabs/HooksTab.qml | 6 +- Modules/Settings/Tabs/LauncherTab.qml | 12 +- Modules/Settings/Tabs/LocationTab.qml | 26 +- Modules/Settings/Tabs/NetworkTab.qml | 6 +- Modules/Settings/Tabs/NotificationsTab.qml | 22 +- Modules/Settings/Tabs/OsdTab.qml | 14 +- Modules/Settings/Tabs/ScreenRecorderTab.qml | 16 +- Modules/Settings/Tabs/WallpaperTab.qml | 50 ++-- Modules/Toast/SimpleToast.qml | 18 +- Modules/Toast/ToastOverlay.qml | 2 - Modules/Toast/ToastScreen.qml | 36 +-- Modules/Tooltip/Tooltip.qml | 44 ++- Modules/Wallpaper/WallpaperPanel.qml | 66 ++--- Widgets/NBox.qml | 4 +- Widgets/NBusyIndicator.qml | 4 +- Widgets/NButton.qml | 16 +- Widgets/NCheckbox.qml | 12 +- Widgets/NCircleStat.qml | 34 +-- Widgets/NCollapsible.qml | 30 +- Widgets/NColorPicker.qml | 20 +- Widgets/NColorPickerDialog.qml | 90 +++--- Widgets/NComboBox.qml | 40 +-- Widgets/NContextMenu.qml | 22 +- Widgets/NDateTimeTokens.qml | 44 +-- Widgets/NDivider.qml | 2 +- Widgets/NFilePicker.qml | 130 ++++----- Widgets/NHeader.qml | 8 +- Widgets/NIcon.qml | 2 +- Widgets/NIconButton.qml | 6 +- Widgets/NIconPicker.qml | 40 +-- Widgets/NImageCircled.qml | 4 +- Widgets/NImageRounded.qml | 4 +- Widgets/NInputAction.qml | 3 +- Widgets/NLabel.qml | 6 +- Widgets/NListView.qml | 4 +- Widgets/NPanel.qml | 82 ++---- Widgets/NQuickSetting.qml | 30 +- Widgets/NRadioButton.qml | 10 +- Widgets/NScrollView.qml | 4 +- Widgets/NSearchableComboBox.qml | 42 +-- Widgets/NSlider.qml | 8 +- Widgets/NSpinBox.qml | 16 +- Widgets/NText.qml | 2 +- Widgets/NTextInput.qml | 18 +- Widgets/NTextInputButton.qml | 4 +- Widgets/NToggle.qml | 14 +- Widgets/NValueSlider.qml | 6 +- 135 files changed, 1562 insertions(+), 1811 deletions(-) diff --git a/Modules/Background/ScreenCorners.qml b/Modules/Background/ScreenCorners.qml index c8302ca6f..781ac5311 100644 --- a/Modules/Background/ScreenCorners.qml +++ b/Modules/Background/ScreenCorners.qml @@ -16,21 +16,11 @@ Loader { id: root required property ShellScreen modelData - property real scaling: ScalingService.getScreenScale(screen) screen: modelData property color cornerColor: Settings.data.general.forceBlackScreenCorners ? Qt.rgba(0, 0, 0, 1) : Qt.alpha(Color.mSurface, Settings.data.bar.backgroundOpacity) - property real cornerRadius: Style.screenRadius * scaling - property real cornerSize: Style.screenRadius * scaling - - Connections { - target: ScalingService - function onScaleChanged(screenName, scale) { - if (screenName === screen.name) { - scaling = scale - } - } - } + property real cornerRadius: Style.screenRadius + property real cornerSize: Style.screenRadius color: Color.transparent @@ -48,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 * scaling) : 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 * scaling) : 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 * scaling) : 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 * scaling) : 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 ? 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 } mask: Region {} diff --git a/Modules/Bar/Bar.qml b/Modules/Bar/Bar.qml index dd6d950cd..666d55cf8 100644 --- a/Modules/Bar/Bar.qml +++ b/Modules/Bar/Bar.qml @@ -17,16 +17,6 @@ Variants { id: root required property ShellScreen modelData - property real scaling: ScalingService.getScreenScale(modelData) - - Connections { - target: ScalingService - function onScaleChanged(screenName, scale) { - if ((modelData !== null) && (screenName === modelData.name)) { - scaling = scale - } - } - } active: BarService.isVisible && modelData && modelData.name ? (Settings.data.bar.monitors.includes(modelData.name) || (Settings.data.bar.monitors.length === 0)) : false @@ -35,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 * scaling) - implicitWidth: (Settings.data.bar.position === "left" || Settings.data.bar.position === "right") ? Math.round(Style.barHeight * scaling) : screen.width + 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 color: Color.transparent anchors { @@ -49,10 +39,10 @@ Variants { // Floating bar margins - only apply when floating is enabled // Also don't apply margin on the opposite side ot the bar orientation, ex: if bar is floating on top, margin is only applied on top, not bottom. margins { - top: Settings.data.bar.floating && Settings.data.bar.position !== "bottom" ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0 - bottom: Settings.data.bar.floating && Settings.data.bar.position !== "top" ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0 - left: Settings.data.bar.floating && Settings.data.bar.position !== "right" ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0 - right: Settings.data.bar.floating && Settings.data.bar.position !== "left" ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0 + top: Settings.data.bar.floating && Settings.data.bar.position !== "bottom" ? Settings.data.bar.marginVertical * Style.marginXL : 0 + bottom: Settings.data.bar.floating && Settings.data.bar.position !== "top" ? Settings.data.bar.marginVertical * Style.marginXL : 0 + left: Settings.data.bar.floating && Settings.data.bar.position !== "right" ? Settings.data.bar.marginHorizontal * Style.marginXL : 0 + right: Settings.data.bar.floating && Settings.data.bar.position !== "left" ? Settings.data.bar.marginHorizontal * Style.marginXL : 0 } Component.onCompleted: { @@ -105,8 +95,8 @@ Variants { ColumnLayout { anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top - anchors.topMargin: Style.marginM * root.scaling - spacing: Style.marginS * root.scaling + anchors.topMargin: Style.marginM + spacing: Style.marginS Repeater { model: Settings.data.bar.widgets.left @@ -114,7 +104,6 @@ Variants { widgetId: (modelData.id !== undefined ? modelData.id : "") widgetProps: { "screen": root.modelData || null, - "scaling": ScalingService.getScreenScale(screen), "widgetId": modelData.id, "section": "left", "sectionWidgetIndex": index, @@ -129,7 +118,7 @@ Variants { ColumnLayout { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - spacing: Style.marginS * root.scaling + spacing: Style.marginS Repeater { model: Settings.data.bar.widgets.center @@ -137,7 +126,6 @@ Variants { widgetId: (modelData.id !== undefined ? modelData.id : "") widgetProps: { "screen": root.modelData || null, - "scaling": ScalingService.getScreenScale(screen), "widgetId": modelData.id, "section": "center", "sectionWidgetIndex": index, @@ -152,8 +140,8 @@ Variants { ColumnLayout { anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom - anchors.bottomMargin: Style.marginM * root.scaling - spacing: Style.marginS * root.scaling + anchors.bottomMargin: Style.marginM + spacing: Style.marginS Repeater { model: Settings.data.bar.widgets.right @@ -161,7 +149,6 @@ Variants { widgetId: (modelData.id !== undefined ? modelData.id : "") widgetProps: { "screen": root.modelData || null, - "scaling": ScalingService.getScreenScale(screen), "widgetId": modelData.id, "section": "right", "sectionWidgetIndex": index, @@ -185,9 +172,9 @@ Variants { id: leftSection objectName: "leftSection" anchors.left: parent.left - anchors.leftMargin: Style.marginS * root.scaling + anchors.leftMargin: Style.marginS anchors.verticalCenter: parent.verticalCenter - spacing: Style.marginS * root.scaling + spacing: Style.marginS Repeater { model: Settings.data.bar.widgets.left @@ -195,7 +182,6 @@ Variants { widgetId: (modelData.id !== undefined ? modelData.id : "") widgetProps: { "screen": root.modelData || null, - "scaling": ScalingService.getScreenScale(screen), "widgetId": modelData.id, "section": "left", "sectionWidgetIndex": index, @@ -212,7 +198,7 @@ Variants { objectName: "centerSection" anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - spacing: Style.marginS * root.scaling + spacing: Style.marginS Repeater { model: Settings.data.bar.widgets.center @@ -220,7 +206,6 @@ Variants { widgetId: (modelData.id !== undefined ? modelData.id : "") widgetProps: { "screen": root.modelData || null, - "scaling": ScalingService.getScreenScale(screen), "widgetId": modelData.id, "section": "center", "sectionWidgetIndex": index, @@ -236,9 +221,9 @@ Variants { id: rightSection objectName: "rightSection" anchors.right: parent.right - anchors.rightMargin: Style.marginS * root.scaling + anchors.rightMargin: Style.marginS anchors.verticalCenter: parent.verticalCenter - spacing: Style.marginS * root.scaling + spacing: Style.marginS Repeater { model: Settings.data.bar.widgets.right @@ -246,7 +231,6 @@ Variants { widgetId: (modelData.id !== undefined ? modelData.id : "") widgetProps: { "screen": root.modelData || null, - "scaling": ScalingService.getScreenScale(screen), "widgetId": modelData.id, "section": "right", "sectionWidgetIndex": index, diff --git a/Modules/Bar/Bluetooth/BluetoothDevicesList.qml b/Modules/Bar/Bluetooth/BluetoothDevicesList.qml index f40b13e1b..8e144c31a 100644 --- a/Modules/Bar/Bluetooth/BluetoothDevicesList.qml +++ b/Modules/Bar/Bluetooth/BluetoothDevicesList.qml @@ -18,11 +18,11 @@ ColumnLayout { } Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NText { text: root.label - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: Color.mSecondary font.weight: Style.fontWeightMedium Layout.fillWidth: true @@ -51,35 +51,35 @@ ColumnLayout { } Layout.fillWidth: true - Layout.preferredHeight: deviceLayout.implicitHeight + (Style.marginM * scaling * 2) - radius: Style.radiusM * scaling + Layout.preferredHeight: deviceLayout.implicitHeight + (Style.marginM * 2) + radius: Style.radiusM color: Color.mSurface - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) border.color: getContentColor(Color.mOutline) RowLayout { id: deviceLayout anchors.fill: parent - anchors.margins: Style.marginM * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginM + spacing: Style.marginM Layout.alignment: Qt.AlignVCenter // One device BT icon NIcon { icon: BluetoothService.getDeviceIcon(modelData) - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL color: getContentColor(Color.mOnSurface) Layout.alignment: Qt.AlignVCenter } ColumnLayout { Layout.fillWidth: true - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS // Device name NText { text: modelData.name || modelData.deviceName - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightMedium elide: Text.ElideRight color: getContentColor(Color.mOnSurface) @@ -90,7 +90,7 @@ ColumnLayout { NText { text: BluetoothService.getStatusString(modelData) visible: text !== "" - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: getContentColor(Color.mOnSurfaceVariant) } @@ -98,26 +98,26 @@ ColumnLayout { RowLayout { visible: modelData.signalStrength !== undefined Layout.fillWidth: true - spacing: Style.marginXS * scaling + spacing: Style.marginXS // Device signal strength - "Unknown" when not connected NText { text: BluetoothService.getSignalStrength(modelData) - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: getContentColor(Color.mOnSurfaceVariant) } NIcon { visible: modelData.signalStrength > 0 && !modelData.pairing && !modelData.blocked text: BluetoothService.getSignalIcon(modelData) - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: getContentColor(Color.mOnSurface) } NText { visible: modelData.signalStrength > 0 && !modelData.pairing && !modelData.blocked text: (modelData.signalStrength !== undefined && modelData.signalStrength > 0) ? modelData.signalStrength + "%" : "" - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: getContentColor(Color.mOnSurface) } } @@ -126,7 +126,7 @@ ColumnLayout { NText { visible: modelData.batteryAvailable text: BluetoothService.getBattery(modelData) - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: getContentColor(Color.mOnSurfaceVariant) } } @@ -142,7 +142,7 @@ ColumnLayout { visible: (modelData.state !== BluetoothDeviceState.Connecting) enabled: (canConnect || canDisconnect) && !isBusy outlined: !button.hovered - fontSize: Style.fontSizeXS * scaling + fontSize: Style.fontSizeXS fontWeight: Style.fontWeightMedium backgroundColor: { if (device.canDisconnect && !isBusy) { diff --git a/Modules/Bar/Bluetooth/BluetoothPanel.qml b/Modules/Bar/Bluetooth/BluetoothPanel.qml index c11d38eb7..a1be312ef 100644 --- a/Modules/Bar/Bluetooth/BluetoothPanel.qml +++ b/Modules/Bar/Bluetooth/BluetoothPanel.qml @@ -20,23 +20,23 @@ NPanel { ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginL * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginL + spacing: Style.marginM // HEADER RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NIcon { icon: "bluetooth" - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL color: Color.mPrimary } NText { text: I18n.tr("bluetooth.panel.title") - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: Color.mOnSurface Layout.fillWidth: true @@ -46,7 +46,7 @@ NPanel { id: bluetoothSwitch checked: BluetoothService.enabled onToggled: checked => BluetoothService.setBluetoothEnabled(checked) - baseSize: Style.baseWidgetSize * 0.65 * scaling + baseSize: Style.baseWidgetSize * 0.65 } NIconButton { @@ -84,25 +84,25 @@ NPanel { // Center the content within this rectangle ColumnLayout { anchors.centerIn: parent - spacing: Style.marginM * scaling + spacing: Style.marginM NIcon { icon: "bluetooth-off" - pointSize: 64 * scaling + pointSize: 64 color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } NText { text: I18n.tr("bluetooth.panel.disabled") - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } NText { text: I18n.tr("bluetooth.panel.enable-message") - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } @@ -120,7 +120,7 @@ NPanel { ColumnLayout { width: parent.width - spacing: Style.marginM * scaling + spacing: Style.marginM // Connected devices BluetoothDevicesList { @@ -168,7 +168,7 @@ NPanel { // Fallback - No devices, scanning ColumnLayout { Layout.alignment: Qt.AlignHCenter - spacing: Style.marginM * scaling + spacing: Style.marginM visible: { if (!BluetoothService.adapter || !BluetoothService.adapter.discovering || !Bluetooth.devices) { return false @@ -182,11 +182,11 @@ NPanel { RowLayout { Layout.alignment: Qt.AlignHCenter - spacing: Style.marginXS * scaling + spacing: Style.marginXS NIcon { icon: "refresh" - pointSize: Style.fontSizeXXL * 1.5 * scaling + pointSize: Style.fontSizeXXL * 1.5 color: Color.mPrimary RotationAnimation on rotation { @@ -200,14 +200,14 @@ NPanel { NText { text: I18n.tr("bluetooth.panel.scanning") - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: Color.mOnSurface } } NText { text: I18n.tr("bluetooth.panel.pairing-mode") - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } diff --git a/Modules/Bar/Calendar/CalendarPanel.qml b/Modules/Bar/Calendar/CalendarPanel.qml index e8240e844..642a27001 100644 --- a/Modules/Bar/Calendar/CalendarPanel.qml +++ b/Modules/Bar/Calendar/CalendarPanel.qml @@ -16,8 +16,8 @@ NPanel { panelContent: ColumnLayout { id: content anchors.fill: parent - anchors.margins: Style.marginL * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginL + spacing: Style.marginM readonly property int firstDayOfWeek: Qt.locale().firstDayOfWeek property bool isCurrentMonth: checkIsCurrentMonth() @@ -37,8 +37,8 @@ NPanel { // Combined blue banner with date/time and weather summary Rectangle { Layout.fillWidth: true - Layout.preferredHeight: blueColumn.implicitHeight + Style.marginM * scaling * 2 - radius: Style.radiusL * scaling + Layout.preferredHeight: blueColumn.implicitHeight + Style.marginM * 2 + radius: Style.radiusL color: Color.mPrimary ColumnLayout { @@ -46,28 +46,28 @@ NPanel { anchors.top: parent.top anchors.left: parent.left anchors.bottom: parent.bottom - anchors.topMargin: Style.marginM * scaling - anchors.leftMargin: Style.marginM * scaling - anchors.bottomMargin: Style.marginM * scaling - anchors.rightMargin: clockItem.width + (Style.marginM * scaling * 2) + anchors.topMargin: Style.marginM + anchors.leftMargin: Style.marginM + anchors.bottomMargin: Style.marginM + anchors.rightMargin: clockItem.width + (Style.marginM * 2) spacing: 0 // Combined layout for weather icon, date, and weather text RowLayout { Layout.fillWidth: true - height: 60 * scaling + height: 60 clip: true - spacing: Style.marginS * scaling + spacing: Style.marginS // Weather icon and temperature ColumnLayout { Layout.alignment: Qt.AlignVCenter - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS NIcon { Layout.alignment: Qt.AlignHCenter icon: weatherReady ? LocationService.weatherSymbolFromCode(LocationService.data.weather.current_weather.weathercode) : "cloud" - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL color: Color.mOnPrimary } @@ -85,7 +85,7 @@ NPanel { temp = Math.round(temp) return `${temp}°${suffix}` } - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightBold color: Color.mOnPrimary } @@ -100,7 +100,7 @@ NPanel { Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft text: Time.date.getDate() - pointSize: Style.fontSizeXXXL * 1.5 * scaling + pointSize: Style.fontSizeXXXL * 1.5 font.weight: Style.fontWeightBold color: Color.mOnPrimary @@ -119,18 +119,18 @@ NPanel { // Month, year, location ColumnLayout { - Layout.preferredWidth: 170 * scaling + Layout.preferredWidth: 170 Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft - Layout.bottomMargin: Style.marginXXS * scaling - Layout.topMargin: -Style.marginXXS * scaling - spacing: -Style.marginXS * scaling + Layout.bottomMargin: Style.marginXXS + Layout.topMargin: -Style.marginXXS + spacing: -Style.marginXS RowLayout { spacing: 0 NText { text: Qt.locale().monthName(grid.month, Locale.LongFormat).toUpperCase() - pointSize: Style.fontSizeXL * 1.1 * scaling + pointSize: Style.fontSizeXL * 1.1 font.weight: Style.fontWeightBold color: Color.mOnPrimary Layout.alignment: Qt.AlignBaseline @@ -139,7 +139,7 @@ NPanel { NText { text: ` ${grid.year}` - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightBold color: Qt.alpha(Color.mOnPrimary, 0.7) Layout.alignment: Qt.AlignBaseline @@ -156,16 +156,16 @@ NPanel { const chunks = Settings.data.location.name.split(",") return chunks[0] } - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightMedium color: Color.mOnPrimary - Layout.maximumWidth: 150 * scaling + Layout.maximumWidth: 150 elide: Text.ElideRight } NText { text: weatherReady ? ` (${LocationService.data.weather.timezone_abbreviation})` : "" - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS font.weight: Style.fontWeightMedium color: Qt.alpha(Color.mOnPrimary, 0.7) } @@ -184,9 +184,9 @@ NPanel { id: clockItem Layout.alignment: Qt.AlignVCenter anchors.right: parent.right - anchors.rightMargin: Style.marginM * scaling + anchors.rightMargin: Style.marginM anchors.verticalCenter: parent.verticalCenter - height: Math.round((Style.fontSizeXXXL * 1.9 * scaling) / 2) * 2 + height: Math.round((Style.fontSizeXXXL * 1.9) / 2) * 2 width: clockItem.height // Seconds circular progress @@ -206,20 +206,20 @@ NPanel { var ctx = getContext("2d") var centerX = width / 2 var centerY = height / 2 - var radius = Math.min(width, height) / 2 - 3 * scaling + var radius = Math.min(width, height) / 2 - 3 ctx.reset() // Background circle ctx.beginPath() ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI) - ctx.lineWidth = 2.5 * scaling + ctx.lineWidth = 2.5 ctx.strokeStyle = Qt.alpha(Color.mOnPrimary, 0.15) ctx.stroke() // Progress arc ctx.beginPath() ctx.arc(centerX, centerY, radius, -Math.PI / 2, -Math.PI / 2 + progress * 2 * Math.PI) - ctx.lineWidth = 2.5 * scaling + ctx.lineWidth = 2.5 ctx.strokeStyle = Color.mOnPrimary ctx.lineCap = "round" ctx.stroke() @@ -229,7 +229,7 @@ NPanel { // Digital clock ColumnLayout { anchors.centerIn: parent - spacing: -Style.marginXXS * scaling + spacing: -Style.marginXXS NText { text: { @@ -237,7 +237,7 @@ NPanel { return t.split(" ")[0] } - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS font.weight: Style.fontWeightBold color: Color.mOnPrimary family: Settings.data.ui.fontFixed @@ -246,7 +246,7 @@ NPanel { NText { text: Qt.formatTime(Time.date, "mm") - pointSize: Style.fontSizeXXS * scaling + pointSize: Style.fontSizeXXS font.weight: Style.fontWeightBold color: Color.mOnPrimary family: Settings.data.ui.fontFixed @@ -261,28 +261,28 @@ NPanel { visible: weatherReady Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter - spacing: Style.marginL * scaling + spacing: Style.marginL Repeater { model: weatherReady ? Math.min(6, LocationService.data.weather.daily.time.length) : 0 delegate: ColumnLayout { Layout.preferredWidth: 0 Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter - spacing: Style.marginS * scaling + spacing: Style.marginS NText { text: { var weatherDate = new Date(LocationService.data.weather.daily.time[index].replace(/-/g, "/")) return Qt.locale().toString(weatherDate, "ddd") } color: Color.mOnSurfaceVariant - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightMedium Layout.alignment: Qt.AlignHCenter } NIcon { Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter icon: LocationService.weatherSymbolFromCode(LocationService.data.weather.daily.weathercode[index]) - pointSize: Style.fontSizeXXL * 1.5 * scaling + pointSize: Style.fontSizeXXL * 1.5 color: Color.mPrimary } NText { @@ -298,7 +298,7 @@ NPanel { min = Math.round(min) return `${max}°/${min}°` } - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurfaceVariant font.weight: Style.fontWeightMedium } @@ -314,7 +314,7 @@ NPanel { Item {} RowLayout { Layout.fillWidth: true - spacing: Style.marginS * scaling + spacing: Style.marginS NDivider { Layout.fillWidth: true } @@ -350,7 +350,7 @@ NPanel { spacing: 0 Item { visible: Settings.data.location.showWeekNumberInCalendar - Layout.preferredWidth: visible ? Style.baseWidgetSize * 0.7 * scaling : 0 + Layout.preferredWidth: visible ? Style.baseWidgetSize * 0.7 : 0 } GridLayout { Layout.fillWidth: true @@ -362,7 +362,7 @@ NPanel { model: 7 Item { Layout.fillWidth: true - Layout.preferredHeight: Style.baseWidgetSize * 0.6 * scaling + Layout.preferredHeight: Style.baseWidgetSize * 0.6 NText { anchors.centerIn: parent text: { @@ -371,7 +371,7 @@ NPanel { return dayNames[dayIndex] } color: Color.mPrimary - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS font.weight: Style.fontWeightBold horizontalAlignment: Text.AlignHCenter } @@ -385,7 +385,7 @@ NPanel { spacing: 0 ColumnLayout { visible: Settings.data.location.showWeekNumberInCalendar - Layout.preferredWidth: visible ? Style.baseWidgetSize * 0.7 * scaling : 0 + Layout.preferredWidth: visible ? Style.baseWidgetSize * 0.7 : 0 Layout.fillHeight: true spacing: 0 Repeater { @@ -396,7 +396,7 @@ NPanel { NText { anchors.centerIn: parent color: Color.mOutline - pointSize: Style.fontSizeXXS * scaling + pointSize: Style.fontSizeXXS font.weight: Style.fontWeightMedium text: { let firstOfMonth = new Date(grid.year, grid.month, 1) @@ -428,16 +428,16 @@ NPanel { id: grid Layout.fillWidth: true Layout.fillHeight: true - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS month: Time.date.getMonth() year: Time.date.getFullYear() locale: Qt.locale() delegate: Item { Rectangle { - width: Style.baseWidgetSize * 0.9 * scaling - height: Style.baseWidgetSize * 0.9 * scaling + width: Style.baseWidgetSize * 0.9 + height: Style.baseWidgetSize * 0.9 anchors.centerIn: parent - radius: Style.radiusM * scaling + radius: Style.radiusM color: model.today ? Color.mSecondary : Color.transparent NText { anchors.centerIn: parent @@ -450,7 +450,7 @@ NPanel { return Color.mOnSurfaceVariant } opacity: model.month === grid.month ? 1.0 : 0.4 - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: model.today ? Style.fontWeightBold : Style.fontWeightMedium } Behavior on color { diff --git a/Modules/Bar/Extras/BarPillHorizontal.qml b/Modules/Bar/Extras/BarPillHorizontal.qml index a7da0d1df..82fc6dc70 100644 --- a/Modules/Bar/Extras/BarPillHorizontal.qml +++ b/Modules/Bar/Extras/BarPillHorizontal.qml @@ -38,9 +38,9 @@ Item { property bool showPill: false property bool shouldAnimateHide: false - readonly property int pillHeight: Math.round(Style.capsuleHeight * scaling) - readonly property int pillPaddingHorizontal: Math.round(Style.capsuleHeight * 0.2 * scaling) - readonly property int pillOverlap: Math.round(Style.capsuleHeight * 0.5 * scaling) + readonly property int pillHeight: Math.round(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) readonly property real iconSize: Math.max(1, compact ? pillHeight * 0.65 : pillHeight * 0.48) @@ -80,10 +80,10 @@ Item { x: { // Better text horizontal centering var centerX = (parent.width - width) / 2 - var offset = rightOpen ? Style.marginXS * scaling : -Style.marginXS * scaling + var offset = rightOpen ? Style.marginXS : -Style.marginXS if (forceOpen) { // If its force open, the icon disc background is the same color as the bg pill move text slightly - offset += rightOpen ? -Style.marginXXS * scaling : Style.marginXXS * scaling + offset += rightOpen ? -Style.marginXXS : Style.marginXXS } return centerX + offset } diff --git a/Modules/Bar/Extras/BarPillVertical.qml b/Modules/Bar/Extras/BarPillVertical.qml index f11b06e6f..20ed1db4e 100644 --- a/Modules/Bar/Extras/BarPillVertical.qml +++ b/Modules/Bar/Extras/BarPillVertical.qml @@ -45,9 +45,9 @@ Item { property bool shouldAnimateHide: false // Sizing logic for vertical bars - readonly property int buttonSize: Math.round(Style.capsuleHeight * scaling) + readonly property int buttonSize: Math.round(Style.capsuleHeight) readonly property int pillHeight: buttonSize - readonly property int pillPaddingVertical: 3 * 2 * scaling // Very precise adjustment don't replace by Style.margin + readonly property int pillPaddingVertical: 3 * 2 // Very precise adjustment don't replace by Style.margin readonly property int pillOverlap: buttonSize * 0.5 readonly property int maxPillWidth: buttonSize readonly property int maxPillHeight: Math.max(1, textItem.implicitHeight + pillPaddingVertical * 4) @@ -95,7 +95,7 @@ Item { var offset = openDownward ? pillPaddingVertical * 0.75 : -pillPaddingVertical * 0.75 if (forceOpen) { // If its force open, the icon disc background is the same color as the bg pill move text slightly - offset += rightOpen ? -Style.marginXXS * scaling : Style.marginXXS * scaling + offset += rightOpen ? -Style.marginXXS : Style.marginXXS } return offset } diff --git a/Modules/Bar/Extras/BarWidgetLoader.qml b/Modules/Bar/Extras/BarWidgetLoader.qml index d4194d1ea..fff11ebfb 100644 --- a/Modules/Bar/Extras/BarWidgetLoader.qml +++ b/Modules/Bar/Extras/BarWidgetLoader.qml @@ -16,16 +16,6 @@ Item { implicitWidth: getImplicitSize(loader.item, "implicitWidth") implicitHeight: getImplicitSize(loader.item, "implicitHeight") - Connections { - target: ScalingService - enabled: loader.item && (loader.item.screen !== undefined) - function onScaleChanged(aScreenName, scale) { - if (loader.item && loader.item.screen && aScreenName === screenName) { - loader.item['scaling'] = scale - } - } - } - function getImplicitSize(item, prop) { return (item && item.visible) ? Math.round(item[prop]) : 0 } diff --git a/Modules/Bar/Extras/TrayMenu.qml b/Modules/Bar/Extras/TrayMenu.qml index 9b6088b96..5d99ef9e4 100644 --- a/Modules/Bar/Extras/TrayMenu.qml +++ b/Modules/Bar/Extras/TrayMenu.qml @@ -15,23 +15,13 @@ PopupWindow { property bool isSubMenu: false property bool isHovered: rootMouseArea.containsMouse property ShellScreen screen - property real scaling: ScalingService.getScreenScale(screen) - - Connections { - target: ScalingService - function onScaleChanged(screenName, scale) { - if ((screen != null) && (screenName === screen.name)) { - scaling = scale - } - } - } readonly property int menuWidth: 180 - implicitWidth: Math.round(menuWidth * scaling) + implicitWidth: Math.round(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 * scaling)) + implicitHeight: Math.min(screen ? screen.height * 0.9 : Screen.height * 0.9, flickable.contentHeight + (Style.marginS * 2)) visible: false color: Color.transparent anchor.item: anchorItem @@ -98,14 +88,14 @@ PopupWindow { anchors.fill: parent color: Color.mSurface border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) - radius: Style.radiusM * scaling + border.width: Math.max(1, Style.borderS) + radius: Style.radiusM } Flickable { id: flickable anchors.fill: parent - anchors.margins: Style.marginS * scaling + anchors.margins: Style.marginS contentHeight: columnLayout.implicitHeight interactive: true @@ -125,11 +115,11 @@ PopupWindow { Layout.preferredWidth: parent.width Layout.preferredHeight: { if (modelData?.isSeparator) { - return 8 * scaling + return 8 } else { // Calculate based on text content - const textHeight = text.contentHeight || (Style.fontSizeS * scaling * 1.2) - return Math.max(28 * scaling, textHeight + (Style.marginS * 2 * scaling)) + const textHeight = text.contentHeight || (Style.fontSizeS * 1.2) + return Math.max(28, textHeight + (Style.marginS * 2)) } } @@ -138,35 +128,35 @@ PopupWindow { NDivider { anchors.centerIn: parent - width: parent.width - (Style.marginM * scaling * 2) + width: parent.width - (Style.marginM * 2) visible: modelData?.isSeparator ?? false } Rectangle { anchors.fill: parent color: mouseArea.containsMouse ? Color.mTertiary : Color.transparent - radius: Style.radiusS * scaling + radius: Style.radiusS visible: !(modelData?.isSeparator ?? false) RowLayout { anchors.fill: parent - anchors.leftMargin: Style.marginM * scaling - anchors.rightMargin: Style.marginM * scaling - spacing: Style.marginS * scaling + anchors.leftMargin: Style.marginM + anchors.rightMargin: Style.marginM + spacing: Style.marginS NText { id: text Layout.fillWidth: true color: (modelData?.enabled ?? true) ? (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface) : Color.mOnSurfaceVariant text: modelData?.text !== "" ? modelData?.text.replace(/[\n\r]+/g, ' ') : "..." - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS verticalAlignment: Text.AlignVCenter wrapMode: Text.WordWrap } Image { - Layout.preferredWidth: Style.marginL * scaling - Layout.preferredHeight: Style.marginL * scaling + Layout.preferredWidth: Style.marginL + Layout.preferredHeight: Style.marginL source: modelData?.icon ?? "" visible: (modelData?.icon ?? "") !== "" fillMode: Image.PreserveAspectFit @@ -174,7 +164,7 @@ PopupWindow { NIcon { icon: modelData?.hasChildren ? "menu" : "" - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS verticalAlignment: Text.AlignVCenter visible: modelData?.hasChildren ?? false color: (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface) @@ -216,8 +206,8 @@ PopupWindow { } // Need a slight overlap so that menu don't close when moving the mouse to a submenu - const submenuWidth = menuWidth * scaling // Assuming a similar width as the parent - const overlap = 4 * scaling // A small overlap to bridge the mouse path + const submenuWidth = menuWidth // Assuming a similar width as the parent + const overlap = 4 // A small overlap to bridge the mouse path // Determine submenu opening direction based on bar position and available space let openLeft = false diff --git a/Modules/Bar/WiFi/WiFiPanel.qml b/Modules/Bar/WiFi/WiFiPanel.qml index 4bd32b475..4b19145ff 100644 --- a/Modules/Bar/WiFi/WiFiPanel.qml +++ b/Modules/Bar/WiFi/WiFiPanel.qml @@ -25,23 +25,23 @@ NPanel { ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginL * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginL + spacing: Style.marginM // Header RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NIcon { icon: Settings.data.network.wifiEnabled ? "wifi" : "wifi-off" - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL color: Settings.data.network.wifiEnabled ? Color.mPrimary : Color.mOnSurfaceVariant } NText { text: I18n.tr("wifi.panel.title") - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: Color.mOnSurface Layout.fillWidth: true @@ -51,7 +51,7 @@ NPanel { id: wifiSwitch checked: Settings.data.network.wifiEnabled onToggled: checked => NetworkService.setWifiEnabled(checked) - baseSize: Style.baseWidgetSize * 0.65 * scaling + baseSize: Style.baseWidgetSize * 0.65 } NIconButton { @@ -78,28 +78,28 @@ NPanel { Rectangle { visible: NetworkService.lastError.length > 0 Layout.fillWidth: true - Layout.preferredHeight: errorRow.implicitHeight + (Style.marginM * scaling * 2) + Layout.preferredHeight: errorRow.implicitHeight + (Style.marginM * 2) color: Qt.rgba(Color.mError.r, Color.mError.g, Color.mError.b, 0.1) - radius: Style.radiusS * scaling - border.width: Math.max(1, Style.borderS * scaling) + radius: Style.radiusS + border.width: Math.max(1, Style.borderS) border.color: Color.mError RowLayout { id: errorRow anchors.fill: parent - anchors.margins: Style.marginM * scaling - spacing: Style.marginS * scaling + anchors.margins: Style.marginM + spacing: Style.marginS NIcon { icon: "warning" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: Color.mError } NText { text: NetworkService.lastError color: Color.mError - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS wrapMode: Text.Wrap Layout.fillWidth: true } @@ -122,7 +122,7 @@ NPanel { ColumnLayout { visible: !Settings.data.network.wifiEnabled anchors.fill: parent - spacing: Style.marginM * scaling + spacing: Style.marginM Item { Layout.fillHeight: true @@ -130,21 +130,21 @@ NPanel { NIcon { icon: "wifi-off" - pointSize: 64 * scaling + pointSize: 64 color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } NText { text: I18n.tr("wifi.panel.disabled") - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } NText { text: I18n.tr("wifi.panel.enable-message") - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } @@ -158,7 +158,7 @@ NPanel { ColumnLayout { visible: Settings.data.network.wifiEnabled && NetworkService.scanning && Object.keys(NetworkService.networks).length === 0 anchors.fill: parent - spacing: Style.marginL * scaling + spacing: Style.marginL Item { Layout.fillHeight: true @@ -167,13 +167,13 @@ NPanel { NBusyIndicator { running: true color: Color.mPrimary - size: Style.baseWidgetSize * scaling + size: Style.baseWidgetSize Layout.alignment: Qt.AlignHCenter } NText { text: I18n.tr("wifi.panel.searching") - pointSize: Style.fontSizeNormal * scaling + pointSize: Style.fontSizeNormal color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } @@ -193,7 +193,7 @@ NPanel { ColumnLayout { width: parent.width - spacing: Style.marginM * scaling + spacing: Style.marginM // Network list Repeater { @@ -211,14 +211,14 @@ NPanel { Rectangle { Layout.fillWidth: true - implicitHeight: netColumn.implicitHeight + (Style.marginM * scaling * 2) - radius: Style.radiusM * scaling + implicitHeight: netColumn.implicitHeight + (Style.marginM * 2) + radius: Style.radiusM // Add opacity for operations in progress opacity: (NetworkService.disconnectingFrom === modelData.ssid || NetworkService.forgettingNetwork === modelData.ssid) ? 0.6 : 1.0 color: modelData.connected ? Qt.rgba(Color.mPrimary.r, Color.mPrimary.g, Color.mPrimary.b, 0.05) : Color.mSurface - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) border.color: modelData.connected ? Color.mPrimary : Color.mOutline // Smooth opacity animation @@ -230,29 +230,29 @@ NPanel { ColumnLayout { id: netColumn - width: parent.width - (Style.marginM * scaling * 2) - x: Style.marginM * scaling - y: Style.marginM * scaling - spacing: Style.marginS * scaling + width: parent.width - (Style.marginM * 2) + x: Style.marginM + y: Style.marginM + spacing: Style.marginS // Main row RowLayout { Layout.fillWidth: true - spacing: Style.marginS * scaling + spacing: Style.marginS NIcon { icon: NetworkService.signalIcon(modelData.signal) - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL color: modelData.connected ? Color.mPrimary : Color.mOnSurface } ColumnLayout { Layout.fillWidth: true - spacing: 2 * scaling + spacing: 2 NText { text: modelData.ssid - pointSize: Style.fontSizeNormal * scaling + pointSize: Style.fontSizeNormal font.weight: modelData.connected ? Style.fontWeightBold : Style.fontWeightMedium color: Color.mOnSurface elide: Text.ElideRight @@ -260,30 +260,30 @@ NPanel { } RowLayout { - spacing: Style.marginXS * scaling + spacing: Style.marginXS NText { text: I18n.tr("system.signal-strength", { "signal": modelData.signal }) - pointSize: Style.fontSizeXXS * scaling + pointSize: Style.fontSizeXXS color: Color.mOnSurfaceVariant } NText { text: "•" - pointSize: Style.fontSizeXXS * scaling + pointSize: Style.fontSizeXXS color: Color.mOnSurfaceVariant } NText { text: NetworkService.isSecured(modelData.security) ? modelData.security : "Open" - pointSize: Style.fontSizeXXS * scaling + pointSize: Style.fontSizeXXS color: Color.mOnSurfaceVariant } Item { - Layout.preferredWidth: Style.marginXXS * scaling + Layout.preferredWidth: Style.marginXXS } // Update the status badges area (around line 237) @@ -291,14 +291,14 @@ NPanel { visible: modelData.connected && NetworkService.disconnectingFrom !== modelData.ssid color: Color.mPrimary radius: height * 0.5 - width: connectedText.implicitWidth + (Style.marginS * scaling * 2) - height: connectedText.implicitHeight + (Style.marginXXS * scaling * 2) + width: connectedText.implicitWidth + (Style.marginS * 2) + height: connectedText.implicitHeight + (Style.marginXXS * 2) NText { id: connectedText anchors.centerIn: parent text: I18n.tr("wifi.panel.connected") - pointSize: Style.fontSizeXXS * scaling + pointSize: Style.fontSizeXXS color: Color.mOnPrimary } } @@ -307,14 +307,14 @@ NPanel { visible: NetworkService.disconnectingFrom === modelData.ssid color: Color.mError radius: height * 0.5 - width: disconnectingText.implicitWidth + (Style.marginS * scaling * 2) - height: disconnectingText.implicitHeight + (Style.marginXXS * scaling * 2) + width: disconnectingText.implicitWidth + (Style.marginS * 2) + height: disconnectingText.implicitHeight + (Style.marginXXS * 2) NText { id: disconnectingText anchors.centerIn: parent text: I18n.tr("wifi.panel.disconnecting") - pointSize: Style.fontSizeXXS * scaling + pointSize: Style.fontSizeXXS color: Color.mOnPrimary } } @@ -323,14 +323,14 @@ NPanel { visible: NetworkService.forgettingNetwork === modelData.ssid color: Color.mError radius: height * 0.5 - width: forgettingText.implicitWidth + (Style.marginS * scaling * 2) - height: forgettingText.implicitHeight + (Style.marginXXS * scaling * 2) + width: forgettingText.implicitWidth + (Style.marginS * 2) + height: forgettingText.implicitHeight + (Style.marginXXS * 2) NText { id: forgettingText anchors.centerIn: parent text: I18n.tr("wifi.panel.forgetting") - pointSize: Style.fontSizeXXS * scaling + pointSize: Style.fontSizeXXS color: Color.mOnPrimary } } @@ -339,16 +339,16 @@ NPanel { visible: modelData.cached && !modelData.connected && NetworkService.forgettingNetwork !== modelData.ssid && NetworkService.disconnectingFrom !== modelData.ssid color: Color.transparent border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) radius: height * 0.5 - width: savedText.implicitWidth + (Style.marginS * scaling * 2) - height: savedText.implicitHeight + (Style.marginXXS * scaling * 2) + width: savedText.implicitWidth + (Style.marginS * 2) + height: savedText.implicitHeight + (Style.marginXXS * 2) NText { id: savedText anchors.centerIn: parent text: I18n.tr("wifi.panel.saved") - pointSize: Style.fontSizeXXS * scaling + pointSize: Style.fontSizeXXS color: Color.mOnSurfaceVariant } } @@ -357,13 +357,13 @@ NPanel { // Action area RowLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS NBusyIndicator { visible: NetworkService.connectingTo === modelData.ssid || NetworkService.disconnectingFrom === modelData.ssid || NetworkService.forgettingNetwork === modelData.ssid running: visible color: Color.mPrimary - size: Style.baseWidgetSize * 0.5 * scaling + size: Style.baseWidgetSize * 0.5 } NIconButton { @@ -384,7 +384,7 @@ NPanel { return I18n.tr("wifi.panel.password") } outlined: !hovered - fontSize: Style.fontSizeXS * scaling + fontSize: Style.fontSizeXS enabled: !NetworkService.connecting onClicked: { if (modelData.existing || modelData.cached || !NetworkService.isSecured(modelData.security)) { @@ -401,7 +401,7 @@ NPanel { visible: modelData.connected && NetworkService.disconnectingFrom !== modelData.ssid text: I18n.tr("wifi.panel.disconnect") outlined: !hovered - fontSize: Style.fontSizeXS * scaling + fontSize: Style.fontSizeXS backgroundColor: Color.mError onClicked: NetworkService.disconnect(modelData.ssid) } @@ -412,35 +412,35 @@ NPanel { Rectangle { visible: passwordSsid === modelData.ssid && NetworkService.disconnectingFrom !== modelData.ssid && NetworkService.forgettingNetwork !== modelData.ssid Layout.fillWidth: true - height: passwordRow.implicitHeight + Style.marginS * scaling * 2 + height: passwordRow.implicitHeight + Style.marginS * 2 color: Color.mSurfaceVariant border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) - radius: Style.radiusS * scaling + border.width: Math.max(1, Style.borderS) + radius: Style.radiusS RowLayout { id: passwordRow anchors.fill: parent - anchors.margins: Style.marginS * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginS + spacing: Style.marginM Rectangle { Layout.fillWidth: true Layout.fillHeight: true - radius: Style.radiusXS * scaling + radius: Style.radiusXS color: Color.mSurface border.color: pwdInput.activeFocus ? Color.mSecondary : Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) TextInput { id: pwdInput anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - anchors.margins: Style.marginS * scaling + anchors.margins: Style.marginS text: passwordInput font.family: Settings.data.ui.fontFixed - font.pointSize: Style.fontSizeS * scaling + font.pointSize: Style.fontSizeS color: Color.mOnSurface echoMode: TextInput.Password selectByMouse: true @@ -462,14 +462,14 @@ NPanel { anchors.verticalCenter: parent.verticalCenter text: I18n.tr("wifi.panel.enter-password") color: Color.mOnSurfaceVariant - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS } } } NButton { text: I18n.tr("wifi.panel.connect") - fontSize: Style.fontSizeXXS * scaling + fontSize: Style.fontSizeXXS enabled: passwordInput.length > 0 && !NetworkService.connecting outlined: true onClicked: { @@ -494,28 +494,28 @@ NPanel { Rectangle { visible: expandedSsid === modelData.ssid && NetworkService.disconnectingFrom !== modelData.ssid && NetworkService.forgettingNetwork !== modelData.ssid Layout.fillWidth: true - height: forgetRow.implicitHeight + Style.marginS * 2 * scaling + height: forgetRow.implicitHeight + Style.marginS * 2 color: Color.mSurfaceVariant - radius: Style.radiusS * scaling - border.width: Math.max(1, Style.borderS * scaling) + radius: Style.radiusS + border.width: Math.max(1, Style.borderS) border.color: Color.mOutline RowLayout { id: forgetRow anchors.fill: parent - anchors.margins: Style.marginS * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginS + spacing: Style.marginM RowLayout { NIcon { icon: "trash" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: Color.mError } NText { text: I18n.tr("wifi.panel.forget-network") - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: Color.mError Layout.fillWidth: true } @@ -524,7 +524,7 @@ NPanel { NButton { id: forgetButton text: I18n.tr("wifi.panel.forget") - fontSize: Style.fontSizeXXS * scaling + fontSize: Style.fontSizeXXS backgroundColor: Color.mError outlined: forgetButton.hovered ? false : true onClicked: { @@ -550,7 +550,7 @@ NPanel { ColumnLayout { visible: Settings.data.network.wifiEnabled && !NetworkService.scanning && Object.keys(NetworkService.networks).length === 0 anchors.fill: parent - spacing: Style.marginL * scaling + spacing: Style.marginL Item { Layout.fillHeight: true @@ -558,14 +558,14 @@ NPanel { NIcon { icon: "search" - pointSize: 64 * scaling + pointSize: 64 color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } NText { text: I18n.tr("wifi.panel.no-networks") - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index de10760db..6ad19bfa6 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -12,7 +12,6 @@ Item { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" @@ -44,8 +43,8 @@ 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 * scaling)) : 0 - implicitWidth: visible ? ((barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8 * scaling) : (widgetWidth * scaling)) : 0 + implicitHeight: visible ? ((barPosition === "left" || barPosition === "right") ? calculatedVerticalHeight() : Math.round(Style.barHeight)) : 0 + implicitWidth: visible ? ((barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8) : (widgetWidth)) : 0 opacity: !autoHide || hasActiveWindow ? 1.0 : 0 Behavior on opacity { @@ -56,7 +55,7 @@ Item { } function calculatedVerticalHeight() { - return Math.round(Style.baseWidgetSize * 0.8 * scaling) + return Math.round(Style.baseWidgetSize * 0.8) } function getAppIcon() { @@ -107,7 +106,7 @@ Item { id: fullTitleMetrics visible: false text: windowTitle - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS font.weight: Style.fontWeightMedium } @@ -116,29 +115,29 @@ Item { visible: root.visible anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter - width: (barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8 * scaling) : (widgetWidth * scaling) - height: (barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8 * scaling) : Math.round(Style.capsuleHeight * scaling) - radius: (barPosition === "left" || barPosition === "right") ? width / 2 : Math.round(Style.radiusM * scaling) + 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) color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent Item { id: mainContainer anchors.fill: parent - anchors.leftMargin: (barPosition === "left" || barPosition === "right") ? 0 : Style.marginS * scaling - anchors.rightMargin: (barPosition === "left" || barPosition === "right") ? 0 : Style.marginS * scaling + anchors.leftMargin: (barPosition === "left" || barPosition === "right") ? 0 : Style.marginS + anchors.rightMargin: (barPosition === "left" || barPosition === "right") ? 0 : Style.marginS // Horizontal layout for top/bottom bars RowLayout { id: rowLayout anchors.verticalCenter: parent.verticalCenter - spacing: Style.marginS * scaling + spacing: Style.marginS visible: barPosition === "top" || barPosition === "bottom" z: 1 // Window icon Item { - Layout.preferredWidth: Math.round(18 * scaling) - Layout.preferredHeight: Math.round(18 * scaling) + Layout.preferredWidth: Math.round(18) + Layout.preferredHeight: Math.round(18) Layout.alignment: Qt.AlignVCenter visible: showIcon @@ -157,10 +156,10 @@ Item { id: titleContainer Layout.preferredWidth: { // Calculate available width based on other elements - var iconWidth = (showIcon && windowIcon.visible ? (18 * scaling + Style.marginS * scaling) : 0) - var totalMargins = Style.marginXXS * scaling * 2 + var iconWidth = (showIcon && windowIcon.visible ? (18 + Style.marginS) : 0) + var totalMargins = Style.marginXXS * 2 var availableWidth = mainContainer.width - iconWidth - totalMargins - return Math.max(20 * scaling, availableWidth) + return Math.max(20, availableWidth) } Layout.maximumWidth: Layout.preferredWidth Layout.alignment: Qt.AlignVCenter @@ -239,12 +238,12 @@ Item { x: scrollX RowLayout { - spacing: 50 * scaling // Gap between text copies + spacing: 50 // Gap between text copies NText { id: titleText text: windowTitle - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS font.weight: Style.fontWeightMedium verticalAlignment: Text.AlignVCenter color: Color.mOnSurface @@ -276,7 +275,7 @@ Item { id: infiniteScroll running: titleContainer.isScrolling && !titleContainer.isResetting from: 0 - to: -(titleContainer.textWidth + 50 * scaling) + to: -(titleContainer.textWidth + 50) duration: Math.max(4000, windowTitle.length * 100) loops: Animation.Infinite easing.type: Easing.Linear @@ -296,15 +295,15 @@ Item { Item { id: verticalLayout anchors.centerIn: parent - width: parent.width - Style.marginM * scaling * 2 - height: parent.height - Style.marginM * scaling * 2 + width: parent.width - Style.marginM * 2 + height: parent.height - Style.marginM * 2 visible: barPosition === "left" || barPosition === "right" z: 1 // Window icon Item { - width: Style.baseWidgetSize * 0.5 * scaling - height: Style.baseWidgetSize * 0.5 * scaling + width: Style.baseWidgetSize * 0.5 + height: Style.baseWidgetSize * 0.5 anchors.centerIn: parent visible: windowTitle !== "" diff --git a/Modules/Bar/Widgets/Battery.qml b/Modules/Bar/Widgets/Battery.qml index 336ee9253..271a25087 100644 --- a/Modules/Bar/Widgets/Battery.qml +++ b/Modules/Bar/Widgets/Battery.qml @@ -11,7 +11,6 @@ Item { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" diff --git a/Modules/Bar/Widgets/Bluetooth.qml b/Modules/Bar/Widgets/Bluetooth.qml index e76fa2342..8dc384fc3 100644 --- a/Modules/Bar/Widgets/Bluetooth.qml +++ b/Modules/Bar/Widgets/Bluetooth.qml @@ -11,7 +11,6 @@ NIconButton { id: root property ShellScreen screen - property real scaling: 1.0 baseSize: Style.capsuleHeight compact: (Settings.data.bar.density === "compact") diff --git a/Modules/Bar/Widgets/Brightness.qml b/Modules/Bar/Widgets/Brightness.qml index 652660c0e..81c550a74 100644 --- a/Modules/Bar/Widgets/Brightness.qml +++ b/Modules/Bar/Widgets/Brightness.qml @@ -10,7 +10,6 @@ Item { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" diff --git a/Modules/Bar/Widgets/Clock.qml b/Modules/Bar/Widgets/Clock.qml index 26ae57621..657742a44 100644 --- a/Modules/Bar/Widgets/Clock.qml +++ b/Modules/Bar/Widgets/Clock.qml @@ -9,7 +9,6 @@ Rectangle { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" @@ -41,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 * scaling) : Math.round((isBarVertical ? verticalLoader.implicitWidth : horizontalLoader.implicitWidth) + Style.marginM * 2 * scaling) + implicitWidth: isBarVertical ? Math.round(Style.capsuleHeight) : Math.round((isBarVertical ? verticalLoader.implicitWidth : horizontalLoader.implicitWidth) + Style.marginM * 2) - implicitHeight: isBarVertical ? Math.round(verticalLoader.implicitHeight + Style.marginS * 2 * scaling) : Math.round(Style.capsuleHeight * scaling) + implicitHeight: isBarVertical ? Math.round(verticalLoader.implicitHeight + Style.marginS * 2) : Math.round(Style.capsuleHeight) - radius: Math.round(Style.radiusS * scaling) + radius: Math.round(Style.radiusS) color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent Item { @@ -59,7 +58,7 @@ Rectangle { anchors.centerIn: parent sourceComponent: ColumnLayout { anchors.centerIn: parent - spacing: Settings.data.bar.showCapsule ? -4 * scaling : -2 * scaling + spacing: Settings.data.bar.showCapsule ? -4 : -2 Repeater { id: repeater model: Qt.locale().toString(now, formatHorizontal.trim()).split("\\n") @@ -69,9 +68,9 @@ Rectangle { family: useCustomFont && customFont ? customFont : Settings.data.ui.fontDefault pointSize: { if (repeater.model.length == 1) { - return Style.fontSizeS * scaling + return Style.fontSizeS } else { - return (index == 0) ? Style.fontSizeXS * scaling : Style.fontSizeXXS * scaling + return (index == 0) ? Style.fontSizeXS : Style.fontSizeXXS } } font.weight: Style.fontWeightBold @@ -90,14 +89,14 @@ Rectangle { anchors.centerIn: parent // Now this works without layout conflicts sourceComponent: ColumnLayout { anchors.centerIn: parent - spacing: -2 * scaling + spacing: -2 Repeater { model: Qt.locale().toString(now, formatVertical.trim()).split(" ") delegate: NText { visible: text !== "" text: modelData family: useCustomFont && customFont ? customFont : Settings.data.ui.fontDefault - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS font.weight: Style.fontWeightBold color: usePrimaryColor ? Color.mPrimary : Color.mOnSurface wrapMode: Text.WordWrap diff --git a/Modules/Bar/Widgets/ControlCenter.qml b/Modules/Bar/Widgets/ControlCenter.qml index 65eb3b8cf..7cc16d7be 100644 --- a/Modules/Bar/Widgets/ControlCenter.qml +++ b/Modules/Bar/Widgets/ControlCenter.qml @@ -10,7 +10,6 @@ NIconButton { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" diff --git a/Modules/Bar/Widgets/CustomButton.qml b/Modules/Bar/Widgets/CustomButton.qml index 50310b246..f95528a48 100644 --- a/Modules/Bar/Widgets/CustomButton.qml +++ b/Modules/Bar/Widgets/CustomButton.qml @@ -12,7 +12,6 @@ Item { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" diff --git a/Modules/Bar/Widgets/DarkMode.qml b/Modules/Bar/Widgets/DarkMode.qml index b35dd236d..0ac3017f4 100644 --- a/Modules/Bar/Widgets/DarkMode.qml +++ b/Modules/Bar/Widgets/DarkMode.qml @@ -7,7 +7,6 @@ NIconButton { id: root property ShellScreen screen - property real scaling: 1.0 icon: "dark-mode" tooltipText: Settings.data.colorSchemes.darkMode ? I18n.tr("tooltips.switch-to-light-mode") : I18n.tr("tooltips.switch-to-dark-mode") diff --git a/Modules/Bar/Widgets/KeepAwake.qml b/Modules/Bar/Widgets/KeepAwake.qml index ba09d92a9..5371eabea 100644 --- a/Modules/Bar/Widgets/KeepAwake.qml +++ b/Modules/Bar/Widgets/KeepAwake.qml @@ -9,7 +9,6 @@ NIconButton { id: root property ShellScreen screen - property real scaling: 1.0 baseSize: Style.capsuleHeight compact: (Settings.data.bar.density === "compact") diff --git a/Modules/Bar/Widgets/KeyboardLayout.qml b/Modules/Bar/Widgets/KeyboardLayout.qml index ec83b71ef..55402ba34 100644 --- a/Modules/Bar/Widgets/KeyboardLayout.qml +++ b/Modules/Bar/Widgets/KeyboardLayout.qml @@ -12,7 +12,6 @@ Item { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index e33be8f27..70d1d95cc 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -11,7 +11,6 @@ Item { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" @@ -60,8 +59,8 @@ Item { return title } - implicitHeight: visible ? ((barPosition === "left" || barPosition === "right") ? calculatedVerticalHeight() : Math.round(Style.barHeight * scaling)) : 0 - implicitWidth: visible ? ((barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8 * scaling) : (widgetWidth * scaling)) : 0 + implicitHeight: visible ? ((barPosition === "left" || barPosition === "right") ? calculatedVerticalHeight() : Math.round(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 Behavior on opacity { @@ -76,7 +75,7 @@ Item { } function calculatedVerticalHeight() { - return Math.round(Style.baseWidgetSize * 0.8 * scaling) + return Math.round(Style.baseWidgetSize * 0.8) } // A hidden text element to safely measure the full title width @@ -92,16 +91,16 @@ Item { visible: root.visible anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter - width: (barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8 * scaling) : (widgetWidth * scaling) - height: (barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8 * scaling) : Math.round(Style.capsuleHeight * scaling) - radius: (barPosition === "left" || barPosition === "right") ? width / 2 : Math.round(Style.radiusM * scaling) + 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) color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent Item { id: mainContainer anchors.fill: parent - anchors.leftMargin: (barPosition === "left" || barPosition === "right") ? 0 : Style.marginS * scaling - anchors.rightMargin: (barPosition === "left" || barPosition === "right") ? 0 : Style.marginS * scaling + anchors.leftMargin: (barPosition === "left" || barPosition === "right") ? 0 : Style.marginS + anchors.rightMargin: (barPosition === "left" || barPosition === "right") ? 0 : Style.marginS Loader { anchors.verticalCenter: parent.verticalCenter @@ -110,8 +109,8 @@ Item { z: 0 sourceComponent: LinearSpectrum { - width: mainContainer.width - Style.marginS * scaling - height: 20 * scaling + width: mainContainer.width - Style.marginS + height: 20 values: CavaService.values fillColor: Color.mPrimary opacity: 0.4 @@ -125,8 +124,8 @@ Item { z: 0 sourceComponent: MirroredSpectrum { - width: mainContainer.width - Style.marginS * scaling - height: mainContainer.height - Style.marginS * scaling + width: mainContainer.width - Style.marginS + height: mainContainer.height - Style.marginS values: CavaService.values fillColor: Color.mPrimary opacity: 0.4 @@ -140,8 +139,8 @@ Item { z: 0 sourceComponent: WaveSpectrum { - width: mainContainer.width - Style.marginS * scaling - height: mainContainer.height - Style.marginS * scaling + width: mainContainer.width - Style.marginS + height: mainContainer.height - Style.marginS values: CavaService.values fillColor: Color.mPrimary opacity: 0.4 @@ -153,7 +152,7 @@ Item { id: rowLayout anchors.verticalCenter: parent.verticalCenter - spacing: Style.marginS * scaling + spacing: Style.marginS visible: (barPosition === "top" || barPosition === "bottom") z: 1 // Above the visualizer @@ -161,7 +160,7 @@ Item { id: windowIcon icon: hasActivePlayer ? (MediaService.isPlaying ? "media-pause" : "media-play") : "disc" color: hasActivePlayer ? Color.mOnSurface : Color.mOnSurfaceVariant - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL verticalAlignment: Text.AlignVCenter Layout.alignment: Qt.AlignVCenter visible: !hasActivePlayer || (!showAlbumArt && !trackArt.visible) @@ -173,15 +172,15 @@ Item { spacing: 0 Item { - Layout.preferredWidth: Math.round(21 * scaling) - Layout.preferredHeight: Math.round(21 * scaling) + Layout.preferredWidth: Math.round(21) + Layout.preferredHeight: Math.round(21) NImageCircled { id: trackArt anchors.fill: parent imagePath: MediaService.trackArtUrl fallbackIcon: MediaService.isPlaying ? "media-pause" : "media-play" - fallbackIconSize: 10 * scaling + fallbackIconSize: 10 borderWidth: 0 border.color: Color.transparent } @@ -192,11 +191,11 @@ Item { id: titleContainer Layout.preferredWidth: { // Calculate available width based on other elements in the row - var iconWidth = (windowIcon.visible ? (Style.fontSizeL * scaling + Style.marginS * scaling) : 0) - var albumArtWidth = (hasActivePlayer && showAlbumArt ? (18 * scaling + Style.marginS * scaling) : 0) - var totalMargins = Style.marginXXS * scaling * 2 + var iconWidth = (windowIcon.visible ? (Style.fontSizeL + Style.marginS) : 0) + var albumArtWidth = (hasActivePlayer && showAlbumArt ? (18 + Style.marginS) : 0) + var totalMargins = Style.marginXXS * 2 var availableWidth = mainContainer.width - iconWidth - albumArtWidth - totalMargins - return Math.max(20 * scaling, availableWidth) + return Math.max(20, availableWidth) } Layout.maximumWidth: Layout.preferredWidth Layout.alignment: Qt.AlignVCenter @@ -281,12 +280,12 @@ Item { x: scrollX RowLayout { - spacing: 50 * scaling // Gap between text copies + spacing: 50 // Gap between text copies NText { id: titleText text: hasActivePlayer ? getTitle() : placeholderText - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS font.weight: Style.fontWeightMedium verticalAlignment: Text.AlignVCenter horizontalAlignment: hasActivePlayer ? Text.AlignLeft : Text.AlignHCenter @@ -319,7 +318,7 @@ Item { id: infiniteScroll running: titleContainer.isScrolling && !titleContainer.isResetting from: 0 - to: -(titleContainer.textWidth + 50 * scaling) // Scroll one complete text width + gap + to: -(titleContainer.textWidth + 50) // Scroll one complete text width + gap duration: Math.max(4000, getTitle().length * 120) loops: Animation.Infinite easing.type: Easing.Linear @@ -339,15 +338,15 @@ Item { Item { id: verticalLayout anchors.centerIn: parent - width: parent.width - Style.marginM * scaling * 2 - height: parent.height - Style.marginM * scaling * 2 + width: parent.width - Style.marginM * 2 + height: parent.height - Style.marginM * 2 visible: barPosition === "left" || barPosition === "right" z: 1 // Above the visualizer // Media icon Item { - width: Style.baseWidgetSize * 0.5 * scaling - height: Style.baseWidgetSize * 0.5 * scaling + width: Style.baseWidgetSize * 0.5 + height: Style.baseWidgetSize * 0.5 anchors.centerIn: parent NIcon { @@ -355,7 +354,7 @@ Item { anchors.fill: parent icon: hasActivePlayer ? (MediaService.isPlaying ? "media-pause" : "media-play") : "disc" color: hasActivePlayer ? Color.mOnSurface : Color.mOnSurfaceVariant - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } diff --git a/Modules/Bar/Widgets/Microphone.qml b/Modules/Bar/Widgets/Microphone.qml index d0d357277..c42aa7b40 100644 --- a/Modules/Bar/Widgets/Microphone.qml +++ b/Modules/Bar/Widgets/Microphone.qml @@ -12,7 +12,6 @@ Item { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" diff --git a/Modules/Bar/Widgets/NightLight.qml b/Modules/Bar/Widgets/NightLight.qml index b972d37d9..0f56cb0e6 100644 --- a/Modules/Bar/Widgets/NightLight.qml +++ b/Modules/Bar/Widgets/NightLight.qml @@ -12,7 +12,6 @@ NIconButton { id: root property ShellScreen screen - property real scaling: 1.0 compact: (Settings.data.bar.density === "compact") baseSize: Style.capsuleHeight diff --git a/Modules/Bar/Widgets/NotificationHistory.qml b/Modules/Bar/Widgets/NotificationHistory.qml index aee735980..c97add241 100644 --- a/Modules/Bar/Widgets/NotificationHistory.qml +++ b/Modules/Bar/Widgets/NotificationHistory.qml @@ -11,7 +11,6 @@ NIconButton { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" @@ -69,14 +68,14 @@ NIconButton { Loader { anchors.right: parent.right anchors.top: parent.top - anchors.rightMargin: 2 * scaling - anchors.topMargin: 1 * scaling + anchors.rightMargin: 2 + anchors.topMargin: 1 z: 2 active: showUnreadBadge && (!hideWhenZero || computeUnreadCount() > 0) sourceComponent: Rectangle { id: badge readonly property int count: computeUnreadCount() - height: 8 * scaling + height: 8 width: height radius: height / 2 color: Color.mError diff --git a/Modules/Bar/Widgets/PowerProfile.qml b/Modules/Bar/Widgets/PowerProfile.qml index fbd2a719b..62242c523 100644 --- a/Modules/Bar/Widgets/PowerProfile.qml +++ b/Modules/Bar/Widgets/PowerProfile.qml @@ -10,7 +10,6 @@ NIconButton { id: root property ShellScreen screen - property real scaling: 1.0 baseSize: Style.capsuleHeight visible: PowerProfileService.available diff --git a/Modules/Bar/Widgets/ScreenRecorder.qml b/Modules/Bar/Widgets/ScreenRecorder.qml index 16b57804c..267903f46 100644 --- a/Modules/Bar/Widgets/ScreenRecorder.qml +++ b/Modules/Bar/Widgets/ScreenRecorder.qml @@ -8,7 +8,6 @@ NIconButton { id: root property ShellScreen screen - property real scaling: 1.0 icon: "camera-video" tooltipText: ScreenRecorderService.isRecording ? I18n.tr("tooltips.click-to-stop-recording") : I18n.tr("tooltips.click-to-start-recording") diff --git a/Modules/Bar/Widgets/SessionMenu.qml b/Modules/Bar/Widgets/SessionMenu.qml index f8f099293..661d6079d 100644 --- a/Modules/Bar/Widgets/SessionMenu.qml +++ b/Modules/Bar/Widgets/SessionMenu.qml @@ -9,7 +9,6 @@ NIconButton { id: root property ShellScreen screen - property real scaling: 1.0 compact: (Settings.data.bar.density === "compact") baseSize: Style.capsuleHeight diff --git a/Modules/Bar/Widgets/Spacer.qml b/Modules/Bar/Widgets/Spacer.qml index d8e4abcb8..3af0e792d 100644 --- a/Modules/Bar/Widgets/Spacer.qml +++ b/Modules/Bar/Widgets/Spacer.qml @@ -9,7 +9,6 @@ Item { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" @@ -32,8 +31,8 @@ Item { readonly property int spacerWidth: widgetSettings.width !== undefined ? widgetSettings.width : widgetMetadata.width // Set the width based on user settings - implicitWidth: spacerWidth * scaling - implicitHeight: Style.barHeight * scaling + implicitWidth: spacerWidth + implicitHeight: Style.barHeight width: implicitWidth height: implicitHeight } diff --git a/Modules/Bar/Widgets/SystemMonitor.qml b/Modules/Bar/Widgets/SystemMonitor.qml index cda66b11b..d683a06b5 100644 --- a/Modules/Bar/Widgets/SystemMonitor.qml +++ b/Modules/Bar/Widgets/SystemMonitor.qml @@ -9,7 +9,6 @@ Rectangle { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" @@ -45,9 +44,9 @@ Rectangle { return Math.max(1, compact ? base * 0.43 : base * 0.33) } - readonly property int percentTextWidth: Math.ceil(percentMetrics.boundingRect.width + 3 * scaling) - readonly property int tempTextWidth: Math.ceil(tempMetrics.boundingRect.width + 3 * scaling) - readonly property int memTextWidth: Math.ceil(memMetrics.boundingRect.width + 3 * scaling) + readonly property int percentTextWidth: Math.ceil(percentMetrics.boundingRect.width + 3) + readonly property int tempTextWidth: Math.ceil(tempMetrics.boundingRect.width + 3) + readonly property int memTextWidth: Math.ceil(memMetrics.boundingRect.width + 3) TextMetrics { id: percentMetrics @@ -74,9 +73,9 @@ Rectangle { } anchors.centerIn: parent - implicitWidth: isVertical ? Math.round(Style.capsuleHeight * scaling) : Math.round(mainGrid.implicitWidth + Style.marginM * 2 * scaling) - implicitHeight: isVertical ? Math.round(mainGrid.implicitHeight + Style.marginM * 2 * scaling) : Math.round(Style.capsuleHeight * scaling) - radius: Math.round(Style.radiusM * scaling) + 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) color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent GridLayout { @@ -85,13 +84,13 @@ Rectangle { flow: isVertical ? GridLayout.TopToBottom : GridLayout.LeftToRight rows: isVertical ? -1 : 1 columns: isVertical ? 1 : -1 - rowSpacing: isVertical ? (Style.marginM * scaling) : 0 - columnSpacing: isVertical ? 0 : (Style.marginM * scaling) + rowSpacing: isVertical ? (Style.marginM) : 0 + columnSpacing: isVertical ? 0 : (Style.marginM) // CPU Usage Component Item { - Layout.preferredWidth: isVertical ? root.width : iconSize + percentTextWidth + (Style.marginXXS * scaling) - Layout.preferredHeight: Math.round(Style.capsuleHeight * scaling) + Layout.preferredWidth: isVertical ? root.width : iconSize + percentTextWidth + (Style.marginXXS) + Layout.preferredHeight: Math.round(Style.capsuleHeight) Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter visible: showCpuUsage @@ -101,8 +100,8 @@ Rectangle { flow: isVertical ? GridLayout.TopToBottom : GridLayout.LeftToRight rows: isVertical ? 2 : 1 columns: isVertical ? 1 : 2 - rowSpacing: Style.marginXXS * scaling - columnSpacing: Style.marginXXS * scaling + rowSpacing: Style.marginXXS + columnSpacing: Style.marginXXS NIcon { icon: "cpu-usage" @@ -131,8 +130,8 @@ Rectangle { // CPU Temperature Component Item { - Layout.preferredWidth: isVertical ? root.width : (iconSize + tempTextWidth) + (Style.marginXXS * scaling) - Layout.preferredHeight: Math.round(Style.capsuleHeight * scaling) + Layout.preferredWidth: isVertical ? root.width : (iconSize + tempTextWidth) + (Style.marginXXS) + Layout.preferredHeight: Math.round(Style.capsuleHeight) Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter visible: showCpuTemp @@ -142,8 +141,8 @@ Rectangle { flow: isVertical ? GridLayout.TopToBottom : GridLayout.LeftToRight rows: isVertical ? 2 : 1 columns: isVertical ? 1 : 2 - rowSpacing: Style.marginXXS * scaling - columnSpacing: Style.marginXXS * scaling + rowSpacing: Style.marginXXS + columnSpacing: Style.marginXXS NIcon { icon: "cpu-temperature" @@ -172,8 +171,8 @@ Rectangle { // Memory Usage Component Item { - Layout.preferredWidth: isVertical ? root.width : iconSize + (showMemoryAsPercent ? percentTextWidth : memTextWidth) + (Style.marginXXS * scaling) - Layout.preferredHeight: Math.round(Style.capsuleHeight * scaling) + Layout.preferredWidth: isVertical ? root.width : iconSize + (showMemoryAsPercent ? percentTextWidth : memTextWidth) + (Style.marginXXS) + Layout.preferredHeight: Math.round(Style.capsuleHeight) Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter visible: showMemoryUsage @@ -183,8 +182,8 @@ Rectangle { flow: isVertical ? GridLayout.TopToBottom : GridLayout.LeftToRight rows: isVertical ? 2 : 1 columns: isVertical ? 1 : 2 - rowSpacing: Style.marginXXS * scaling - columnSpacing: Style.marginXXS * scaling + rowSpacing: Style.marginXXS + columnSpacing: Style.marginXXS NIcon { icon: "memory" @@ -213,8 +212,8 @@ Rectangle { // Network Download Speed Component Item { - Layout.preferredWidth: isVertical ? root.width : iconSize + memTextWidth + (Style.marginXXS * scaling) - Layout.preferredHeight: Math.round(Style.capsuleHeight * scaling) + Layout.preferredWidth: isVertical ? root.width : iconSize + memTextWidth + (Style.marginXXS) + Layout.preferredHeight: Math.round(Style.capsuleHeight) Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter visible: showNetworkStats @@ -224,8 +223,8 @@ Rectangle { flow: isVertical ? GridLayout.TopToBottom : GridLayout.LeftToRight rows: isVertical ? 2 : 1 columns: isVertical ? 1 : 2 - rowSpacing: Style.marginXXS * scaling - columnSpacing: Style.marginXXS * scaling + rowSpacing: Style.marginXXS + columnSpacing: Style.marginXXS NIcon { icon: "download-speed" @@ -254,8 +253,8 @@ Rectangle { // Network Upload Speed Component Item { - Layout.preferredWidth: isVertical ? root.width : iconSize + memTextWidth + (Style.marginXXS * scaling) - Layout.preferredHeight: Math.round(Style.capsuleHeight * scaling) + Layout.preferredWidth: isVertical ? root.width : iconSize + memTextWidth + (Style.marginXXS) + Layout.preferredHeight: Math.round(Style.capsuleHeight) Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter visible: showNetworkStats @@ -265,8 +264,8 @@ Rectangle { flow: isVertical ? GridLayout.TopToBottom : GridLayout.LeftToRight rows: isVertical ? 2 : 1 columns: isVertical ? 1 : 2 - rowSpacing: Style.marginXXS * scaling - columnSpacing: Style.marginXXS * scaling + rowSpacing: Style.marginXXS + columnSpacing: Style.marginXXS NIcon { icon: "upload-speed" @@ -295,8 +294,8 @@ Rectangle { // Disk Usage Component (primary drive) Item { - Layout.preferredWidth: isVertical ? root.width : iconSize + percentTextWidth + (Style.marginXXS * scaling) - Layout.preferredHeight: Math.round(Style.capsuleHeight * scaling) + Layout.preferredWidth: isVertical ? root.width : iconSize + percentTextWidth + (Style.marginXXS) + Layout.preferredHeight: Math.round(Style.capsuleHeight) Layout.alignment: isVertical ? Qt.AlignHCenter : Qt.AlignVCenter visible: showDiskUsage @@ -306,8 +305,8 @@ Rectangle { flow: isVertical ? GridLayout.TopToBottom : GridLayout.LeftToRight rows: isVertical ? 2 : 1 columns: isVertical ? 1 : 2 - rowSpacing: Style.marginXXS * scaling - columnSpacing: Style.marginXXS * scaling + rowSpacing: Style.marginXXS + columnSpacing: Style.marginXXS NIcon { icon: "storage" diff --git a/Modules/Bar/Widgets/Taskbar.qml b/Modules/Bar/Widgets/Taskbar.qml index e9035002f..8fa7558e5 100644 --- a/Modules/Bar/Widgets/Taskbar.qml +++ b/Modules/Bar/Widgets/Taskbar.qml @@ -12,7 +12,6 @@ Rectangle { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" @@ -22,7 +21,7 @@ Rectangle { readonly property bool isVerticalBar: Settings.data.bar.position === "left" || Settings.data.bar.position === "right" readonly property bool compact: (Settings.data.bar.density === "compact") - readonly property real itemSize: compact ? Style.capsuleHeight * 0.9 * scaling : Style.capsuleHeight * 0.8 * scaling + readonly property real itemSize: compact ? Style.capsuleHeight * 0.9 : Style.capsuleHeight * 0.8 property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId] property var widgetSettings: { @@ -36,27 +35,27 @@ Rectangle { } // Always visible when there are toplevels - implicitWidth: isVerticalBar ? Math.round(Style.capsuleHeight * scaling) : Math.round(taskbarLayout.implicitWidth + Style.marginM * scaling * 2) - implicitHeight: isVerticalBar ? Math.round(taskbarLayout.implicitHeight + Style.marginM * scaling * 2) : Math.round(Style.capsuleHeight * scaling) - radius: Math.round(Style.radiusM * scaling) + 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) color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent GridLayout { id: taskbarLayout anchors.fill: parent anchors { - leftMargin: isVerticalBar ? undefined : Style.marginM * scaling - rightMargin: isVerticalBar ? undefined : Style.marginM * scaling - topMargin: compact ? 0 : isVerticalBar ? Style.marginM * scaling : undefined - bottomMargin: compact ? 0 : isVerticalBar ? Style.marginM * scaling : undefined + leftMargin: isVerticalBar ? undefined : Style.marginM + rightMargin: isVerticalBar ? undefined : Style.marginM + topMargin: compact ? 0 : isVerticalBar ? Style.marginM : undefined + bottomMargin: compact ? 0 : isVerticalBar ? Style.marginM : undefined } // Configure GridLayout to behave like RowLayout or ColumnLayout rows: isVerticalBar ? -1 : 1 // -1 means unlimited columns: isVerticalBar ? 1 : -1 // -1 means unlimited - rowSpacing: isVerticalBar ? Style.marginXXS * root.scaling : 0 - columnSpacing: isVerticalBar ? 0 : Style.marginXXS * root.scaling + rowSpacing: isVerticalBar ? Style.marginXXS : 0 + columnSpacing: isVerticalBar ? 0 : Style.marginXXS Repeater { model: CompositorService.windows @@ -82,12 +81,12 @@ Rectangle { opacity: modelData.isFocused ? Style.opacityFull : 0.6 Rectangle { - anchors.bottomMargin: -2 * scaling + anchors.bottomMargin: -2 anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter id: iconBackground - width: 4 * scaling - height: 4 * scaling + width: 4 + height: 4 color: modelData.isFocused ? Color.mPrimary : Color.transparent radius: width * 0.5 } diff --git a/Modules/Bar/Widgets/Tray.qml b/Modules/Bar/Widgets/Tray.qml index 0365cc2ee..dce3e7bce 100644 --- a/Modules/Bar/Widgets/Tray.qml +++ b/Modules/Bar/Widgets/Tray.qml @@ -14,7 +14,6 @@ Rectangle { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" @@ -36,7 +35,7 @@ Rectangle { readonly property string barPosition: Settings.data.bar.position readonly property bool isVertical: barPosition === "left" || barPosition === "right" readonly property bool compact: (Settings.data.bar.density === "compact") - property real itemSize: Math.round(Style.capsuleHeight * 0.65 * scaling) + property real itemSize: Math.round(Style.capsuleHeight * 0.65) property list blacklist: widgetSettings.blacklist || widgetMetadata.blacklist || [] // Read from settings property var filteredItems: [] @@ -145,9 +144,9 @@ Rectangle { } visible: filteredItems.length > 0 - implicitWidth: isVertical ? Math.round(Style.capsuleHeight * scaling) : Math.round(trayFlow.implicitWidth + Style.marginM * 2 * scaling) - implicitHeight: isVertical ? Math.round(trayFlow.implicitHeight + Style.marginM * 2 * scaling) : Math.round(Style.capsuleHeight * scaling) - radius: Math.round(Style.radiusM * scaling) + 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) color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent Layout.alignment: Qt.AlignVCenter @@ -155,7 +154,7 @@ Rectangle { Flow { id: trayFlow anchors.centerIn: parent - spacing: Style.marginM * scaling + spacing: Style.marginM flow: isVertical ? Flow.TopToBottom : Flow.LeftToRight Repeater { @@ -231,16 +230,16 @@ Rectangle { let menuX, menuY if (barPosition === "left") { // For left bar: position menu to the right of the bar - menuX = width + Style.marginM * scaling + menuX = width + Style.marginM menuY = 0 } else if (barPosition === "right") { // For right bar: position menu to the left of the bar - menuX = -trayMenu.item.width - Style.marginM * scaling + menuX = -trayMenu.item.width - Style.marginM menuY = 0 } else { // For horizontal bars: center horizontally and position below menuX = (width / 2) - (trayMenu.item.width / 2) - menuY = Math.round(Style.barHeight * scaling) + menuY = Math.round(Style.barHeight) } trayMenu.item.menu = modelData.menu trayMenu.item.showAt(parent, menuX, menuY) diff --git a/Modules/Bar/Widgets/Volume.qml b/Modules/Bar/Widgets/Volume.qml index 775a31d60..4526c7ff0 100644 --- a/Modules/Bar/Widgets/Volume.qml +++ b/Modules/Bar/Widgets/Volume.qml @@ -12,7 +12,6 @@ Item { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" diff --git a/Modules/Bar/Widgets/WallpaperSelector.qml b/Modules/Bar/Widgets/WallpaperSelector.qml index 4be3e9a1b..01e5cc2bd 100644 --- a/Modules/Bar/Widgets/WallpaperSelector.qml +++ b/Modules/Bar/Widgets/WallpaperSelector.qml @@ -9,7 +9,6 @@ NIconButton { id: root property ShellScreen screen - property real scaling: 1.0 baseSize: Style.capsuleHeight compact: (Settings.data.bar.density === "compact") diff --git a/Modules/Bar/Widgets/WiFi.qml b/Modules/Bar/Widgets/WiFi.qml index 00fefab69..7130ef013 100644 --- a/Modules/Bar/Widgets/WiFi.qml +++ b/Modules/Bar/Widgets/WiFi.qml @@ -11,7 +11,6 @@ NIconButton { id: root property ShellScreen screen - property real scaling: 1.0 compact: (Settings.data.bar.density === "compact") baseSize: Style.capsuleHeight diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index f093df3e3..8bdc8bbfe 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -13,7 +13,6 @@ Item { id: root property ShellScreen screen - property real scaling: 1.0 // Widget properties passed from Bar.qml for per-instance settings property string widgetId: "" @@ -54,8 +53,8 @@ Item { property bool effectsActive: false property color effectColor: Color.mPrimary - property int horizontalPadding: Math.round(Style.marginS * scaling) - property int spacingBetweenPills: Math.round(Style.marginXS * scaling) + property int horizontalPadding: Math.round(Style.marginS) + property int spacingBetweenPills: Math.round(Style.marginXS) // Wheel scroll handling property int wheelAccumulatedDelta: 0 @@ -63,19 +62,19 @@ Item { signal workspaceChanged(int workspaceId, color accentColor) - implicitWidth: isVertical ? Math.round(Style.barHeight * scaling) : computeWidth() - implicitHeight: isVertical ? computeHeight() : Math.round(Style.barHeight * scaling) + implicitWidth: isVertical ? Math.round(Style.barHeight) : computeWidth() + implicitHeight: isVertical ? computeHeight() : Math.round(Style.barHeight) function getWorkspaceWidth(ws) { const d = Style.capsuleHeight * root.baseDimensionRatio const factor = ws.isFocused ? 2.2 : 1 - return d * factor * scaling + return d * factor } function getWorkspaceHeight(ws) { const d = Style.capsuleHeight * root.baseDimensionRatio const factor = ws.isFocused ? 2.2 : 1 - return d * factor * scaling + return d * factor } function computeWidth() { @@ -203,9 +202,9 @@ Item { Rectangle { id: workspaceBackground - width: isVertical ? Math.round(Style.capsuleHeight * scaling) : parent.width - height: isVertical ? parent.height : Math.round(Style.capsuleHeight * scaling) - radius: Math.round(Style.radiusM * scaling) + width: isVertical ? Math.round(Style.capsuleHeight) : parent.width + height: isVertical ? parent.height : Math.round(Style.capsuleHeight) + radius: Math.round(Style.radiusM) color: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent anchors.horizontalCenter: parent.horizontalCenter @@ -266,7 +265,7 @@ Item { Item { id: workspacePillContainer width: root.getWorkspaceWidth(model) - height: Style.capsuleHeight * root.baseDimensionRatio * scaling + height: Style.capsuleHeight * root.baseDimensionRatio Rectangle { id: pill @@ -387,7 +386,7 @@ Item { radius: width / 2 color: Color.transparent border.color: root.effectColor - border.width: Math.max(1, Math.round((2 + 6 * (1.0 - root.masterProgress)) * scaling)) + border.width: Math.max(1, Math.round((2 + 6 * (1.0 - root.masterProgress)))) opacity: root.effectsActive && model.isFocused ? (1.0 - root.masterProgress) * 0.7 : 0 visible: root.effectsActive && model.isFocused z: 1 @@ -409,7 +408,7 @@ Item { model: localWorkspaces Item { id: workspacePillContainerVertical - width: Style.capsuleHeight * root.baseDimensionRatio * scaling + width: Style.capsuleHeight * root.baseDimensionRatio height: root.getWorkspaceHeight(model) Rectangle { @@ -531,7 +530,7 @@ Item { radius: width / 2 color: Color.transparent border.color: root.effectColor - border.width: Math.max(1, Math.round((2 + 6 * (1.0 - root.masterProgress)) * scaling)) + border.width: Math.max(1, Math.round((2 + 6 * (1.0 - root.masterProgress)))) opacity: root.effectsActive && model.isFocused ? (1.0 - root.masterProgress) * 0.7 : 0 visible: root.effectsActive && model.isFocused z: 1 diff --git a/Modules/ControlCenter/Cards/AudioCard.qml b/Modules/ControlCenter/Cards/AudioCard.qml index a4c975feb..c09b05bf8 100644 --- a/Modules/ControlCenter/Cards/AudioCard.qml +++ b/Modules/ControlCenter/Cards/AudioCard.qml @@ -9,7 +9,6 @@ import qs.Widgets NBox { id: root - property real scaling: 1.0 property real localOutputVolume: AudioService.volume property real localInputVolume: AudioService.inputVolume @@ -42,12 +41,12 @@ NBox { ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginM * scaling + anchors.margins: Style.marginM spacing: 0 // Output Volume Section ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true opacity: AudioService.sink ? 1.0 : 0.5 enabled: AudioService.sink @@ -55,7 +54,7 @@ NBox { // Output Volume Header RowLayout { Layout.fillWidth: true - spacing: Style.marginXS * scaling + spacing: Style.marginXS NIconButton { icon: AudioService.muted ? "volume-off" : "volume-high" @@ -72,19 +71,19 @@ NBox { } RowLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NText { text: I18n.tr("settings.audio.volumes.output-volume.label") - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurface font.weight: Style.fontWeightMedium } NText { text: AudioService.sink ? AudioService.sink.description : "No output device" - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurfaceVariant font.weight: Style.fontWeightMedium elide: Text.ElideRight @@ -101,7 +100,7 @@ NBox { value: localOutputVolume || 0 stepSize: 0.01 text: Math.round((AudioService.volume || 0) * 100) + "%" - textSize: Style.fontSizeXS * scaling + textSize: Style.fontSizeXS customHeightRatio: 0.6 onMoved: value => localOutputVolume = value } @@ -109,7 +108,7 @@ NBox { // Input Volume Section ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true opacity: AudioService.source ? 1.0 : 0.5 enabled: AudioService.source @@ -117,7 +116,7 @@ NBox { // Input Volume Header RowLayout { Layout.fillWidth: true - spacing: Style.marginXS * scaling + spacing: Style.marginXS NIconButton { icon: AudioService.inputMuted ? "microphone-off" : "microphone" @@ -130,19 +129,19 @@ NBox { } RowLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NText { text: I18n.tr("settings.audio.volumes.input-volume.label") - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurface font.weight: Style.fontWeightMedium } NText { text: AudioService.source ? AudioService.source.description : "No input device" - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurfaceVariant font.weight: Style.fontWeightMedium elide: Text.ElideRight @@ -159,7 +158,7 @@ NBox { value: AudioService.inputVolume || 0 stepSize: 0.01 text: Math.round((AudioService.inputVolume || 0) * 100) + "%" - textSize: Style.fontSizeXS * scaling + textSize: Style.fontSizeXS customHeightRatio: 0.6 onMoved: value => AudioService.setInputVolume(value) } diff --git a/Modules/ControlCenter/Cards/MediaCard.qml b/Modules/ControlCenter/Cards/MediaCard.qml index 8af05e1e8..068918681 100644 --- a/Modules/ControlCenter/Cards/MediaCard.qml +++ b/Modules/ControlCenter/Cards/MediaCard.qml @@ -11,8 +11,6 @@ import qs.Widgets NBox { id: root - property real scaling: 1.0 - // Background artwork that covers everything Item { anchors.fill: parent @@ -22,7 +20,7 @@ NBox { id: bgArtImage anchors.fill: parent imagePath: MediaService.trackArtUrl - imageRadius: Style.radiusM * scaling + imageRadius: Style.radiusM visible: MediaService.trackArtUrl !== "" } @@ -31,7 +29,7 @@ NBox { anchors.fill: parent color: Color.mSurfaceVariant opacity: 0.85 - radius: Style.radiusM * scaling + radius: Style.radiusM } // Border @@ -40,7 +38,7 @@ NBox { color: Color.transparent border.color: Color.mOutline border.width: 1 - radius: Style.radiusM * scaling + radius: Style.radiusM } } @@ -57,7 +55,7 @@ NBox { sourceItem: Rectangle { width: root.width height: root.height - radius: Style.radiusM * scaling + radius: Style.radiusM color: "white" } } @@ -118,29 +116,29 @@ NBox { anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - anchors.topMargin: Style.marginXS * scaling - anchors.leftMargin: Style.marginM * scaling - anchors.rightMargin: Style.marginM * scaling - height: Style.barHeight * scaling + anchors.topMargin: Style.marginXS + anchors.leftMargin: Style.marginM + anchors.rightMargin: Style.marginM + height: Style.barHeight visible: MediaService.getAvailablePlayers().length > 1 - radius: Style.radiusM * scaling + radius: Style.radiusM color: Color.transparent property var currentPlayer: MediaService.getAvailablePlayers()[MediaService.selectedPlayerIndex] RowLayout { anchors.fill: parent - spacing: Style.marginS * scaling + spacing: Style.marginS NIcon { icon: "caret-down" - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL color: Color.mOnSurfaceVariant } NText { text: playerSelectorButton.currentPlayer ? playerSelectorButton.currentPlayer.identity : "" - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurfaceVariant Layout.fillWidth: true } @@ -172,7 +170,7 @@ NBox { NContextMenu { id: playerContextMenu parent: root - width: 200 * scaling + width: 200 onTriggered: function (action) { var index = parseInt(action) @@ -186,14 +184,14 @@ NBox { ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginM * scaling + anchors.margins: Style.marginM // No media player detected ColumnLayout { id: fallback visible: !main.visible - spacing: Style.marginS * scaling + spacing: Style.marginS Item { Layout.fillWidth: true @@ -206,12 +204,12 @@ NBox { ColumnLayout { anchors.centerIn: parent - spacing: Style.marginL * scaling + spacing: Style.marginL Item { Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: Style.fontSizeXXXL * 4 * scaling - Layout.preferredHeight: Style.fontSizeXXXL * 4 * scaling + Layout.preferredWidth: Style.fontSizeXXXL * 4 + Layout.preferredHeight: Style.fontSizeXXXL * 4 // Pulsating audio circles (background) Repeater { @@ -260,7 +258,7 @@ NBox { NIcon { anchors.centerIn: parent icon: "disc" - pointSize: Style.fontSizeXXXL * 3 * scaling + pointSize: Style.fontSizeXXXL * 3 color: Color.mOnSurfaceVariant RotationAnimator on rotation { @@ -276,7 +274,7 @@ NBox { // Descriptive text ColumnLayout { Layout.alignment: Qt.AlignHCenter - spacing: Style.marginXS * scaling + spacing: Style.marginXS } } } @@ -292,23 +290,23 @@ NBox { id: main visible: MediaService.currentPlayer && MediaService.canPlay - spacing: Style.marginS * scaling + spacing: Style.marginS // Spacer to push content down Item { - Layout.preferredHeight: Style.marginM * scaling + Layout.preferredHeight: Style.marginM } // Metadata at the bottom left ColumnLayout { Layout.fillWidth: true Layout.alignment: Qt.AlignLeft - spacing: Style.marginXS * scaling + spacing: Style.marginXS NText { visible: MediaService.trackTitle !== "" text: MediaService.trackTitle - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold elide: Text.ElideRight wrapMode: Text.Wrap @@ -320,7 +318,7 @@ NBox { visible: MediaService.trackArtist !== "" text: MediaService.trackArtist color: Color.mPrimary - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS elide: Text.ElideRight Layout.fillWidth: true } @@ -329,7 +327,7 @@ NBox { visible: MediaService.trackAlbum !== "" text: MediaService.trackAlbum color: Color.mOnSurfaceVariant - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM elide: Text.ElideRight Layout.fillWidth: true } @@ -340,7 +338,7 @@ NBox { id: progressWrapper visible: (MediaService.currentPlayer && MediaService.trackLength > 0) Layout.fillWidth: true - height: Style.baseWidgetSize * 0.5 * scaling + height: Style.baseWidgetSize * 0.5 property real localSeekRatio: -1 property real lastSentSeekRatio: -1 @@ -410,12 +408,12 @@ NBox { // Spacer to push media controls down Item { - Layout.preferredHeight: Style.marginL * scaling + Layout.preferredHeight: Style.marginL } // Media controls RowLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter diff --git a/Modules/ControlCenter/Cards/PowerProfilesCard.qml b/Modules/ControlCenter/Cards/PowerProfilesCard.qml index 4e6d6ccf0..d4e856950 100644 --- a/Modules/ControlCenter/Cards/PowerProfilesCard.qml +++ b/Modules/ControlCenter/Cards/PowerProfilesCard.qml @@ -10,7 +10,6 @@ import qs.Widgets // Power Profiles: performance, balanced, eco NBox { - property real scaling: 1.0 property real spacing: 0 // Centralized service @@ -19,7 +18,7 @@ NBox { RowLayout { id: powerRow anchors.fill: parent - anchors.margins: Style.marginS * scaling + anchors.margins: Style.marginS spacing: spacing Item { Layout.fillWidth: true diff --git a/Modules/ControlCenter/Cards/ProfileCard.qml b/Modules/ControlCenter/Cards/ProfileCard.qml index c36d57dca..51ea1025b 100644 --- a/Modules/ControlCenter/Cards/ProfileCard.qml +++ b/Modules/ControlCenter/Cards/ProfileCard.qml @@ -14,7 +14,6 @@ import qs.Widgets NBox { id: root - property real scaling: 1.0 property string uptimeText: "--" RowLayout { @@ -22,21 +21,21 @@ NBox { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - anchors.margins: Style.marginM * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginM + spacing: Style.marginM NImageCircled { - width: Style.baseWidgetSize * 1.25 * scaling - height: Style.baseWidgetSize * 1.25 * scaling + width: Style.baseWidgetSize * 1.25 + height: Style.baseWidgetSize * 1.25 imagePath: Settings.data.general.avatarImage fallbackIcon: "person" borderColor: Color.mPrimary - borderWidth: Math.max(1, Style.borderM * scaling) + borderWidth: Math.max(1, Style.borderM) } ColumnLayout { Layout.fillWidth: true - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS NText { text: Quickshell.env("USER") || "user" font.weight: Style.fontWeightBold @@ -46,13 +45,13 @@ NBox { text: I18n.tr("system.uptime", { "uptime": uptimeText }) - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: Color.mOnSurfaceVariant } } RowLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Item { Layout.fillWidth: true diff --git a/Modules/ControlCenter/Cards/SystemMonitorCard.qml b/Modules/ControlCenter/Cards/SystemMonitorCard.qml index a0772e969..7a6e12106 100644 --- a/Modules/ControlCenter/Cards/SystemMonitorCard.qml +++ b/Modules/ControlCenter/Cards/SystemMonitorCard.qml @@ -9,12 +9,10 @@ import qs.Widgets NBox { id: root - property real scaling: 1.0 - Item { id: content anchors.fill: parent - anchors.margins: Style.marginS * scaling + anchors.margins: Style.marginS ColumnLayout { anchors.centerIn: parent @@ -25,8 +23,7 @@ NBox { icon: "cpu-usage" flat: true contentScale: 0.8 - height: 65 * scaling - scaling: root.scaling + height: 65 Layout.alignment: Qt.AlignHCenter } NCircleStat { @@ -35,8 +32,7 @@ NBox { icon: "cpu-temperature" flat: true contentScale: 0.8 - height: 65 * scaling - scaling: root.scaling + height: 65 Layout.alignment: Qt.AlignHCenter } NCircleStat { @@ -44,8 +40,7 @@ NBox { icon: "memory" flat: true contentScale: 0.8 - height: 65 * scaling - scaling: root.scaling + height: 65 Layout.alignment: Qt.AlignHCenter } NCircleStat { @@ -53,8 +48,7 @@ NBox { icon: "storage" flat: true contentScale: 0.8 - height: 65 * scaling - scaling: root.scaling + height: 65 Layout.alignment: Qt.AlignHCenter } } diff --git a/Modules/ControlCenter/Cards/TopCard.qml b/Modules/ControlCenter/Cards/TopCard.qml index 21b68ecae..48ef1dcf9 100644 --- a/Modules/ControlCenter/Cards/TopCard.qml +++ b/Modules/ControlCenter/Cards/TopCard.qml @@ -16,11 +16,11 @@ NBox { id: root property string uptimeText: "--" - property real spacing: Style.marginS * scaling + property real spacing: Style.marginS ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginM * scaling + anchors.margins: Style.marginM // Profile, Uptime, Settings, SessionMenu, Close RowLayout { @@ -30,19 +30,19 @@ NBox { Layout.alignment: Qt.AlignVCenter NImageCircled { - width: Style.baseWidgetSize * 1.25 * scaling + width: Style.baseWidgetSize * 1.25 height: width imagePath: Settings.data.general.avatarImage fallbackIcon: "person" borderColor: Color.mPrimary - borderWidth: Math.max(1, Style.borderM * scaling) + borderWidth: Math.max(1, Style.borderM) Layout.alignment: Qt.AlignVCenter - Layout.topMargin: Style.marginXS * scaling + Layout.topMargin: Style.marginXS } ColumnLayout { Layout.fillWidth: true - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS NText { text: Quickshell.env("USER") || "user" font.weight: Style.fontWeightBold @@ -52,7 +52,7 @@ NBox { text: I18n.tr("system.uptime", { "uptime": uptimeText }) - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurfaceVariant } } @@ -98,16 +98,16 @@ NBox { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginS * scaling - Layout.bottomMargin: Style.marginS * scaling + Layout.topMargin: Style.marginS + Layout.bottomMargin: Style.marginS } GridLayout { id: grid Layout.fillWidth: true columns: (Settings.data.controlCenter.quickSettingsStyle === "compact") ? 4 : 3 - columnSpacing: Style.marginS * scaling - rowSpacing: Style.marginS * scaling + columnSpacing: Style.marginS + rowSpacing: Style.marginS Repeater { model: Settings.data.controlCenter.widgets.quickSettings @@ -116,7 +116,6 @@ NBox { widgetId: (modelData.id !== undefined ? modelData.id : "") widgetProps: { "screen": root.modelData || null, - "scaling": ScalingService.getScreenScale(screen), "widgetId": modelData.id, "section": "quickSettings", "sectionWidgetIndex": index, diff --git a/Modules/ControlCenter/Cards/UtilitiesCard.qml b/Modules/ControlCenter/Cards/UtilitiesCard.qml index 62827b73e..29b821ef1 100644 --- a/Modules/ControlCenter/Cards/UtilitiesCard.qml +++ b/Modules/ControlCenter/Cards/UtilitiesCard.qml @@ -10,13 +10,12 @@ import qs.Widgets // Utilities: record & wallpaper NBox { - property real scaling: 1.0 property real spacing: 0 RowLayout { id: utilRow anchors.fill: parent - anchors.margins: Style.marginS * scaling + anchors.margins: Style.marginS spacing: spacing Item { Layout.fillWidth: true diff --git a/Modules/ControlCenter/Cards/WeatherCard.qml b/Modules/ControlCenter/Cards/WeatherCard.qml index 702cf76b1..e6b366ff6 100644 --- a/Modules/ControlCenter/Cards/WeatherCard.qml +++ b/Modules/ControlCenter/Cards/WeatherCard.qml @@ -9,7 +9,6 @@ import qs.Widgets NBox { id: root - property real scaling: 1.0 readonly property bool weatherReady: (LocationService.data.weather !== null) ColumnLayout { @@ -17,28 +16,28 @@ NBox { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - anchors.margins: Style.marginM * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginM + spacing: Style.marginM clip: true RowLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS NIcon { Layout.alignment: Qt.AlignVCenter icon: weatherReady ? LocationService.weatherSymbolFromCode(LocationService.data.weather.current_weather.weathercode) : "" - pointSize: Style.fontSizeXXXL * 1.75 * scaling + pointSize: Style.fontSizeXXXL * 1.75 color: Color.mPrimary } ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS NText { text: { // Ensure the name is not too long if one had to specify the country const chunks = Settings.data.location.name.split(",") return chunks[0] } - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold } @@ -58,13 +57,13 @@ NBox { temp = Math.round(temp) return `${temp}°${suffix}` } - pointSize: Style.fontSizeXL * scaling + pointSize: Style.fontSizeXL font.weight: Style.fontWeightBold } NText { text: weatherReady ? `(${LocationService.data.weather.timezone_abbreviation})` : "" - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurfaceVariant visible: LocationService.data.weather } @@ -81,12 +80,12 @@ NBox { visible: weatherReady Layout.fillWidth: true Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter - spacing: Style.marginL * scaling + spacing: Style.marginL Repeater { model: weatherReady ? LocationService.data.weather.daily.time : [] delegate: ColumnLayout { Layout.alignment: Qt.AlignHCenter - spacing: Style.marginXS * scaling + spacing: Style.marginXS NText { text: { var weatherDate = new Date(LocationService.data.weather.daily.time[index].replace(/-/g, "/")) @@ -98,7 +97,7 @@ NBox { NIcon { Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter icon: LocationService.weatherSymbolFromCode(LocationService.data.weather.daily.weathercode[index]) - pointSize: Style.fontSizeXXL * 1.6 * scaling + pointSize: Style.fontSizeXXL * 1.6 color: Color.mPrimary } NText { @@ -114,7 +113,7 @@ NBox { min = Math.round(min) return `${max}°/${min}°` } - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurfaceVariant } } diff --git a/Modules/ControlCenter/ControlCenterPanel.qml b/Modules/ControlCenter/ControlCenterPanel.qml index 5c7989a3a..030bcc1ed 100644 --- a/Modules/ControlCenter/ControlCenterPanel.qml +++ b/Modules/ControlCenter/ControlCenterPanel.qml @@ -26,7 +26,7 @@ NPanel { panelContent: Item { id: content - property real cardSpacing: Style.marginL * scaling + property real cardSpacing: Style.marginL // Layout content ColumnLayout { @@ -39,48 +39,43 @@ NPanel { // Cards (consistent inter-card spacing via ColumnLayout spacing) ProfileCard { Layout.fillWidth: true - Layout.preferredHeight: Math.max(64 * scaling) - scaling: root.scaling + Layout.preferredHeight: Math.max(64) } WeatherCard { Layout.fillWidth: true - Layout.preferredHeight: Math.max(190 * scaling) - scaling: root.scaling + Layout.preferredHeight: Math.max(190) } // Middle section: media + stats column RowLayout { Layout.fillWidth: true - Layout.preferredHeight: Math.max(260 * scaling) + Layout.preferredHeight: Math.max(260) spacing: content.cardSpacing // Media card MediaCard { Layout.fillWidth: true Layout.fillHeight: true - scaling: root.scaling } // System monitors combined in one card SystemMonitorCard { - Layout.preferredWidth: Style.baseWidgetSize * 2.625 * scaling + Layout.preferredWidth: Style.baseWidgetSize * 2.625 Layout.fillHeight: true - scaling: root.scaling } } // Audio card below media and system monitor AudioCard { Layout.fillWidth: true - Layout.preferredHeight: Math.max(120 * scaling) - scaling: root.scaling + Layout.preferredHeight: Math.max(120) } // Bottom actions (two grouped rows of round buttons) RowLayout { Layout.fillWidth: true - Layout.preferredHeight: Math.max(60 * scaling) + Layout.preferredHeight: Math.max(60) spacing: content.cardSpacing // Power Profiles switcher @@ -88,7 +83,6 @@ NPanel { Layout.fillWidth: true Layout.fillHeight: true spacing: content.cardSpacing - scaling: root.scaling } // Utilities buttons @@ -96,7 +90,6 @@ NPanel { Layout.fillWidth: true Layout.fillHeight: true spacing: content.cardSpacing - scaling: root.scaling } } } diff --git a/Modules/ControlCenter/Extras/ControlCenterWidgetLoader.qml b/Modules/ControlCenter/Extras/ControlCenterWidgetLoader.qml index 4e7577ee9..5dbe1338a 100644 --- a/Modules/ControlCenter/Extras/ControlCenterWidgetLoader.qml +++ b/Modules/ControlCenter/Extras/ControlCenterWidgetLoader.qml @@ -16,16 +16,6 @@ Item { implicitWidth: getImplicitSize(loader.item, "implicitWidth") implicitHeight: getImplicitSize(loader.item, "implicitHeight") - Connections { - target: ScalingService - enabled: loader.item && (loader.item.screen !== undefined) - function onScaleChanged(aScreenName, scale) { - if (loader.item && loader.item.screen && aScreenName === screenName) { - loader.item['scaling'] = scale - } - } - } - function getImplicitSize(item, prop) { return (item && item.visible) ? item[prop] : 0 } diff --git a/Modules/ControlCenter/Widgets/Bluetooth.qml b/Modules/ControlCenter/Widgets/Bluetooth.qml index e9886a4f2..312e56287 100644 --- a/Modules/ControlCenter/Widgets/Bluetooth.qml +++ b/Modules/ControlCenter/Widgets/Bluetooth.qml @@ -6,7 +6,6 @@ import qs.Widgets NQuickSetting { property ShellScreen screen - property real scaling: 1.0 text: I18n.tr("quickSettings.bluetooth.label.enabled") icon: BluetoothService.enabled ? "bluetooth" : "bluetooth-off" diff --git a/Modules/ControlCenter/Widgets/KeepAwake.qml b/Modules/ControlCenter/Widgets/KeepAwake.qml index 044734e4a..7d7fc95f7 100644 --- a/Modules/ControlCenter/Widgets/KeepAwake.qml +++ b/Modules/ControlCenter/Widgets/KeepAwake.qml @@ -6,7 +6,6 @@ import qs.Widgets NQuickSetting { property ShellScreen screen - property real scaling: 1.0 text: I18n.tr("quickSettings.keepAwake.label.enabled") icon: IdleInhibitorService.isInhibited ? "keep-awake-on" : "keep-awake-off" diff --git a/Modules/ControlCenter/Widgets/NightLight.qml b/Modules/ControlCenter/Widgets/NightLight.qml index 19cdd669c..945b0466a 100644 --- a/Modules/ControlCenter/Widgets/NightLight.qml +++ b/Modules/ControlCenter/Widgets/NightLight.qml @@ -6,7 +6,6 @@ import qs.Widgets NQuickSetting { property ShellScreen screen - property real scaling: 1.0 enabled: ProgramCheckerService.wlsunsetAvailable text: I18n.tr("quickSettings.nightLight.label.enabled") diff --git a/Modules/ControlCenter/Widgets/Notifications.qml b/Modules/ControlCenter/Widgets/Notifications.qml index 19c22a82e..512749e90 100644 --- a/Modules/ControlCenter/Widgets/Notifications.qml +++ b/Modules/ControlCenter/Widgets/Notifications.qml @@ -6,7 +6,6 @@ import qs.Widgets NQuickSetting { property ShellScreen screen - property real scaling: 1.0 text: Settings.data.notifications.doNotDisturb ? I18n.tr("quickSettings.notifications.label.disabled") : I18n.tr("quickSettings.notifications.label.enabled") icon: Settings.data.notifications.doNotDisturb ? "bell-off" : "bell" diff --git a/Modules/ControlCenter/Widgets/PowerProfile.qml b/Modules/ControlCenter/Widgets/PowerProfile.qml index 1a504963e..1c9121301 100644 --- a/Modules/ControlCenter/Widgets/PowerProfile.qml +++ b/Modules/ControlCenter/Widgets/PowerProfile.qml @@ -8,7 +8,7 @@ import qs.Widgets // Performance NQuickSetting { property ShellScreen screen - property real scaling: 1.0 + readonly property bool hasPP: PowerProfileService.available enabled: hasPP diff --git a/Modules/ControlCenter/Widgets/ScreenRecorder.qml b/Modules/ControlCenter/Widgets/ScreenRecorder.qml index f9ad87864..9cf03fb9d 100644 --- a/Modules/ControlCenter/Widgets/ScreenRecorder.qml +++ b/Modules/ControlCenter/Widgets/ScreenRecorder.qml @@ -6,7 +6,6 @@ import qs.Widgets NQuickSetting { property ShellScreen screen - property real scaling: 1.0 enabled: ProgramCheckerService.gpuScreenRecorderAvailable icon: "camera-video" diff --git a/Modules/ControlCenter/Widgets/WallpaperSelector.qml b/Modules/ControlCenter/Widgets/WallpaperSelector.qml index 95a50af36..a37a9ba0c 100644 --- a/Modules/ControlCenter/Widgets/WallpaperSelector.qml +++ b/Modules/ControlCenter/Widgets/WallpaperSelector.qml @@ -6,7 +6,6 @@ import qs.Widgets NQuickSetting { property ShellScreen screen - property real scaling: 1.0 enabled: Settings.data.wallpaper.enabled icon: "wallpaper-selector" diff --git a/Modules/ControlCenter/Widgets/WiFi.qml b/Modules/ControlCenter/Widgets/WiFi.qml index 7f7398661..8c28ddd3f 100644 --- a/Modules/ControlCenter/Widgets/WiFi.qml +++ b/Modules/ControlCenter/Widgets/WiFi.qml @@ -6,7 +6,6 @@ import qs.Widgets NQuickSetting { property ShellScreen screen - property real scaling: 1.0 icon: { try { diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index b23c90bc1..cdc3dc0c9 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -16,7 +16,7 @@ Variants { id: root required property ShellScreen modelData - property real scaling: ScalingService.getScreenScale(modelData) + property bool barIsReady: modelData ? BarService.isBarReady(modelData.name) : false Connections { @@ -28,15 +28,6 @@ Variants { } } - Connections { - target: ScalingService - function onScaleChanged(screenName, scale) { - if (screenName === modelData.name) { - scaling = scale - } - } - } - // Update dock apps when toplevels change Connections { target: ToplevelManager ? ToplevelManager.toplevels : null @@ -71,14 +62,14 @@ Variants { readonly property int showDelay: 100 readonly property int hideAnimationDuration: Style.animationFast readonly property int showAnimationDuration: Style.animationFast - readonly property int peekHeight: 1 // no scaling for peek - readonly property int iconSize: 36 * scaling - readonly property int floatingMargin: Settings.data.dock.floatingRatio * Style.marginL * scaling + readonly property int peekHeight: 1 + readonly property int iconSize: 36 + readonly property int floatingMargin: Settings.data.dock.floatingRatio * Style.marginL // 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 barAtBottom: hasBar && Settings.data.bar.position === "bottom" - readonly property int barHeight: Style.barHeight * scaling + readonly property int barHeight: Style.barHeight // Shared state between windows property bool dockHovered: false @@ -264,7 +255,7 @@ Variants { 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 + floatingMargin : floatingMargin) + return (Style.barHeight + Style.marginM) + (Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL + floatingMargin : floatingMargin) default: return floatingMargin } @@ -305,12 +296,12 @@ Variants { Rectangle { id: dockContainer - width: dockLayout.implicitWidth + Style.marginM * scaling * 2 + width: dockLayout.implicitWidth + Style.marginM * 2 height: Math.round(iconSize * 1.5) color: Qt.alpha(Color.mSurface, Settings.data.dock.backgroundOpacity) anchors.centerIn: parent - radius: Style.radiusL * scaling - border.width: Math.max(1, Style.borderS * scaling) + radius: Style.radiusL + border.width: Math.max(1, Style.borderS) border.color: Qt.alpha(Color.mOutline, Settings.data.dock.backgroundOpacity) MouseArea { @@ -343,7 +334,7 @@ Variants { Item { id: dock width: dockLayout.implicitWidth - height: parent.height - (Style.marginM * 2 * scaling) + height: parent.height - (Style.marginM * 2) anchors.centerIn: parent function getAppIcon(appData): string { @@ -354,7 +345,7 @@ Variants { RowLayout { id: dockLayout - spacing: Style.marginM * scaling + spacing: Style.marginM Layout.preferredHeight: parent.height anchors.centerIn: parent @@ -446,7 +437,6 @@ Variants { // Context menu popup DockMenu { id: contextMenu - scaling: root.scaling onHoveredChanged: menuHovered = hovered onRequestClose: { contextMenu.hide() @@ -542,7 +532,7 @@ Variants { width: iconSize * 0.2 height: iconSize * 0.1 color: Color.mPrimary - radius: Style.radiusXS * scaling + radius: Style.radiusXS anchors.top: parent.bottom anchors.horizontalCenter: parent.horizontalCenter diff --git a/Modules/Dock/DockMenu.qml b/Modules/Dock/DockMenu.qml index 255e3b9df..d09ea6e73 100644 --- a/Modules/Dock/DockMenu.qml +++ b/Modules/Dock/DockMenu.qml @@ -13,7 +13,7 @@ PopupWindow { property var toplevel: null property Item anchorItem: null - property real scaling: 1.0 + property bool hovered: menuMouseArea.containsMouse property var onAppClosed: null // Callback function for when an app is closed property bool canAutoClose: false @@ -25,8 +25,8 @@ PopupWindow { signal requestClose - implicitWidth: Math.max(160 * scaling, contextMenuColumn.implicitWidth) - implicitHeight: contextMenuColumn.implicitHeight + (Style.marginM * scaling * 2) + implicitWidth: Math.max(160, contextMenuColumn.implicitWidth) + implicitHeight: contextMenuColumn.implicitHeight + (Style.marginM * 2) color: Color.transparent visible: false @@ -117,7 +117,7 @@ PopupWindow { anchor.item: anchorItem anchor.rect.x: anchorItem ? (anchorItem.width - implicitWidth) / 2 : 0 - anchor.rect.y: anchorItem ? -implicitHeight - (Style.marginM * scaling) : 0 + anchor.rect.y: anchorItem ? -implicitHeight - (Style.marginM) : 0 function show(item, toplevelData) { if (!item) { @@ -140,8 +140,8 @@ PopupWindow { // Helper function to determine which menu item is under the mouse function getHoveredItem(mouseY) { - const itemHeight = 32 * scaling - const startY = Style.marginM * scaling + const itemHeight = 32 + const startY = Style.marginM const relativeY = mouseY - startY if (relativeY < 0) @@ -208,9 +208,9 @@ PopupWindow { Rectangle { anchors.fill: parent color: Color.mSurfaceVariant - radius: Style.radiusS * scaling + radius: Style.radiusS border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) // Single MouseArea to handle both auto-close and menu interactions MouseArea { @@ -246,7 +246,7 @@ PopupWindow { ColumnLayout { id: contextMenuColumn anchors.fill: parent - anchors.margins: Style.marginM * scaling + anchors.margins: Style.marginM spacing: 0 Repeater { @@ -254,26 +254,26 @@ PopupWindow { Rectangle { Layout.fillWidth: true - height: 32 * scaling + height: 32 color: root.hoveredItem === index ? Color.mTertiary : Color.transparent - radius: Style.radiusXS * scaling + radius: Style.radiusXS RowLayout { anchors.left: parent.left - anchors.leftMargin: Style.marginS * scaling + anchors.leftMargin: Style.marginS anchors.verticalCenter: parent.verticalCenter - spacing: Style.marginS * scaling + spacing: Style.marginS NIcon { icon: modelData.icon - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: root.hoveredItem === index ? Color.mOnTertiary : Color.mOnSurfaceVariant Layout.alignment: Qt.AlignVCenter } NText { text: modelData.text - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: root.hoveredItem === index ? Color.mOnTertiary : Color.mOnSurfaceVariant Layout.alignment: Qt.AlignVCenter elide: Text.ElideRight diff --git a/Modules/Launcher/Launcher.qml b/Modules/Launcher/Launcher.qml index 1c056b056..271d4c4bf 100644 --- a/Modules/Launcher/Launcher.qml +++ b/Modules/Launcher/Launcher.qml @@ -37,8 +37,8 @@ NPanel { property bool resultsReady: false property bool ignoreMouseHover: false - readonly property int badgeSize: Math.round(Style.baseWidgetSize * 1.6 * scaling) - readonly property int entryHeight: Math.round(badgeSize + Style.marginM * 2 * scaling) + readonly property int badgeSize: Math.round(Style.baseWidgetSize * 1.6) + readonly property int entryHeight: Math.round(badgeSize + Style.marginM * 2) // Public API for plugins function setSearchText(text) { @@ -293,14 +293,14 @@ NPanel { ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginL * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginL + spacing: Style.marginM NTextInput { id: searchInput Layout.fillWidth: true - fontSize: Style.fontSizeL * scaling + fontSize: Style.fontSizeL fontWeight: Style.fontWeightSemiBold text: searchText @@ -348,7 +348,7 @@ NPanel { Layout.fillWidth: true Layout.fillHeight: true - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS model: results currentIndex: selectedIndex cacheBuffer: resultsList.height * 2 @@ -399,9 +399,9 @@ NPanel { } } - width: resultsList.width - Style.marginS * scaling + width: resultsList.width - Style.marginS implicitHeight: entryHeight - radius: Style.radiusM * scaling + radius: Style.radiusM color: entry.isSelected ? Color.mTertiary : Color.mSurface Behavior on color { @@ -414,19 +414,19 @@ NPanel { ColumnLayout { id: contentLayout anchors.fill: parent - anchors.margins: Style.marginM * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginM + spacing: Style.marginM // Top row - Main entry content with pin button RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM // Icon badge or Image preview Rectangle { Layout.preferredWidth: badgeSize Layout.preferredHeight: badgeSize - radius: Style.radiusM * scaling + radius: Style.radiusM color: Color.mSurfaceVariant // Image preview for clipboard images @@ -434,7 +434,7 @@ NPanel { id: imagePreview anchors.fill: parent visible: modelData.isImage - imageRadius: Style.radiusM * scaling + imageRadius: Style.radiusM // This property creates a dependency on the service's revision counter readonly property int _rev: ClipboardService.revision @@ -455,7 +455,7 @@ NPanel { BusyIndicator { anchors.centerIn: parent running: true - width: Style.baseWidgetSize * 0.5 * scaling + width: Style.baseWidgetSize * 0.5 height: width } } @@ -473,7 +473,7 @@ NPanel { Loader { id: iconLoader anchors.fill: parent - anchors.margins: Style.marginXS * scaling + anchors.margins: Style.marginXS visible: !modelData.isImage || imagePreview.status === Image.Error active: visible @@ -493,7 +493,7 @@ NPanel { anchors.centerIn: parent visible: !imagePreview.visible && !iconLoader.visible text: modelData.name ? modelData.name.charAt(0).toUpperCase() : "?" - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL font.weight: Style.fontWeightBold color: Color.mOnPrimary } @@ -503,10 +503,10 @@ NPanel { visible: modelData.isImage && imagePreview.visible anchors.bottom: parent.bottom anchors.right: parent.right - anchors.margins: 2 * scaling - width: formatLabel.width + 6 * scaling - height: formatLabel.height + 2 * scaling - radius: Style.radiusM * scaling + anchors.margins: 2 + width: formatLabel.width + 6 + height: formatLabel.height + 2 + radius: Style.radiusM color: Color.mSurfaceVariant NText { @@ -519,7 +519,7 @@ NPanel { const parts = desc.split(" • ") return parts[0] || "IMG" } - pointSize: Style.fontSizeXXS * scaling + pointSize: Style.fontSizeXXS color: Color.mPrimary } } @@ -528,11 +528,11 @@ NPanel { // Text content ColumnLayout { Layout.fillWidth: true - spacing: 0 * scaling + spacing: 0 NText { text: modelData.name || "Unknown" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: entry.isSelected ? Color.mOnTertiary : Color.mOnSurface elide: Text.ElideRight @@ -541,7 +541,7 @@ NPanel { NText { text: modelData.description || "" - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: entry.isSelected ? Color.mOnTertiary : Color.mOnSurfaceVariant elide: Text.ElideRight Layout.fillWidth: true @@ -596,7 +596,7 @@ NPanel { const prefix = activePlugin?.name ? `${activePlugin.name}: ` : "" return prefix + `${results.length} result${results.length !== 1 ? 's' : ''}` } - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurfaceVariant horizontalAlignment: Text.AlignCenter } diff --git a/Modules/LockScreen/LockScreen.qml b/Modules/LockScreen/LockScreen.qml index a4f1d16db..90ebc2fcb 100644 --- a/Modules/LockScreen/LockScreen.qml +++ b/Modules/LockScreen/LockScreen.qml @@ -49,8 +49,6 @@ Loader { locked: lockScreen.active WlSessionLockSurface { - readonly property real scaling: ScalingService.dynamicScale(screen) - Item { id: batteryIndicator property var battery: UPower.displayDevice @@ -103,8 +101,8 @@ Loader { visible: Settings.data.general.showScreenCorners property color cornerColor: Settings.data.general.forceBlackScreenCorners ? Qt.rgba(0, 0, 0, 1) : Qt.alpha(Color.mSurface, Settings.data.bar.backgroundOpacity) - property real cornerRadius: Style.screenRadius * scaling - property real cornerSize: Style.screenRadius * scaling + property real cornerRadius: Style.screenRadius + property real cornerSize: Style.screenRadius // Top-left concave corner Canvas { @@ -248,12 +246,12 @@ Loader { // Time, Date, and User Profile Container Rectangle { - width: Math.max(500 * scaling, contentRow.implicitWidth + 24 * scaling) - height: 120 * scaling + width: Math.max(500, contentRow.implicitWidth + 24) + height: 120 anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top - anchors.topMargin: 100 * scaling - radius: Style.radiusL * scaling + anchors.topMargin: 100 + radius: Style.radiusL color: Color.mSurface border.color: Qt.alpha(Color.mOutline, 0.2) border.width: 1 @@ -261,13 +259,13 @@ Loader { RowLayout { id: contentRow anchors.fill: parent - anchors.margins: 12 * scaling - spacing: 8 * scaling + anchors.margins: 12 + spacing: 8 // Left side: Avatar Rectangle { - Layout.preferredWidth: 70 * scaling - Layout.preferredHeight: 70 * scaling + Layout.preferredWidth: 70 + Layout.preferredHeight: 70 Layout.alignment: Qt.AlignVCenter radius: width * 0.5 color: Color.transparent @@ -296,8 +294,8 @@ Loader { NImageCircled { anchors.centerIn: parent - width: 66 * scaling - height: 66 * scaling + width: 66 + height: 66 imagePath: Settings.data.general.avatarImage fallbackIcon: "person" @@ -320,12 +318,12 @@ Loader { // Center: User Info Column (left-aligned text) ColumnLayout { Layout.alignment: Qt.AlignVCenter - spacing: 2 * scaling + spacing: 2 // Welcome back + Username on one line NText { text: I18n.tr("lock-screen.welcome-back") + " " + Quickshell.env("USER") + "!" - pointSize: Style.fontSizeXXXL * scaling + pointSize: Style.fontSizeXXXL font.weight: Font.Medium color: Color.mOnSurface horizontalAlignment: Text.AlignLeft @@ -334,22 +332,21 @@ Loader { // Date below NText { text: Qt.locale().toString(Time.date, "dddd, MMMM d") - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL font.weight: Font.Medium color: Color.mOnSurfaceVariant horizontalAlignment: Text.AlignLeft } } - // Spacer to push time to the right Item { Layout.fillWidth: true } Item { - Layout.preferredWidth: 70 * scaling - Layout.preferredHeight: 70 * scaling + Layout.preferredWidth: 70 + Layout.preferredHeight: 70 Layout.alignment: Qt.AlignVCenter // Seconds circular progress @@ -372,21 +369,21 @@ Loader { var ctx = getContext("2d") var centerX = width / 2 var centerY = height / 2 - var radius = Math.min(width, height) / 2 - 3 * scaling + var radius = Math.min(width, height) / 2 - 3 ctx.reset() // Background circle ctx.beginPath() ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI) - ctx.lineWidth = 2.5 * scaling + ctx.lineWidth = 2.5 ctx.strokeStyle = Qt.alpha(Color.mOnSurface, 0.15) ctx.stroke() // Progress arc ctx.beginPath() ctx.arc(centerX, centerY, radius, -Math.PI / 2, -Math.PI / 2 + progress * 2 * Math.PI) - ctx.lineWidth = 2.5 * scaling + ctx.lineWidth = 2.5 ctx.strokeStyle = Color.mPrimary ctx.lineCap = "round" ctx.stroke() @@ -403,7 +400,7 @@ Loader { var t = Settings.data.location.use12hourFormat ? Qt.locale().toString(Time.date, "hh AP") : Qt.locale().toString(Time.date, "HH") return t } - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: Color.mOnSurface horizontalAlignment: Text.AlignHCenter @@ -412,7 +409,7 @@ Loader { NText { text: Qt.formatTime(Time.date, "mm") - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: Color.mOnSurfaceVariant horizontalAlignment: Text.AlignHCenter @@ -425,12 +422,12 @@ Loader { // Error notification Rectangle { - width: 450 * scaling - height: 60 * scaling + width: 450 + height: 60 anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom - anchors.bottomMargin: 300 * scaling - radius: 30 * scaling + anchors.bottomMargin: 300 + radius: 30 color: Color.mError border.color: Color.mError border.width: 1 @@ -439,18 +436,18 @@ Loader { RowLayout { anchors.centerIn: parent - spacing: 10 * scaling + spacing: 10 NIcon { icon: "alert-circle" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: Color.mOnError } NText { text: lockContext.errorMessage || "Authentication failed" color: Color.mOnError - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Font.Medium horizontalAlignment: Text.AlignHCenter } @@ -469,62 +466,62 @@ Loader { width: { var hasBattery = UPower.displayDevice && UPower.displayDevice.ready && UPower.displayDevice.isPresent var hasKeyboard = keyboardLayout.currentLayout !== "Unknown" - + if (hasBattery && hasKeyboard) { - return 200 * scaling + return 200 } else if (hasBattery || hasKeyboard) { - return 120 * scaling + return 120 } else { return 0 } } - height: 40 * scaling + height: 40 anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom - anchors.bottomMargin: 96 * scaling + (Settings.data.general.compactLockScreen ? 116 * scaling : 220 * scaling) - topLeftRadius: Style.radiusL * scaling - topRightRadius: Style.radiusL * scaling + anchors.bottomMargin: 96 + (Settings.data.general.compactLockScreen ? 116 : 220) + topLeftRadius: Style.radiusL + topRightRadius: Style.radiusL color: Color.mSurface visible: Settings.data.general.compactLockScreen && ((UPower.displayDevice && UPower.displayDevice.ready && UPower.displayDevice.isPresent) || keyboardLayout.currentLayout !== "Unknown") RowLayout { anchors.centerIn: parent - spacing: 16 * scaling + spacing: 16 // Battery indicator RowLayout { - spacing: 6 * scaling + spacing: 6 visible: UPower.displayDevice && UPower.displayDevice.ready && UPower.displayDevice.isPresent NIcon { icon: BatteryService.getIcon(Math.round(UPower.displayDevice.percentage * 100), UPower.displayDevice.state === UPowerDeviceState.Charging, true) - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: UPower.displayDevice.state === UPowerDeviceState.Charging ? Color.mPrimary : Color.mOnSurfaceVariant } NText { text: Math.round(UPower.displayDevice.percentage * 100) + "%" color: Color.mOnSurfaceVariant - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Font.Medium } } // Keyboard layout indicator RowLayout { - spacing: 6 * scaling + spacing: 6 visible: keyboardLayout.currentLayout !== "Unknown" NIcon { icon: "keyboard" - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant } NText { text: keyboardLayout.currentLayout color: Color.mOnSurfaceVariant - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Font.Medium } } @@ -533,38 +530,38 @@ Loader { // Bottom container with weather, password input and controls Rectangle { - width: 750 * scaling - height: Settings.data.general.compactLockScreen ? 120 * scaling : 220 * scaling + width: 750 + height: Settings.data.general.compactLockScreen ? 120 : 220 anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom - anchors.bottomMargin: 100 * scaling - radius: Style.radiusL * scaling + anchors.bottomMargin: 100 + radius: Style.radiusL color: Color.mSurface ColumnLayout { anchors.fill: parent - anchors.margins: 14 * scaling - spacing: 14 * scaling + anchors.margins: 14 + spacing: 14 // Weather section RowLayout { Layout.fillWidth: true - Layout.preferredHeight: 65 * scaling - spacing: 18 * scaling + Layout.preferredHeight: 65 + spacing: 18 visible: !Settings.data.general.compactLockScreen && LocationService.coordinatesReady && LocationService.data.weather !== null // Media widget with visualizer Rectangle { - Layout.preferredWidth: 220 * scaling - Layout.preferredHeight: 50 * scaling - radius: 25 * scaling + Layout.preferredWidth: 220 + Layout.preferredHeight: 50 + radius: 25 color: Color.transparent clip: true visible: MediaService.currentPlayer && MediaService.canPlay Loader { anchors.fill: parent - anchors.margins: 4 * scaling + anchors.margins: 4 active: Settings.data.audio.visualizerType === "linear" z: 0 sourceComponent: LinearSpectrum { @@ -577,7 +574,7 @@ Loader { Loader { anchors.fill: parent - anchors.margins: 4 * scaling + anchors.margins: 4 active: Settings.data.audio.visualizerType === "mirrored" z: 0 sourceComponent: MirroredSpectrum { @@ -590,7 +587,7 @@ Loader { Loader { anchors.fill: parent - anchors.margins: 4 * scaling + anchors.margins: 4 active: Settings.data.audio.visualizerType === "wave" z: 0 sourceComponent: WaveSpectrum { @@ -603,35 +600,35 @@ Loader { RowLayout { anchors.fill: parent - anchors.margins: 8 * scaling - spacing: 8 * scaling + anchors.margins: 8 + spacing: 8 z: 1 Rectangle { - Layout.preferredWidth: 34 * scaling - Layout.preferredHeight: 34 * scaling + Layout.preferredWidth: 34 + Layout.preferredHeight: 34 radius: width * 0.5 color: Color.transparent clip: true NImageCircled { anchors.fill: parent - anchors.margins: 2 * scaling + anchors.margins: 2 imagePath: MediaService.trackArtUrl fallbackIcon: "disc" - fallbackIconSize: Style.fontSizeM * scaling + fallbackIconSize: Style.fontSizeM borderColor: Color.mOutline - borderWidth: Math.max(1, Style.borderS * scaling) + borderWidth: Math.max(1, Style.borderS) } } ColumnLayout { Layout.fillWidth: true - spacing: 2 * scaling + spacing: 2 NText { text: MediaService.trackTitle || "No media" - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightMedium color: Color.mOnSurface Layout.fillWidth: true @@ -640,7 +637,7 @@ Loader { NText { text: MediaService.trackArtist || "" - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant Layout.fillWidth: true elide: Text.ElideRight @@ -652,46 +649,46 @@ Loader { Rectangle { Layout.preferredWidth: 1 Layout.fillHeight: true - Layout.rightMargin: 4 * scaling + Layout.rightMargin: 4 color: Qt.alpha(Color.mOutline, 0.3) visible: MediaService.currentPlayer && MediaService.canPlay } Item { - Layout.preferredWidth: Style.marginM * scaling + Layout.preferredWidth: Style.marginM visible: !(MediaService.currentPlayer && MediaService.canPlay) } // Current weather RowLayout { - Layout.preferredWidth: 180 * scaling - spacing: 8 * scaling + Layout.preferredWidth: 180 + spacing: 8 NIcon { Layout.alignment: Qt.AlignVCenter icon: LocationService.weatherSymbolFromCode(LocationService.data.weather.current_weather.weathercode) - pointSize: Style.fontSizeXXXL * scaling + pointSize: Style.fontSizeXXXL color: Color.mPrimary } ColumnLayout { Layout.fillWidth: true - spacing: 2 * scaling + spacing: 2 RowLayout { Layout.fillWidth: true - spacing: 12 * scaling + spacing: 12 NText { text: Math.round(LocationService.data.weather.current_weather.temperature) + "°" - pointSize: Style.fontSizeXL * scaling + pointSize: Style.fontSizeXL font.weight: Style.fontWeightBold color: Color.mOnSurface } NText { text: LocationService.data.weather.current_weather.windspeed + " km/h" - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant font.weight: Font.Normal } @@ -699,17 +696,17 @@ Loader { RowLayout { Layout.fillWidth: true - spacing: 8 * scaling + spacing: 8 NText { text: Settings.data.location.name.split(",")[0] - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant } NText { text: (LocationService.data.weather.current && LocationService.data.weather.current.relativehumidity_2m) ? LocationService.data.weather.current.relativehumidity_2m + "% humidity" : "" - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant } } @@ -718,19 +715,19 @@ Loader { // 3-day forecast RowLayout { - Layout.preferredWidth: 260 * scaling - Layout.rightMargin: 8 * scaling - spacing: 4 * scaling + Layout.preferredWidth: 260 + Layout.rightMargin: 8 + spacing: 4 Repeater { model: 3 delegate: ColumnLayout { Layout.fillWidth: true - spacing: 3 * scaling + spacing: 3 NText { text: Qt.locale().toString(new Date(LocationService.data.weather.daily.time[index].replace(/-/g, "/")), "ddd") - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant horizontalAlignment: Text.AlignHCenter Layout.fillWidth: true @@ -739,13 +736,13 @@ Loader { NIcon { Layout.alignment: Qt.AlignHCenter icon: LocationService.weatherSymbolFromCode(LocationService.data.weather.daily.weathercode[index]) - pointSize: Style.fontSizeXL * scaling + pointSize: Style.fontSizeXL color: Color.mOnSurfaceVariant } NText { text: Math.round(LocationService.data.weather.daily.temperature_2m_max[index]) + "°/" + Math.round(LocationService.data.weather.daily.temperature_2m_min[index]) + "°" - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightMedium color: Color.mOnSurfaceVariant horizontalAlignment: Text.AlignHCenter @@ -757,78 +754,75 @@ Loader { // Battery and Keyboard Layout (full mode only) RowLayout { - Layout.preferredWidth: 60 * scaling - spacing: 4 * scaling + Layout.preferredWidth: 60 + spacing: 4 // Battery RowLayout { - spacing: 4 * scaling + spacing: 4 visible: UPower.displayDevice && UPower.displayDevice.ready && UPower.displayDevice.isPresent NIcon { icon: BatteryService.getIcon(Math.round(UPower.displayDevice.percentage * 100), UPower.displayDevice.state === UPowerDeviceState.Charging, true) - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: UPower.displayDevice.state === UPowerDeviceState.Charging ? Color.mPrimary : Color.mOnSurfaceVariant } NText { text: Math.round(UPower.displayDevice.percentage * 100) + "%" color: Color.mOnSurfaceVariant - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Font.Medium } } // Keyboard Layout RowLayout { - spacing: 4 * scaling + spacing: 4 visible: keyboardLayout.currentLayout !== "Unknown" NIcon { icon: "keyboard" - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant } NText { text: keyboardLayout.currentLayout color: Color.mOnSurfaceVariant - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Font.Medium } } } - } - // Password input RowLayout { Layout.fillWidth: true spacing: 0 Item { - Layout.preferredWidth: Style.marginM * scaling + Layout.preferredWidth: Style.marginM } - Rectangle { Layout.fillWidth: true - Layout.preferredHeight: 48 * scaling - radius: 24 * scaling + Layout.preferredHeight: 48 + radius: 24 color: Color.mSurface border.color: passwordInput.activeFocus ? Color.mPrimary : Qt.alpha(Color.mOutline, 0.3) border.width: passwordInput.activeFocus ? 2 : 1 Row { anchors.left: parent.left - anchors.leftMargin: 18 * scaling + anchors.leftMargin: 18 anchors.verticalCenter: parent.verticalCenter - spacing: 14 * scaling + spacing: 14 NIcon { icon: "lock" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: passwordInput.activeFocus ? Color.mPrimary : Color.mOnSurfaceVariant anchors.verticalCenter: parent.verticalCenter } @@ -840,7 +834,7 @@ Loader { height: 0 visible: false enabled: !lockContext.unlockInProgress - font.pointSize: Style.fontSizeM * scaling + font.pointSize: Style.fontSizeM color: Color.mPrimary echoMode: TextInput.Password passwordCharacter: "•" @@ -861,8 +855,8 @@ Loader { spacing: 0 Rectangle { - width: 2 * scaling - height: 20 * scaling + width: 2 + height: 20 color: Color.mPrimary visible: passwordInput.activeFocus && passwordInput.text.length === 0 anchors.verticalCenter: parent.verticalCenter @@ -882,7 +876,7 @@ Loader { } Row { - spacing: 6 * scaling + spacing: 6 visible: passwordInput.text.length > 0 anchors.verticalCenter: parent.verticalCenter @@ -891,7 +885,7 @@ Loader { NIcon { icon: "circle-filled" - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: Color.mPrimary opacity: 1.0 } @@ -899,8 +893,8 @@ Loader { } Rectangle { - width: 2 * scaling - height: 20 * scaling + width: 2 + height: 20 color: Color.mPrimary visible: passwordInput.activeFocus && passwordInput.text.length > 0 anchors.verticalCenter: parent.verticalCenter @@ -923,10 +917,10 @@ Loader { Rectangle { anchors.right: parent.right - anchors.rightMargin: 8 * scaling + anchors.rightMargin: 8 anchors.verticalCenter: parent.verticalCenter - width: 36 * scaling - height: 36 * scaling + width: 36 + height: 36 radius: width * 0.5 color: submitButtonArea.containsMouse ? Color.mPrimary : Qt.alpha(Color.mPrimary, 0.8) border.color: Color.mPrimary @@ -936,7 +930,7 @@ Loader { NIcon { anchors.centerIn: parent icon: "arrow-forward" - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnPrimary } @@ -956,42 +950,41 @@ Loader { } } - Item { - Layout.preferredWidth: Style.marginM * scaling + Layout.preferredWidth: Style.marginM } } // System control buttons RowLayout { Layout.fillWidth: true - Layout.preferredHeight: 48 * scaling - spacing: 10 * scaling + Layout.preferredHeight: 48 + spacing: 10 Item { - Layout.preferredWidth: Style.marginM * scaling + Layout.preferredWidth: Style.marginM } Rectangle { Layout.fillWidth: true - Layout.preferredHeight: 48 * scaling - radius: 24 * scaling + Layout.preferredHeight: 48 + radius: 24 color: logoutButtonArea.containsMouse ? Color.mTertiary : "transparent" RowLayout { anchors.centerIn: parent - spacing: 6 * scaling + spacing: 6 NIcon { icon: "logout" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: logoutButtonArea.containsMouse ? Color.mOnTertiary : Color.mOnSurfaceVariant } NText { text: I18n.tr("session-menu.logout") color: logoutButtonArea.containsMouse ? Color.mOnTertiary : Color.mOnSurfaceVariant - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Font.Medium } } @@ -1013,24 +1006,24 @@ Loader { Rectangle { Layout.fillWidth: true - Layout.preferredHeight: 48 * scaling - radius: 24 * scaling + Layout.preferredHeight: 48 + radius: 24 color: rebootButtonArea.containsMouse ? Color.mTertiary : "transparent" RowLayout { anchors.centerIn: parent - spacing: 6 * scaling + spacing: 6 NIcon { icon: "reboot" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: rebootButtonArea.containsMouse ? Color.mOnTertiary : Color.mOnSurfaceVariant } NText { text: I18n.tr("session-menu.reboot") color: rebootButtonArea.containsMouse ? Color.mOnTertiary : Color.mOnSurfaceVariant - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Font.Medium } } @@ -1052,26 +1045,26 @@ Loader { Rectangle { Layout.fillWidth: true - Layout.preferredHeight: 48 * scaling - radius: 24 * scaling + Layout.preferredHeight: 48 + radius: 24 color: shutdownButtonArea.containsMouse ? Color.mError : "transparent" border.color: shutdownButtonArea.containsMouse ? Color.mError : Color.transparent border.width: 1 RowLayout { anchors.centerIn: parent - spacing: 6 * scaling + spacing: 6 NIcon { icon: "shutdown" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: shutdownButtonArea.containsMouse ? Color.mOnError : Color.mOnSurfaceVariant } NText { text: I18n.tr("session-menu.shutdown") color: shutdownButtonArea.containsMouse ? Color.mOnError : Color.mOnSurfaceVariant - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Font.Medium } } @@ -1099,7 +1092,7 @@ Loader { } Item { - Layout.preferredWidth: Style.marginM * scaling + Layout.preferredWidth: Style.marginM } } } diff --git a/Modules/Notification/Notification.qml b/Modules/Notification/Notification.qml index b6dd8672a..fc9831f43 100644 --- a/Modules/Notification/Notification.qml +++ b/Modules/Notification/Notification.qml @@ -17,7 +17,6 @@ Variants { id: root required property ShellScreen modelData - property real scaling: ScalingService.getScreenScale(modelData) // Access the notification model from the service property ListModel notificationModel: NotificationService.activeList @@ -42,15 +41,6 @@ Variants { } } - Connections { - target: ScalingService - function onScaleChanged(screenName, scale) { - if (root.modelData && screenName === root.modelData.name) { - root.scaling = scale - } - } - } - sourceComponent: PanelWindow { screen: modelData @@ -79,10 +69,10 @@ Variants { margins.top: { if (!(anchors.top)) return 0 - var base = Style.marginM * scaling + var base = Style.marginM if (Settings.data.bar.position === "top") { - var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0 - return (Style.barHeight * scaling) + base + floatExtraV + var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL : 0 + return (Style.barHeight) + base + floatExtraV } return base } @@ -90,10 +80,10 @@ Variants { margins.bottom: { if (!(anchors.bottom)) return 0 - var base = Style.marginM * scaling + var base = Style.marginM if (Settings.data.bar.position === "bottom") { - var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0 - return (Style.barHeight * scaling) + base + floatExtraV + var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL : 0 + return (Style.barHeight) + base + floatExtraV } return base } @@ -101,10 +91,10 @@ Variants { margins.left: { if (!(anchors.left)) return 0 - var base = Style.marginM * scaling + var base = Style.marginM if (Settings.data.bar.position === "left") { - var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0 - return (Style.barHeight * scaling) + base + floatExtraH + var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL : 0 + return (Style.barHeight) + base + floatExtraH } return base } @@ -112,15 +102,15 @@ Variants { margins.right: { if (!(anchors.right)) return 0 - var base = Style.marginM * scaling + var base = Style.marginM if (Settings.data.bar.position === "right") { - var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0 - return (Style.barHeight * scaling) + base + floatExtraH + var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL : 0 + return (Style.barHeight) + base + floatExtraH } return base } - implicitWidth: 360 * scaling + implicitWidth: 360 implicitHeight: notificationStack.implicitHeight WlrLayershell.exclusionMode: ExclusionMode.Ignore @@ -165,8 +155,8 @@ Variants { anchors.left: parent.isLeft ? parent.left : undefined anchors.right: parent.isRight ? parent.right : undefined anchors.horizontalCenter: parent.isCentered ? parent.horizontalCenter : undefined - spacing: Style.marginS * scaling - width: 360 * scaling + spacing: Style.marginS + width: 360 visible: true // Multiple notifications display @@ -178,15 +168,14 @@ Variants { // Store the notification ID and data for reference property string notificationId: model.id property var notificationData: model - property real cardScaling: root.scaling - Layout.preferredWidth: 360 * cardScaling - Layout.preferredHeight: notificationLayout.implicitHeight + (Style.marginL * 2 * cardScaling) + Layout.preferredWidth: 360 + Layout.preferredHeight: notificationLayout.implicitHeight + (Style.marginL * 2) Layout.maximumHeight: Layout.preferredHeight - radius: Style.radiusL * cardScaling + radius: Style.radiusL border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * cardScaling) + border.width: Math.max(1, Style.borderS) color: Color.mSurface // Optimized progress bar container @@ -195,7 +184,7 @@ Variants { anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - height: 2 * cardScaling + height: 2 color: Color.transparent // Pre-calculate available width for the progress bar @@ -311,28 +300,28 @@ Variants { ColumnLayout { id: notificationLayout anchors.fill: parent - anchors.margins: Style.marginM * cardScaling - anchors.rightMargin: (Style.marginM + 32) * cardScaling // Leave space for close button - spacing: Style.marginM * cardScaling + anchors.margins: Style.marginM + anchors.rightMargin: (Style.marginM + 32) // Leave space for close button + spacing: Style.marginM // Main content section RowLayout { Layout.fillWidth: true - spacing: Style.marginM * cardScaling + spacing: Style.marginM ColumnLayout { // For real-time notification always show the original image // as the cached version is most likely still processing. NImageCircled { - Layout.preferredWidth: 40 * cardScaling - Layout.preferredHeight: 40 * cardScaling + Layout.preferredWidth: 40 + Layout.preferredHeight: 40 Layout.alignment: Qt.AlignTop - Layout.topMargin: 30 * cardScaling + Layout.topMargin: 30 imagePath: model.originalImage || "" borderColor: Color.transparent borderWidth: 0 fallbackIcon: "bell" - fallbackIconSize: 24 * cardScaling + fallbackIconSize: 24 } Item { Layout.fillHeight: true @@ -342,17 +331,17 @@ Variants { // Text content ColumnLayout { Layout.fillWidth: true - spacing: Style.marginS * cardScaling + spacing: Style.marginS // Header section with app name and timestamp RowLayout { Layout.fillWidth: true - spacing: Style.marginS * cardScaling + spacing: Style.marginS Rectangle { - Layout.preferredWidth: 6 * cardScaling - Layout.preferredHeight: 6 * cardScaling - radius: Style.radiusXS * cardScaling + Layout.preferredWidth: 6 + Layout.preferredHeight: 6 + radius: Style.radiusXS color: { if (model.urgency === NotificationUrgency.Critical || model.urgency === 2) return Color.mError @@ -367,7 +356,7 @@ Variants { NText { text: `${model.appName || I18n.tr("system.unknown-app")} · ${Time.formatRelativeTime(model.timestamp)}` color: Color.mSecondary - pointSize: Style.fontSizeXS * cardScaling + pointSize: Style.fontSizeXS } Item { @@ -377,7 +366,7 @@ Variants { NText { text: model.summary || I18n.tr("general.no-summary") - pointSize: Style.fontSizeL * cardScaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightMedium color: Color.mOnSurface textFormat: Text.PlainText @@ -390,7 +379,7 @@ Variants { NText { text: model.body || "" - pointSize: Style.fontSizeM * cardScaling + pointSize: Style.fontSizeM color: Color.mOnSurface textFormat: Text.PlainText wrapMode: Text.WrapAtWordBoundaryOrAnywhere @@ -403,8 +392,8 @@ Variants { // Notification actions Flow { Layout.fillWidth: true - spacing: Style.marginS * cardScaling - Layout.topMargin: Style.marginM * cardScaling + spacing: Style.marginS + Layout.topMargin: Style.marginM flow: Flow.LeftToRight layoutDirection: Qt.LeftToRight @@ -436,12 +425,12 @@ Variants { } return actionText } - fontSize: Style.fontSizeS * cardScaling + fontSize: Style.fontSizeS backgroundColor: Color.mPrimary textColor: hovered ? Color.mOnTertiary : Color.mOnPrimary hoverColor: Color.mTertiary outlined: false - implicitHeight: 24 * cardScaling + implicitHeight: 24 onClicked: { NotificationService.invokeAction(parent.parentNotificationId, actionData.identifier) } @@ -458,9 +447,9 @@ Variants { tooltipText: I18n.tr("tooltips.close") baseSize: Style.baseWidgetSize * 0.6 anchors.top: parent.top - anchors.topMargin: Style.marginM * cardScaling + anchors.topMargin: Style.marginM anchors.right: parent.right - anchors.rightMargin: Style.marginM * cardScaling + anchors.rightMargin: Style.marginM onClicked: { animateOut() diff --git a/Modules/Notification/NotificationHistoryPanel.qml b/Modules/Notification/NotificationHistoryPanel.qml index bd830f215..4615b3a65 100644 --- a/Modules/Notification/NotificationHistoryPanel.qml +++ b/Modules/Notification/NotificationHistoryPanel.qml @@ -26,23 +26,23 @@ NPanel { ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginL * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginL + spacing: Style.marginM // Header section RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NIcon { icon: "bell" - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL color: Color.mPrimary } NText { text: I18n.tr("notifications.panel.title") - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: Color.mOnSurface Layout.fillWidth: true @@ -84,7 +84,7 @@ NPanel { Layout.fillHeight: true Layout.alignment: Qt.AlignHCenter visible: NotificationService.historyList.count === 0 - spacing: Style.marginL * scaling + spacing: Style.marginL Item { Layout.fillHeight: true @@ -92,21 +92,21 @@ NPanel { NIcon { icon: "bell-off" - pointSize: 64 * scaling + pointSize: 64 color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } NText { text: I18n.tr("notifications.panel.no-notifications") - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } NText { text: I18n.tr("notifications.panel.description") - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true @@ -128,7 +128,7 @@ NPanel { verticalPolicy: ScrollBar.AsNeeded model: NotificationService.historyList - spacing: Style.marginM * scaling + spacing: Style.marginM clip: true boundsBehavior: Flickable.StopAtBounds visible: NotificationService.historyList.count > 0 @@ -141,11 +141,11 @@ NPanel { property bool isExpanded: notificationList.expandedId === notificationId width: notificationList.width - height: notificationLayout.implicitHeight + (Style.marginM * scaling * 2) - radius: Style.radiusM * scaling + height: notificationLayout.implicitHeight + (Style.marginM * 2) + radius: Style.radiusM color: Color.mSurfaceVariant border.color: Qt.alpha(Color.mOutline, Style.opacityMedium) - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) Behavior on height { NumberAnimation { @@ -165,7 +165,7 @@ NPanel { MouseArea { anchors.fill: parent // Don't capture clicks on the delete button - anchors.rightMargin: 48 * scaling + anchors.rightMargin: 48 enabled: (summaryText.truncated || bodyText.truncated) onClicked: { if (notificationList.expandedId === notificationId) { @@ -180,20 +180,20 @@ NPanel { RowLayout { id: notificationLayout anchors.fill: parent - anchors.margins: Style.marginM * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginM + spacing: Style.marginM ColumnLayout { NImageCircled { - Layout.preferredWidth: 40 * scaling - Layout.preferredHeight: 40 * scaling + Layout.preferredWidth: 40 + Layout.preferredHeight: 40 Layout.alignment: Qt.AlignTop - Layout.topMargin: 20 * scaling + Layout.topMargin: 20 imagePath: model.cachedImage || model.originalImage || "" borderColor: Color.transparent borderWidth: 0 fallbackIcon: "bell" - fallbackIconSize: 24 * scaling + fallbackIconSize: 24 } Item { Layout.fillHeight: true @@ -204,20 +204,20 @@ NPanel { ColumnLayout { Layout.fillWidth: true Layout.alignment: Qt.AlignTop - spacing: Style.marginXS * scaling - Layout.rightMargin: -(Style.marginM + Style.baseWidgetSize * 0.6) * scaling + spacing: Style.marginXS + Layout.rightMargin: -(Style.marginM + Style.baseWidgetSize * 0.6) // Header row with app name and timestamp RowLayout { Layout.fillWidth: true - spacing: Style.marginS * scaling + spacing: Style.marginS // Urgency indicator Rectangle { - Layout.preferredWidth: 6 * scaling - Layout.preferredHeight: 6 * scaling + Layout.preferredWidth: 6 + Layout.preferredHeight: 6 Layout.alignment: Qt.AlignVCenter - radius: 3 * scaling + radius: 3 visible: model.urgency !== 1 color: { if (model.urgency === 2) @@ -231,13 +231,13 @@ NPanel { NText { text: model.appName || "Unknown App" - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mSecondary } NText { text: Time.formatRelativeTime(model.timestamp) - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mSecondary } @@ -250,7 +250,7 @@ NPanel { NText { id: summaryText text: model.summary || I18n.tr("general.no-summary") - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Font.Medium color: Color.mOnSurface textFormat: Text.PlainText @@ -264,7 +264,7 @@ NPanel { NText { id: bodyText text: model.body || "" - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: Color.mOnSurfaceVariant textFormat: Text.PlainText wrapMode: Text.Wrap @@ -277,14 +277,14 @@ NPanel { // Spacer for expand indicator Item { Layout.fillWidth: true - Layout.preferredHeight: (!isExpanded && (summaryText.truncated || bodyText.truncated)) ? (Style.marginS * scaling) : 0 + Layout.preferredHeight: (!isExpanded && (summaryText.truncated || bodyText.truncated)) ? (Style.marginS) : 0 } // Expand indicator RowLayout { Layout.fillWidth: true visible: !isExpanded && (summaryText.truncated || bodyText.truncated) - spacing: Style.marginXS * scaling + spacing: Style.marginXS Item { Layout.fillWidth: true @@ -292,14 +292,14 @@ NPanel { NText { text: I18n.tr("notifications.panel.click-to-expand") || "Click to expand" - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mPrimary font.weight: Font.Medium } NIcon { icon: "chevron-down" - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: Color.mPrimary } } diff --git a/Modules/OSD/OSD.qml b/Modules/OSD/OSD.qml index 873933baa..bcb3bba94 100644 --- a/Modules/OSD/OSD.qml +++ b/Modules/OSD/OSD.qml @@ -16,7 +16,6 @@ Variants { id: root required property ShellScreen modelData - property real scaling: ScalingService.getScreenScale(modelData) // Access the notification model from the service property ListModel notificationModel: NotificationService.activeList @@ -119,9 +118,6 @@ Variants { id: panel screen: modelData - // PanelWindow scaling - property real scaling: ScalingService.getScreenScale(screen) - readonly property string location: (Settings.data.osd && Settings.data.osd.location) ? Settings.data.osd.location : "top_right" readonly property bool isTop: (location === "top") || (location.length >= 3 && location.substring(0, 3) === "top") readonly property bool isBottom: (location === "bottom") || (location.length >= 6 && location.substring(0, 6) === "bottom") @@ -129,28 +125,21 @@ Variants { readonly property bool isRight: (location.indexOf("_right") >= 0) || (location === "right") readonly property bool isCentered: (location === "top" || location === "bottom") readonly property bool verticalMode: (location === "left" || location === "right") - readonly property int hWidth: Math.round(320 * scaling) - readonly property int hHeight: Math.round(64 * scaling) - readonly property int vHeight: Math.round(320 * scaling) // Vertical OSD height (matches horizontal width) + readonly property int hWidth: Math.round(320) + readonly property int hHeight: Math.round(64) + readonly property int vHeight: Math.round(320) // Vertical OSD height (matches horizontal width) // Ensure an even width to keep the vertical bar perfectly centered readonly property int barThickness: (function () { - const base = Math.max(8, Math.round(8 * scaling)) + const base = Math.max(8, Math.round(8)) return (base % 2 === 0) ? base : base + 1 })() Component.onCompleted: { - } - Connections { - target: ScalingService - function onScaleChanged(screenName, scale) { - if ((screen !== null) && (screenName === screen.name)) { - scaling = scale - } - } } Component.onDestruction: { + } // Anchor selection based on location (window edges) @@ -163,10 +152,10 @@ Variants { margins.top: { if (!(anchors.top)) return 0 - var base = Style.marginM * scaling + var base = Style.marginM if (Settings.data.bar.position === "top") { - var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0 - return (Style.barHeight * scaling) + base + floatExtraV + var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL : 0 + return (Style.barHeight) + base + floatExtraV } return base } @@ -174,10 +163,10 @@ Variants { margins.bottom: { if (!(anchors.bottom)) return 0 - var base = Style.marginM * scaling + var base = Style.marginM if (Settings.data.bar.position === "bottom") { - var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0 - return (Style.barHeight * scaling) + base + floatExtraV + var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL : 0 + return (Style.barHeight) + base + floatExtraV } return base } @@ -185,10 +174,10 @@ Variants { margins.left: { if (!(anchors.left)) return 0 - var base = Style.marginM * scaling + var base = Style.marginM if (Settings.data.bar.position === "left") { - var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0 - return (Style.barHeight * scaling) + base + floatExtraH + var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL : 0 + return (Style.barHeight) + base + floatExtraH } return base } @@ -196,10 +185,10 @@ Variants { margins.right: { if (!(anchors.right)) return 0 - var base = Style.marginM * scaling + var base = Style.marginM if (Settings.data.bar.position === "right") { - var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0 - return (Style.barHeight * scaling) + base + floatExtraH + var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL : 0 + return (Style.barHeight) + base + floatExtraH } return base } @@ -217,12 +206,12 @@ Variants { id: osdItem width: parent.width - height: panel.verticalMode ? panel.vHeight : Math.round(64 * scaling) - radius: Style.radiusL * scaling + height: panel.verticalMode ? panel.vHeight : Math.round(64) + radius: Style.radiusL color: Color.mSurface border.color: Color.mOutline border.width: (function () { - const bw = Math.max(2, Math.round(Style.borderM * scaling)) + const bw = Math.max(2, Math.round(Style.borderM)) return (bw % 2 === 0) ? bw : bw + 1 })() visible: false @@ -282,13 +271,13 @@ Variants { anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - anchors.margins: Style.marginM * root.scaling - spacing: Style.marginM * root.scaling + anchors.margins: Style.marginM + spacing: Style.marginM NIcon { icon: root.getIcon() color: root.getIconColor() - pointSize: Style.fontSizeXL * scaling + pointSize: Style.fontSizeXL Layout.alignment: Qt.AlignVCenter Behavior on color { @@ -301,7 +290,7 @@ Variants { // Progress bar with calculated width Rectangle { - Layout.preferredWidth: Math.round(220 * root.scaling) + Layout.preferredWidth: Math.round(220) height: panel.barThickness radius: Math.round(panel.barThickness / 2) color: Color.mSurfaceVariant @@ -334,12 +323,12 @@ Variants { NText { text: root.getDisplayPercentage() color: Color.mOnSurface - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS family: Settings.data.ui.fontFixed Layout.alignment: Qt.AlignVCenter horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - Layout.preferredWidth: Math.round(50 * root.scaling) + Layout.preferredWidth: Math.round(50) } } } @@ -350,18 +339,18 @@ Variants { ColumnLayout { // Ensure inner padding respects the rounded corners; avoid clipping the icon/text property int vMargin: (function () { - const styleMargin = Math.round(Style.marginL * scaling) + const styleMargin = Math.round(Style.marginL) const cornerGuard = Math.round(osdItem.radius) return Math.max(styleMargin, cornerGuard) })() - property int vMarginTop: Math.max(Math.round(osdItem.radius), Math.round(Style.marginS * scaling)) - property int balanceDelta: Math.round(Style.marginS * scaling) + property int vMarginTop: Math.max(Math.round(osdItem.radius), Math.round(Style.marginS)) + property int balanceDelta: Math.round(Style.marginS) anchors.fill: parent anchors.topMargin: vMargin anchors.leftMargin: vMargin anchors.rightMargin: vMargin anchors.bottomMargin: vMargin - spacing: Math.round(Style.marginS * scaling) + spacing: Math.round(Style.marginS) // Percentage text at top Item { @@ -371,7 +360,7 @@ Variants { id: percentText text: root.getDisplayPercentage() color: Color.mOnSurface - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS family: Settings.data.ui.fontFixed anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter @@ -420,7 +409,7 @@ Variants { NIcon { icon: root.getIcon() color: root.getIconColor() - pointSize: Style.fontSizeXL * scaling + pointSize: Style.fontSizeXL Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom Behavior on color { ColorAnimation { @@ -548,12 +537,12 @@ Variants { function onBrightnessChanged(newBrightness) { root.lastUpdatedBrightness = newBrightness - + if (!brightnessInitialized) { brightnessInitialized = true return } - + showOSD("brightness") } diff --git a/Modules/SessionMenu/SessionMenu.qml b/Modules/SessionMenu/SessionMenu.qml index 039c2c985..7bcb8b269 100644 --- a/Modules/SessionMenu/SessionMenu.qml +++ b/Modules/SessionMenu/SessionMenu.qml @@ -259,16 +259,16 @@ NPanel { ColumnLayout { anchors.fill: parent - anchors.topMargin: Style.marginL * scaling - anchors.leftMargin: Style.marginL * scaling - anchors.rightMargin: Style.marginL * scaling - anchors.bottomMargin: Style.marginM * scaling - spacing: Style.marginS * scaling + anchors.topMargin: Style.marginL + anchors.leftMargin: Style.marginL + anchors.rightMargin: Style.marginL + anchors.bottomMargin: Style.marginM + spacing: Style.marginS // Header with title and close button RowLayout { Layout.fillWidth: true - Layout.preferredHeight: Style.baseWidgetSize * 0.8 * scaling + Layout.preferredHeight: Style.baseWidgetSize * 0.8 NText { text: timerActive ? I18n.tr("session-menu.action-in-seconds", { @@ -276,7 +276,7 @@ NPanel { "seconds": Math.ceil(timeRemaining / 1000) }) : I18n.tr("session-menu.title") font.weight: Style.fontWeightBold - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: timerActive ? Color.mPrimary : Color.mOnSurface Layout.alignment: Qt.AlignVCenter verticalAlignment: Text.AlignVCenter @@ -310,7 +310,7 @@ NPanel { // Power options ColumnLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM Repeater { model: powerOptions @@ -345,8 +345,8 @@ NPanel { signal clicked - height: Style.baseWidgetSize * 1.6 * scaling - radius: Style.radiusS * scaling + height: Style.baseWidgetSize * 1.6 + radius: Style.radiusS color: { if (pending) { return Qt.alpha(Color.mPrimary, 0.08) @@ -357,7 +357,7 @@ NPanel { return Color.transparent } - border.width: pending ? Math.max(Style.borderM * scaling) : 0 + border.width: pending ? Math.max(Style.borderM) : 0 border.color: pending ? Color.mPrimary : Color.mOutline Behavior on color { @@ -368,7 +368,7 @@ NPanel { Item { anchors.fill: parent - anchors.margins: Style.marginL * scaling + anchors.margins: Style.marginL // Icon on the left NIcon { @@ -385,8 +385,8 @@ NPanel { return Color.mOnTertiary return Color.mOnSurface } - pointSize: Style.fontSizeXXXL * scaling - width: Style.baseWidgetSize * 0.6 * scaling + pointSize: Style.fontSizeXXXL + width: Style.baseWidgetSize * 0.6 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter @@ -402,14 +402,14 @@ NPanel { anchors.left: iconElement.right anchors.right: pendingIndicator.visible ? pendingIndicator.left : parent.right anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: Style.marginXL * scaling - anchors.rightMargin: pendingIndicator.visible ? Style.marginM * scaling : 0 + anchors.leftMargin: Style.marginXL + anchors.rightMargin: pendingIndicator.visible ? Style.marginM : 0 spacing: 0 NText { text: buttonRoot.title font.weight: Style.fontWeightMedium - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: { if (buttonRoot.pending) return Color.mPrimary @@ -434,7 +434,7 @@ NPanel { } return buttonRoot.subtitle } - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: { if (buttonRoot.pending) return Color.mPrimary @@ -455,8 +455,8 @@ NPanel { id: pendingIndicator anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - width: 24 * scaling - height: 24 * scaling + width: 24 + height: 24 radius: width * 0.5 color: Color.mPrimary visible: buttonRoot.pending @@ -464,7 +464,7 @@ NPanel { NText { anchors.centerIn: parent text: Math.ceil(timeRemaining / 1000) - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS font.weight: Style.fontWeightBold color: Color.mOnPrimary } diff --git a/Modules/Settings/Bar/BarWidgetSettingsDialog.qml b/Modules/Settings/Bar/BarWidgetSettingsDialog.qml index 363a7e63a..4b35b7fd4 100644 --- a/Modules/Settings/Bar/BarWidgetSettingsDialog.qml +++ b/Modules/Settings/Bar/BarWidgetSettingsDialog.qml @@ -19,9 +19,9 @@ Popup { x: (parent.width - width) * 0.5 y: (parent.height - height) * 0.5 - width: Math.max(content.implicitWidth + padding * 2, 500 * scaling) + width: Math.max(content.implicitWidth + padding * 2, 500) height: content.implicitHeight + padding * 2 - padding: Style.marginXL * scaling + padding: Style.marginXL modal: true onOpened: { @@ -42,16 +42,16 @@ Popup { id: bgRect color: Color.mSurface - radius: Style.radiusL * scaling + radius: Style.radiusL border.color: Color.mPrimary - border.width: Math.max(1, Style.borderM * scaling) + border.width: Math.max(1, Style.borderM) } contentItem: ColumnLayout { id: content width: parent.width - spacing: Style.marginM * scaling + spacing: Style.marginM // Title RowLayout { @@ -61,7 +61,7 @@ Popup { text: I18n.tr("system.widget-settings-title", { "widget": widgetSettings.widgetId }) - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: Color.mPrimary Layout.fillWidth: true @@ -91,8 +91,8 @@ Popup { // Action buttons RowLayout { Layout.fillWidth: true - Layout.topMargin: Style.marginM * scaling - spacing: Style.marginM * scaling + Layout.topMargin: Style.marginM + spacing: Style.marginM Item { Layout.fillWidth: true diff --git a/Modules/Settings/Bar/WidgetSettings/ActiveWindowSettings.qml b/Modules/Settings/Bar/WidgetSettings/ActiveWindowSettings.qml index 3d1be163f..d5321f2cb 100644 --- a/Modules/Settings/Bar/WidgetSettings/ActiveWindowSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/ActiveWindowSettings.qml @@ -7,7 +7,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null @@ -68,6 +68,6 @@ ColumnLayout { }] currentKey: valueScrollingMode onSelected: key => valueScrollingMode = key - minimumWidth: 200 * scaling + minimumWidth: 200 } } diff --git a/Modules/Settings/Bar/WidgetSettings/BatterySettings.qml b/Modules/Settings/Bar/WidgetSettings/BatterySettings.qml index addf7ff8a..8377958d9 100644 --- a/Modules/Settings/Bar/WidgetSettings/BatterySettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/BatterySettings.qml @@ -7,7 +7,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null @@ -27,7 +27,7 @@ ColumnLayout { NComboBox { label: I18n.tr("bar.widget-settings.battery.display-mode.label") description: I18n.tr("bar.widget-settings.battery.display-mode.description") - minimumWidth: 134 * scaling + minimumWidth: 134 model: [{ "key": "onhover", "name": I18n.tr("options.display-mode.on-hover") diff --git a/Modules/Settings/Bar/WidgetSettings/BrightnessSettings.qml b/Modules/Settings/Bar/WidgetSettings/BrightnessSettings.qml index c21d7aaef..bc572776a 100644 --- a/Modules/Settings/Bar/WidgetSettings/BrightnessSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/BrightnessSettings.qml @@ -7,7 +7,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null @@ -25,7 +25,7 @@ ColumnLayout { NComboBox { label: I18n.tr("bar.widget-settings.brightness.display-mode.label") description: I18n.tr("bar.widget-settings.brightness.display-mode.description") - minimumWidth: 134 * scaling + minimumWidth: 134 model: [{ "key": "onhover", "name": I18n.tr("options.display-mode.on-hover") diff --git a/Modules/Settings/Bar/WidgetSettings/ClockSettings.qml b/Modules/Settings/Bar/WidgetSettings/ClockSettings.qml index d76c8d481..9729ccce3 100644 --- a/Modules/Settings/Bar/WidgetSettings/ClockSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/ClockSettings.qml @@ -7,8 +7,8 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling - width: 700 * scaling + spacing: Style.marginM + width: 700 // Properties to receive data from parent property var widgetData: null @@ -89,8 +89,8 @@ ColumnLayout { currentKey: valueCustomFont placeholder: I18n.tr("bar.widget-settings.clock.custom-font.placeholder") searchPlaceholder: I18n.tr("bar.widget-settings.clock.custom-font.search-placeholder") - popupHeight: 420 * scaling - minimumWidth: 300 * scaling + popupHeight: 420 + minimumWidth: 300 onSelected: function (key) { valueCustomFont = key } @@ -108,12 +108,12 @@ ColumnLayout { RowLayout { id: main - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter | Qt.AlignTop ColumnLayout { - spacing: Style.marginM * scaling + spacing: Style.marginM Layout.fillWidth: true Layout.preferredWidth: 1 // Equal sizing hint @@ -175,13 +175,13 @@ ColumnLayout { } Rectangle { - Layout.preferredWidth: 320 * scaling - Layout.preferredHeight: 160 * scaling // Fixed height instead of fillHeight + Layout.preferredWidth: 320 + Layout.preferredHeight: 160 // Fixed height instead of fillHeight color: Color.mSurfaceVariant - radius: Style.radiusM * scaling + radius: Style.radiusM border.color: Color.mSecondary - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) Behavior on border.color { ColorAnimation { @@ -190,22 +190,22 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginM * scaling + spacing: Style.marginM anchors.centerIn: parent ColumnLayout { - spacing: -2 * scaling + spacing: -2 Layout.alignment: Qt.AlignHCenter // Horizontal Repeater { - Layout.topMargin: Style.marginM * scaling + Layout.topMargin: Style.marginM model: Qt.locale().toString(now, valueFormatHorizontal.trim()).split("\\n") delegate: NText { visible: text !== "" text: modelData family: valueUseCustomFont && valueCustomFont ? valueCustomFont : Settings.data.ui.fontDefault - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightBold color: valueUsePrimaryColor ? Color.mPrimary : Color.mOnSurface wrapMode: Text.WordWrap @@ -226,17 +226,17 @@ ColumnLayout { // Vertical ColumnLayout { - spacing: -2 * scaling + spacing: -2 Layout.alignment: Qt.AlignHCenter Repeater { - Layout.topMargin: Style.marginM * scaling + Layout.topMargin: Style.marginM model: Qt.locale().toString(now, valueFormatVertical.trim()).split(" ") delegate: NText { visible: text !== "" text: modelData family: valueUseCustomFont && valueCustomFont ? valueCustomFont : Settings.data.ui.fontDefault - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightBold color: valueUsePrimaryColor ? Color.mPrimary : Color.mOnSurface wrapMode: Text.WordWrap @@ -256,13 +256,13 @@ ColumnLayout { } NDivider { - Layout.topMargin: Style.marginM * scaling - Layout.bottomMargin: Style.marginM * scaling + Layout.topMargin: Style.marginM + Layout.bottomMargin: Style.marginM } NDateTimeTokens { Layout.fillWidth: true - height: 200 * scaling + height: 200 // Connect to token clicked signal if NDateTimeTokens provides it onTokenClicked: token => root.insertToken(token) diff --git a/Modules/Settings/Bar/WidgetSettings/ControlCenterSettings.qml b/Modules/Settings/Bar/WidgetSettings/ControlCenterSettings.qml index ac4ae04ca..07076949d 100644 --- a/Modules/Settings/Bar/WidgetSettings/ControlCenterSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/ControlCenterSettings.qml @@ -8,7 +8,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null @@ -41,7 +41,7 @@ ColumnLayout { } RowLayout { - spacing: Style.marginM * scaling + spacing: Style.marginM NLabel { label: I18n.tr("bar.widget-settings.control-center.icon.label") @@ -52,20 +52,20 @@ ColumnLayout { Layout.alignment: Qt.AlignVCenter imagePath: valueCustomIconPath visible: valueCustomIconPath !== "" - width: Style.fontSizeXL * 2 * scaling - height: Style.fontSizeXL * 2 * scaling + width: Style.fontSizeXL * 2 + height: Style.fontSizeXL * 2 } NIcon { Layout.alignment: Qt.AlignVCenter icon: valueIcon - pointSize: Style.fontSizeXXL * 1.5 * scaling + pointSize: Style.fontSizeXXL * 1.5 visible: valueIcon !== "" && valueCustomIconPath === "" } } RowLayout { - spacing: Style.marginM * scaling + spacing: Style.marginM NButton { enabled: !valueUseDistroLogo text: I18n.tr("bar.widget-settings.control-center.browse-library") diff --git a/Modules/Settings/Bar/WidgetSettings/CustomButtonSettings.qml b/Modules/Settings/Bar/WidgetSettings/CustomButtonSettings.qml index 0520740fc..c3a6aefe5 100644 --- a/Modules/Settings/Bar/WidgetSettings/CustomButtonSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/CustomButtonSettings.qml @@ -8,7 +8,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM property var widgetData: null property var widgetMetadata: null @@ -27,7 +27,7 @@ ColumnLayout { } RowLayout { - spacing: Style.marginM * scaling + spacing: Style.marginM NLabel { label: I18n.tr("bar.widget-settings.custom-button.icon.label") @@ -37,7 +37,7 @@ ColumnLayout { NIcon { Layout.alignment: Qt.AlignVCenter icon: valueIcon - pointSize: Style.fontSizeXL * scaling + pointSize: Style.fontSizeXL visible: valueIcon !== "" } diff --git a/Modules/Settings/Bar/WidgetSettings/KeyboardLayoutSettings.qml b/Modules/Settings/Bar/WidgetSettings/KeyboardLayoutSettings.qml index d35510441..86ada35a9 100644 --- a/Modules/Settings/Bar/WidgetSettings/KeyboardLayoutSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/KeyboardLayoutSettings.qml @@ -7,7 +7,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null @@ -25,7 +25,7 @@ ColumnLayout { NComboBox { label: I18n.tr("bar.widget-settings.keyboard-layout.display-mode.label") description: I18n.tr("bar.widget-settings.keyboard-layout.display-mode.description") - minimumWidth: 134 * scaling + minimumWidth: 134 model: [{ "key": "onhover", "name": I18n.tr("options.display-mode.on-hover") diff --git a/Modules/Settings/Bar/WidgetSettings/MediaMiniSettings.qml b/Modules/Settings/Bar/WidgetSettings/MediaMiniSettings.qml index 184a37e50..4f14d91b5 100644 --- a/Modules/Settings/Bar/WidgetSettings/MediaMiniSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/MediaMiniSettings.qml @@ -7,7 +7,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null @@ -68,7 +68,7 @@ ColumnLayout { }] currentKey: valueVisualizerType onSelected: key => valueVisualizerType = key - minimumWidth: 200 * scaling + minimumWidth: 200 } NComboBox { @@ -86,6 +86,6 @@ ColumnLayout { }] currentKey: valueScrollingMode onSelected: key => valueScrollingMode = key - minimumWidth: 200 * scaling + minimumWidth: 200 } } diff --git a/Modules/Settings/Bar/WidgetSettings/MicrophoneSettings.qml b/Modules/Settings/Bar/WidgetSettings/MicrophoneSettings.qml index 5091474d5..e62ac1dae 100644 --- a/Modules/Settings/Bar/WidgetSettings/MicrophoneSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/MicrophoneSettings.qml @@ -7,7 +7,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null @@ -25,7 +25,7 @@ ColumnLayout { NComboBox { label: I18n.tr("bar.widget-settings.microphone.display-mode.label") description: I18n.tr("bar.widget-settings.microphone.display-mode.description") - minimumWidth: 134 * scaling + minimumWidth: 134 model: [{ "key": "onhover", "name": I18n.tr("options.display-mode.on-hover") diff --git a/Modules/Settings/Bar/WidgetSettings/NotificationHistorySettings.qml b/Modules/Settings/Bar/WidgetSettings/NotificationHistorySettings.qml index 4510a605a..61c4e10d5 100644 --- a/Modules/Settings/Bar/WidgetSettings/NotificationHistorySettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/NotificationHistorySettings.qml @@ -7,7 +7,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null diff --git a/Modules/Settings/Bar/WidgetSettings/SpacerSettings.qml b/Modules/Settings/Bar/WidgetSettings/SpacerSettings.qml index 7c6b8b17b..9679c6193 100644 --- a/Modules/Settings/Bar/WidgetSettings/SpacerSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/SpacerSettings.qml @@ -7,7 +7,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null diff --git a/Modules/Settings/Bar/WidgetSettings/SystemMonitorSettings.qml b/Modules/Settings/Bar/WidgetSettings/SystemMonitorSettings.qml index 852ea8d87..8133ab18a 100644 --- a/Modules/Settings/Bar/WidgetSettings/SystemMonitorSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/SystemMonitorSettings.qml @@ -7,7 +7,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null diff --git a/Modules/Settings/Bar/WidgetSettings/TaskbarSettings.qml b/Modules/Settings/Bar/WidgetSettings/TaskbarSettings.qml index c80dd09f0..8f1bdfc14 100644 --- a/Modules/Settings/Bar/WidgetSettings/TaskbarSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/TaskbarSettings.qml @@ -7,7 +7,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null diff --git a/Modules/Settings/Bar/WidgetSettings/TraySettings.qml b/Modules/Settings/Bar/WidgetSettings/TraySettings.qml index 25d08bce7..ca0c42d29 100644 --- a/Modules/Settings/Bar/WidgetSettings/TraySettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/TraySettings.qml @@ -25,11 +25,11 @@ ColumnLayout { } } - spacing: Style.marginM * scaling + spacing: Style.marginM ColumnLayout { Layout.fillWidth: true - spacing: Style.marginS * scaling + spacing: Style.marginS NLabel { label: I18n.tr("settings.bar.tray.blacklist.label") @@ -38,7 +38,7 @@ ColumnLayout { RowLayout { Layout.fillWidth: true - spacing: Style.marginS * scaling + spacing: Style.marginS NTextInput { id: newRuleInput @@ -49,7 +49,7 @@ ColumnLayout { NIconButton { Layout.alignment: Qt.AlignVCenter icon: "add" - baseSize: Style.baseWidgetSize * 0.8 * scaling + baseSize: Style.baseWidgetSize * 0.8 onClicked: { if (newRuleInput.text.length > 0) { var newRule = newRuleInput.text.trim() @@ -76,30 +76,30 @@ ColumnLayout { // List of current blacklist items ListView { Layout.fillWidth: true - Layout.preferredHeight: 150 * scaling - Layout.topMargin: Style.marginL * scaling // Increased top margin + Layout.preferredHeight: 150 + Layout.topMargin: Style.marginL // Increased top margin clip: true model: blacklistModel delegate: Item { width: ListView.width - height: 40 * scaling + height: 40 Rectangle { id: itemBackground anchors.fill: parent - anchors.margins: Style.marginXS * scaling + anchors.margins: Style.marginXS color: Color.transparent // Make background transparent border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) - radius: Style.radiusS * scaling + border.width: Math.max(1, Style.borderS) + radius: Style.radiusS visible: model.rule !== undefined && model.rule !== "" // Only visible if rule exists } Row { anchors.fill: parent - anchors.leftMargin: Style.marginS * scaling - anchors.rightMargin: Style.marginS * scaling - spacing: Style.marginS * scaling + anchors.leftMargin: Style.marginS + anchors.rightMargin: Style.marginS + spacing: Style.marginS NText { text: model.rule @@ -109,10 +109,10 @@ ColumnLayout { } NIconButton { - width: 16 * scaling - height: 16 * scaling + width: 16 + height: 16 icon: "close" - baseSize: 8 * scaling + baseSize: 8 colorBg: Color.mSurfaceVariant colorFg: Color.mOnSurface colorBgHover: Color.mError diff --git a/Modules/Settings/Bar/WidgetSettings/VolumeSettings.qml b/Modules/Settings/Bar/WidgetSettings/VolumeSettings.qml index 2781f4a6c..3b131d383 100644 --- a/Modules/Settings/Bar/WidgetSettings/VolumeSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/VolumeSettings.qml @@ -7,7 +7,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null @@ -25,7 +25,7 @@ ColumnLayout { NComboBox { label: I18n.tr("bar.widget-settings.volume.display-mode.label") description: I18n.tr("bar.widget-settings.volume.display-mode.description") - minimumWidth: 134 * scaling + minimumWidth: 134 model: [{ "key": "onhover", "name": I18n.tr("options.display-mode.on-hover") diff --git a/Modules/Settings/Bar/WidgetSettings/WorkspaceSettings.qml b/Modules/Settings/Bar/WidgetSettings/WorkspaceSettings.qml index b44f16b96..fb63a5931 100644 --- a/Modules/Settings/Bar/WidgetSettings/WorkspaceSettings.qml +++ b/Modules/Settings/Bar/WidgetSettings/WorkspaceSettings.qml @@ -7,7 +7,7 @@ import qs.Services ColumnLayout { id: root - spacing: Style.marginM * scaling + spacing: Style.marginM // Properties to receive data from parent property var widgetData: null @@ -37,7 +37,7 @@ ColumnLayout { }] currentKey: widgetData.labelMode || widgetMetadata.labelMode onSelected: key => labelModeCombo.currentKey = key - minimumWidth: 200 * scaling + minimumWidth: 200 } NToggle { diff --git a/Modules/Settings/Extras/SectionEditor.qml b/Modules/Settings/Extras/SectionEditor.qml index af5a83801..7a20c9acd 100644 --- a/Modules/Settings/Extras/SectionEditor.qml +++ b/Modules/Settings/Extras/SectionEditor.qml @@ -33,14 +33,14 @@ NBox { Layout.minimumHeight: { var widgetCount = widgetModel.length if (widgetCount === 0) - return 140 * scaling + return 140 var availableWidth = parent.width - var avgWidgetWidth = 150 * scaling + var avgWidgetWidth = 150 var widgetsPerRow = Math.max(1, Math.floor(availableWidth / avgWidgetWidth)) var rows = Math.ceil(widgetCount / widgetsPerRow) - return (50 + 20 + (rows * 48) + ((rows - 1) * Style.marginS) + 20) * scaling + return (50 + 20 + (rows * 48) + ((rows - 1) * Style.marginS) + 20) } // Generate widget color from name checksum @@ -66,15 +66,15 @@ NBox { ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginL * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginL + spacing: Style.marginM RowLayout { Layout.fillWidth: true NText { text: sectionName + " Section" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: Color.mOnSurface Layout.alignment: Qt.AlignVCenter @@ -91,8 +91,8 @@ NBox { placeholder: I18n.tr("bar.widget-settings.section-editor.placeholder") searchPlaceholder: I18n.tr("bar.widget-settings.section-editor.search-placeholder") onSelected: key => comboBox.currentKey = key - popupHeight: 340 * scaling - minimumWidth: 200 * scaling + popupHeight: 340 + minimumWidth: 200 Layout.alignment: Qt.AlignVCenter @@ -117,7 +117,7 @@ NBox { enabled: comboBox.currentKey !== "" tooltipText: I18n.tr("tooltips.add-widget") Layout.alignment: Qt.AlignVCenter - Layout.leftMargin: Style.marginS * scaling + Layout.leftMargin: Style.marginS onClicked: { if (comboBox.currentKey !== "") { addWidget(comboBox.currentKey, sectionId) @@ -131,13 +131,13 @@ NBox { Item { Layout.fillWidth: true Layout.fillHeight: true - Layout.minimumHeight: 65 * scaling + Layout.minimumHeight: 65 clip: false // Don't clip children so ghost can move freely Flow { id: widgetFlow anchors.fill: parent - spacing: Style.marginS * scaling + spacing: Style.marginS flow: Flow.LeftToRight Repeater { @@ -148,16 +148,16 @@ NBox { required property int index required property var modelData - width: widgetContent.implicitWidth + Style.marginL * scaling - height: Style.baseWidgetSize * 1.15 * scaling - radius: Style.radiusL * scaling + width: widgetContent.implicitWidth + Style.marginL + height: Style.baseWidgetSize * 1.15 + radius: Style.radiusL color: root.getWidgetColor(modelData)[0] border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) // Store the widget index for drag operations property int widgetIndex: index - readonly property int buttonsWidth: Math.round(20 * scaling) + readonly property int buttonsWidth: Math.round(20) readonly property int buttonsCount: 1 + (root.widgetRegistry ? root.widgetRegistry.widgetHasUserSettings(modelData.id) : 0) // Visual feedback during drag @@ -180,7 +180,7 @@ NBox { NContextMenu { id: contextMenu parent: Overlay.overlay - width: 240 * scaling + width: 240 model: [{ "label": I18n.tr("tooltips.move-to-left-section"), "action": "left", @@ -223,15 +223,15 @@ NBox { RowLayout { id: widgetContent anchors.centerIn: parent - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS NText { text: modelData.id - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: root.getWidgetColor(modelData)[1] horizontalAlignment: Text.AlignHCenter elide: Text.ElideRight - Layout.preferredWidth: 80 * scaling + Layout.preferredWidth: 80 } RowLayout { @@ -304,11 +304,11 @@ NBox { Rectangle { id: dragGhost width: 0 - height: Style.baseWidgetSize * 1.15 * scaling - radius: Style.radiusL * scaling + height: Style.baseWidgetSize * 1.15 + radius: Style.radiusL color: Color.transparent border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) opacity: 0.7 visible: flowDragArea.dragStarted z: 2000 @@ -317,7 +317,7 @@ NBox { NText { id: ghostText anchors.centerIn: parent - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: Color.mOnPrimary } } @@ -325,8 +325,8 @@ NBox { // Drop indicator - visual feedback for where the widget will be inserted Rectangle { id: dropIndicator - width: 3 * scaling - height: Style.baseWidgetSize * 1.15 * scaling + width: 3 + height: Style.baseWidgetSize * 1.15 radius: width / 2 color: Color.mPrimary opacity: 0 @@ -378,7 +378,7 @@ NBox { property bool dragStarted: false property bool potentialDrag: false // Track if we're in a potential drag interaction property int draggedIndex: -1 - property real dragThreshold: 15 * scaling + property real dragThreshold: 15 property Item draggedWidget: null property int dropTargetIndex: -1 property var draggedModelData: null @@ -413,13 +413,13 @@ NBox { if (leftDist < minDistance) { minDistance = leftDist bestIndex = i - bestPosition = Qt.point(widget.x - dropIndicator.width / 2 - Style.marginXS * scaling, widget.y) + bestPosition = Qt.point(widget.x - dropIndicator.width / 2 - Style.marginXS, widget.y) } if (rightDist < minDistance) { minDistance = rightDist bestIndex = i + 1 - bestPosition = Qt.point(widget.x + widget.width + Style.marginXS * scaling - dropIndicator.width / 2, widget.y) + bestPosition = Qt.point(widget.x + widget.width + Style.marginXS - dropIndicator.width / 2, widget.y) } } @@ -431,13 +431,13 @@ NBox { if (dist < minDistance && mouseX < firstWidget.x + firstWidget.width / 2) { minDistance = dist bestIndex = 0 - bestPosition = Qt.point(Math.max(0, firstWidget.x - dropIndicator.width - Style.marginS * scaling), firstWidget.y) + bestPosition = Qt.point(Math.max(0, firstWidget.x - dropIndicator.width - Style.marginS), firstWidget.y) } } } // Only show indicator if we're close enough and it's a different position - if (minDistance < 80 * scaling && bestIndex !== -1) { + if (minDistance < 80 && bestIndex !== -1) { // Adjust index if we're moving forward let adjustedIndex = bestIndex if (bestIndex > draggedIndex) { diff --git a/Modules/Settings/SettingsPanel.qml b/Modules/Settings/SettingsPanel.qml index ff499cfee..32d88fc87 100644 --- a/Modules/Settings/SettingsPanel.qml +++ b/Modules/Settings/SettingsPanel.qml @@ -273,7 +273,7 @@ NPanel { // Main layout container that fills the panel ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginL * scaling + anchors.margins: Style.marginL spacing: 0 // Keyboard shortcuts container @@ -336,18 +336,18 @@ NPanel { RowLayout { Layout.fillWidth: true Layout.fillHeight: true - spacing: Style.marginM * scaling + spacing: Style.marginM // Sidebar Rectangle { id: sidebar - Layout.preferredWidth: 220 * scaling + Layout.preferredWidth: 220 Layout.fillHeight: true Layout.alignment: Qt.AlignTop color: Color.mSurfaceVariant border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) - radius: Style.radiusM * scaling + border.width: Math.max(1, Style.borderS) + radius: Style.radiusM MouseArea { anchors.fill: parent @@ -368,8 +368,8 @@ NPanel { ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginS * scaling - spacing: Style.marginXS * scaling + anchors.margins: Style.marginS + spacing: Style.marginXS Repeater { id: sections @@ -377,8 +377,8 @@ NPanel { delegate: Rectangle { id: tabItem Layout.fillWidth: true - Layout.preferredHeight: tabEntryRow.implicitHeight + Style.marginS * scaling * 2 - radius: Style.radiusS * scaling + Layout.preferredHeight: tabEntryRow.implicitHeight + Style.marginS * 2 + radius: Style.radiusS color: selected ? Color.mPrimary : (tabItem.hovering ? Color.mTertiary : Color.transparent) readonly property bool selected: index === currentTabIndex property bool hovering: false @@ -399,22 +399,22 @@ NPanel { RowLayout { id: tabEntryRow anchors.fill: parent - anchors.leftMargin: Style.marginS * scaling - anchors.rightMargin: Style.marginS * scaling - spacing: Style.marginM * scaling + anchors.leftMargin: Style.marginS + anchors.rightMargin: Style.marginS + spacing: Style.marginM // Tab icon NIcon { icon: modelData.icon color: tabTextColor - pointSize: Style.fontSizeXL * scaling + pointSize: Style.fontSizeXL } // Tab label NText { text: I18n.tr(modelData.label) color: tabTextColor - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightBold Layout.fillWidth: true Layout.alignment: Qt.AlignVCenter @@ -445,34 +445,34 @@ NPanel { Layout.fillWidth: true Layout.fillHeight: true Layout.alignment: Qt.AlignTop - radius: Style.radiusM * scaling + radius: Style.radiusM color: Color.mSurfaceVariant border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) ColumnLayout { id: contentLayout anchors.fill: parent - anchors.margins: Style.marginL * scaling - spacing: Style.marginS * scaling + anchors.margins: Style.marginL + spacing: Style.marginS // Header row RowLayout { id: headerRow Layout.fillWidth: true - spacing: Style.marginS * scaling + spacing: Style.marginS // Main icon NIcon { icon: root.tabsModel[currentTabIndex]?.icon color: Color.mPrimary - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL } // Main title NText { text: I18n.tr(root.tabsModel[currentTabIndex]?.label) || "" - pointSize: Style.fontSizeXL * scaling + pointSize: Style.fontSizeXL font.weight: Style.fontWeightBold color: Color.mPrimary Layout.fillWidth: true @@ -527,7 +527,7 @@ NPanel { anchors.fill: parent horizontalPolicy: ScrollBar.AlwaysOff verticalPolicy: ScrollBar.AsNeeded - padding: Style.marginL * scaling + padding: Style.marginL Component.onCompleted: { root.activeScrollView = scrollView } diff --git a/Modules/Settings/Tabs/AboutTab.qml b/Modules/Settings/Tabs/AboutTab.qml index 6e226e1ba..dc1677a54 100644 --- a/Modules/Settings/Tabs/AboutTab.qml +++ b/Modules/Settings/Tabs/AboutTab.qml @@ -15,7 +15,7 @@ ColumnLayout { property string currentVersion: UpdateService.currentVersion property var contributors: GitHubService.contributors - spacing: Style.marginL * scaling + spacing: Style.marginL NHeader { label: I18n.tr("settings.about.noctalia.section.label") @@ -23,13 +23,13 @@ ColumnLayout { } RowLayout { - spacing: Style.marginXL * scaling + spacing: Style.marginXL // Versions GridLayout { columns: 2 - rowSpacing: Style.marginXS * scaling - columnSpacing: Style.marginS * scaling + rowSpacing: Style.marginXS + columnSpacing: Style.marginS NText { text: I18n.tr("settings.about.noctalia.latest-version") @@ -76,7 +76,7 @@ ColumnLayout { icon: "download" text: I18n.tr("settings.about.noctalia.download-latest") outlined: !hovered - fontSize: Style.fontSizeXS * scaling + fontSize: Style.fontSizeXS onClicked: { Quickshell.execDetached(["xdg-open", "https://github.com/Ly-sec/Noctalia/releases/latest"]) } @@ -85,8 +85,8 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Contributors @@ -110,14 +110,14 @@ ColumnLayout { const rows = Math.ceil(root.contributors.length / columns) return rows * cellHeight } - cellWidth: Style.baseWidgetSize * 7 * scaling - cellHeight: Style.baseWidgetSize * 3 * scaling + cellWidth: Style.baseWidgetSize * 7 + cellHeight: Style.baseWidgetSize * 3 model: root.contributors delegate: Rectangle { - width: contributorsGrid.cellWidth - Style.marginM * scaling - height: contributorsGrid.cellHeight - Style.marginM * scaling - radius: Style.radiusL * scaling + width: contributorsGrid.cellWidth - Style.marginM + height: contributorsGrid.cellHeight - Style.marginM + radius: Style.radiusL color: contributorArea.containsMouse ? Color.mTertiary : Color.transparent Behavior on color { @@ -128,21 +128,21 @@ ColumnLayout { RowLayout { anchors.fill: parent - anchors.margins: Style.marginS * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginS + spacing: Style.marginM Item { Layout.alignment: Qt.AlignVCenter - Layout.preferredWidth: Style.baseWidgetSize * 2 * scaling - Layout.preferredHeight: Style.baseWidgetSize * 2 * scaling + Layout.preferredWidth: Style.baseWidgetSize * 2 + Layout.preferredHeight: Style.baseWidgetSize * 2 NImageCircled { imagePath: modelData.avatar_url || "" anchors.fill: parent - anchors.margins: Style.marginXS * scaling + anchors.margins: Style.marginXS fallbackIcon: "person" borderColor: contributorArea.containsMouse ? Color.mOnTertiary : Color.mPrimary - borderWidth: Math.max(1, Style.borderM * scaling) + borderWidth: Math.max(1, Style.borderM) Behavior on borderColor { ColorAnimation { @@ -153,7 +153,7 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginXS * scaling + spacing: Style.marginXS Layout.alignment: Qt.AlignVCenter Layout.fillWidth: true @@ -167,7 +167,7 @@ ColumnLayout { NText { text: (modelData.contributions || 0) + " " + ((modelData.contributions || 0) === 1 ? "commit" : "commits") - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: contributorArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface } } diff --git a/Modules/Settings/Tabs/AudioTab.qml b/Modules/Settings/Tabs/AudioTab.qml index e4f704076..ef73bbdd1 100644 --- a/Modules/Settings/Tabs/AudioTab.qml +++ b/Modules/Settings/Tabs/AudioTab.qml @@ -8,7 +8,7 @@ import qs.Widgets ColumnLayout { id: root - spacing: Style.marginL * scaling + spacing: Style.marginL NHeader { label: I18n.tr("settings.audio.volumes.section.label") @@ -26,7 +26,7 @@ ColumnLayout { // Master Volume ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NLabel { @@ -61,7 +61,7 @@ ColumnLayout { // Mute Toggle ColumnLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS Layout.fillWidth: true NToggle { @@ -78,7 +78,7 @@ ColumnLayout { // Input Volume ColumnLayout { - spacing: Style.marginXS * scaling + spacing: Style.marginXS Layout.fillWidth: true NLabel { @@ -99,7 +99,7 @@ ColumnLayout { // Input Mute Toggle ColumnLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS Layout.fillWidth: true NToggle { @@ -112,7 +112,7 @@ ColumnLayout { // Volume Step Size ColumnLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS Layout.fillWidth: true NSpinBox { @@ -130,7 +130,7 @@ ColumnLayout { // Raise maximum volume above 100% ColumnLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS Layout.fillWidth: true NToggle { @@ -143,13 +143,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // AudioService Devices ColumnLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS Layout.fillWidth: true NHeader { @@ -164,9 +164,9 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginXS * scaling + spacing: Style.marginXS Layout.fillWidth: true - Layout.bottomMargin: Style.marginL * scaling + Layout.bottomMargin: Style.marginL NLabel { label: I18n.tr("settings.audio.devices.output-device.label") @@ -196,7 +196,7 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginXS * scaling + spacing: Style.marginXS Layout.fillWidth: true NLabel { @@ -222,13 +222,13 @@ ColumnLayout { // Divider NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Media Player Preferences ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL NHeader { label: I18n.tr("settings.audio.media.section.label") @@ -249,11 +249,11 @@ ColumnLayout { // Blacklist editor ColumnLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS Layout.fillWidth: true RowLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS Layout.fillWidth: true NTextInput { @@ -267,7 +267,7 @@ ColumnLayout { NIconButton { icon: "add" Layout.alignment: Qt.AlignBottom - Layout.bottomMargin: blacklistInput.description ? Style.marginS * scaling : 0 + Layout.bottomMargin: blacklistInput.description ? Style.marginS : 0 onClicked: { const val = (blacklistInput.text || "").trim() if (val !== "") { @@ -285,40 +285,40 @@ ColumnLayout { // Current blacklist entries Flow { Layout.fillWidth: true - Layout.leftMargin: Style.marginS * scaling - spacing: Style.marginS * scaling + Layout.leftMargin: Style.marginS + spacing: Style.marginS Repeater { model: Settings.data.audio.mprisBlacklist delegate: Rectangle { required property string modelData // Padding around the inner row - property real pad: Style.marginS * scaling + property real pad: Style.marginS // Visuals color: Qt.alpha(Color.mOnSurface, 0.125) border.color: Qt.alpha(Color.mOnSurface, Style.opacityLight) - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) // Content RowLayout { id: chipRow - spacing: Style.marginXS * scaling + spacing: Style.marginXS anchors.fill: parent anchors.margins: pad NText { text: modelData color: Color.mOnSurface - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS Layout.alignment: Qt.AlignVCenter - Layout.leftMargin: Style.marginS * scaling + Layout.leftMargin: Style.marginS } NIconButton { icon: "close" baseSize: Style.baseWidgetSize * 0.8 Layout.alignment: Qt.AlignVCenter - Layout.rightMargin: Style.marginXS * scaling + Layout.rightMargin: Style.marginXS onClicked: { const arr = (Settings.data.audio.mprisBlacklist || []) const idx = arr.findIndex(x => String(x) === modelData) @@ -333,8 +333,8 @@ ColumnLayout { // Intrinsic size derived from inner row + padding implicitWidth: chipRow.implicitWidth + pad * 2 - implicitHeight: Math.max(chipRow.implicitHeight + pad * 2, Style.baseWidgetSize * 0.8 * scaling) - radius: Style.radiusM * scaling + implicitHeight: Math.max(chipRow.implicitHeight + pad * 2, Style.baseWidgetSize * 0.8) + radius: Style.radiusM } } } @@ -407,7 +407,7 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } } diff --git a/Modules/Settings/Tabs/BarTab.qml b/Modules/Settings/Tabs/BarTab.qml index fff686cae..a221f9bc3 100644 --- a/Modules/Settings/Tabs/BarTab.qml +++ b/Modules/Settings/Tabs/BarTab.qml @@ -9,7 +9,7 @@ import qs.Modules.Settings.Extras ColumnLayout { id: root - spacing: Style.marginL * scaling + spacing: Style.marginL // Helper functions to update arrays immutably function addMonitor(list, name) { @@ -85,7 +85,7 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NLabel { @@ -123,7 +123,7 @@ ColumnLayout { // Floating bar options - only show when floating is enabled ColumnLayout { visible: Settings.data.bar.floating - spacing: Style.marginS * scaling + spacing: Style.marginS Layout.fillWidth: true NLabel { @@ -133,14 +133,14 @@ ColumnLayout { RowLayout { Layout.fillWidth: true - spacing: Style.marginL * scaling + spacing: Style.marginL ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS NText { text: I18n.tr("settings.bar.appearance.margins.vertical") - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurfaceVariant } @@ -156,11 +156,11 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS NText { text: I18n.tr("settings.bar.appearance.margins.horizontal") - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurfaceVariant } @@ -179,13 +179,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Widgets Management Section ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NHeader { @@ -197,8 +197,8 @@ ColumnLayout { ColumnLayout { Layout.fillWidth: true Layout.fillHeight: true - Layout.topMargin: Style.marginM * scaling - spacing: Style.marginM * scaling + Layout.topMargin: Style.marginM + spacing: Style.marginM // Left Section SectionEditor { @@ -255,13 +255,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Monitor Configuration ColumnLayout { - spacing: Style.marginM * scaling + spacing: Style.marginM Layout.fillWidth: true NHeader { @@ -293,8 +293,8 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // --------------------------------- diff --git a/Modules/Settings/Tabs/ColorSchemeTab.qml b/Modules/Settings/Tabs/ColorSchemeTab.qml index a5c66ead4..08b06c5ea 100644 --- a/Modules/Settings/Tabs/ColorSchemeTab.qml +++ b/Modules/Settings/Tabs/ColorSchemeTab.qml @@ -13,7 +13,7 @@ ColumnLayout { property var schemeColorsCache: ({}) property int cacheVersion: 0 // Increment to trigger UI updates - spacing: Style.marginL * scaling + spacing: Style.marginL // Helper function to extract scheme name from path function extractSchemeName(schemePath) { @@ -211,14 +211,14 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL visible: !Settings.data.colorSchemes.useWallpaperColors } // Predefined Color Schemes ColumnLayout { - spacing: Style.marginM * scaling + spacing: Style.marginM Layout.fillWidth: true visible: !Settings.data.colorSchemes.useWallpaperColors @@ -230,8 +230,8 @@ ColumnLayout { // Color Schemes Grid GridLayout { columns: 3 - rowSpacing: Style.marginM * scaling - columnSpacing: Style.marginM * scaling + rowSpacing: Style.marginM + columnSpacing: Style.marginM Layout.fillWidth: true Repeater { @@ -245,10 +245,10 @@ ColumnLayout { Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter - height: 50 * scaling - radius: Style.radiusS * scaling + height: 50 + radius: Style.radiusS color: root.getSchemeColor(schemeName, "mSurface") - border.width: Math.max(1, Style.borderL * scaling) + border.width: Math.max(1, Style.borderL) border.color: { if (Settings.data.colorSchemes.predefinedScheme === schemeName) { return Color.mSecondary @@ -261,12 +261,12 @@ ColumnLayout { RowLayout { anchors.fill: parent - anchors.margins: Style.marginM * scaling - spacing: Style.marginXS * scaling + anchors.margins: Style.marginM + spacing: Style.marginXS NText { text: schemeItem.schemeName - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS font.weight: Style.fontWeightMedium color: Color.mOnSurface Layout.fillWidth: true @@ -277,29 +277,29 @@ ColumnLayout { } Rectangle { - width: 14 * scaling - height: 14 * scaling + width: 14 + height: 14 radius: width * 0.5 color: root.getSchemeColor(schemeItem.schemeName, "mPrimary") } Rectangle { - width: 14 * scaling - height: 14 * scaling + width: 14 + height: 14 radius: width * 0.5 color: root.getSchemeColor(schemeItem.schemeName, "mSecondary") } Rectangle { - width: 14 * scaling - height: 14 * scaling + width: 14 + height: 14 radius: width * 0.5 color: root.getSchemeColor(schemeItem.schemeName, "mTertiary") } Rectangle { - width: 14 * scaling - height: 14 * scaling + width: 14 + height: 14 radius: width * 0.5 color: root.getSchemeColor(schemeItem.schemeName, "mError") } @@ -324,18 +324,18 @@ ColumnLayout { visible: (Settings.data.colorSchemes.predefinedScheme === schemeItem.schemeName) anchors.right: parent.right anchors.top: parent.top - anchors.rightMargin: -3 * scaling - anchors.topMargin: -3 * scaling - width: 20 * scaling - height: 20 * scaling + anchors.rightMargin: -3 + anchors.topMargin: -3 + width: 20 + height: 20 radius: width * 0.5 color: Color.mSecondary - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) border.color: Color.mOnSecondary NIcon { icon: "check" - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS font.weight: Style.fontWeightBold color: Color.mOnSecondary anchors.centerIn: parent @@ -363,20 +363,20 @@ ColumnLayout { ColorSchemeService.applyScheme(Settings.data.colorSchemes.predefinedScheme) } } - Layout.topMargin: Style.marginL * scaling + Layout.topMargin: Style.marginL } } NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Template toggles organized by category ColumnLayout { Layout.fillWidth: true - spacing: Style.marginL * scaling + spacing: Style.marginL NHeader { label: I18n.tr("settings.color-scheme.templates.section.label") @@ -536,7 +536,7 @@ ColumnLayout { visible: ProgramCheckerService.availableDiscordClients.length === 0 text: I18n.tr("settings.color-scheme.templates.programs.discord.description-missing") color: Color.mOnSurfaceVariant - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS } NCheckbox { diff --git a/Modules/Settings/Tabs/ControlCenterTab.qml b/Modules/Settings/Tabs/ControlCenterTab.qml index a880334c5..b9cbfd50d 100644 --- a/Modules/Settings/Tabs/ControlCenterTab.qml +++ b/Modules/Settings/Tabs/ControlCenterTab.qml @@ -9,7 +9,7 @@ import qs.Modules.Settings.Extras ColumnLayout { id: root - spacing: Style.marginL * scaling + spacing: Style.marginL // Handler for drag start - disables panel background clicks function handleDragStart() { @@ -29,7 +29,7 @@ ColumnLayout { // Quick Settings Style Section ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { @@ -61,13 +61,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Widgets Management Section ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NHeader { @@ -79,8 +79,8 @@ ColumnLayout { ColumnLayout { Layout.fillWidth: true Layout.fillHeight: true - Layout.topMargin: Style.marginM * scaling - spacing: Style.marginM * scaling + Layout.topMargin: Style.marginM + spacing: Style.marginM // Quick Settings SectionEditor { @@ -103,8 +103,8 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // --------------------------------- diff --git a/Modules/Settings/Tabs/DisplayTab.qml b/Modules/Settings/Tabs/DisplayTab.qml index 6eed0a7bc..d1823fa14 100644 --- a/Modules/Settings/Tabs/DisplayTab.qml +++ b/Modules/Settings/Tabs/DisplayTab.qml @@ -49,7 +49,7 @@ ColumnLayout { stderr: StdioCollector {} } - spacing: Style.marginL * scaling + spacing: Style.marginL NHeader { label: I18n.tr("settings.display.monitors.section.label") @@ -57,36 +57,26 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Repeater { model: Quickshell.screens || [] delegate: Rectangle { Layout.fillWidth: true - implicitHeight: contentCol.implicitHeight + Style.marginL * 2 * scaling - radius: Style.radiusM * scaling + implicitHeight: contentCol.implicitHeight + Style.marginL * 2 + radius: Style.radiusM color: Color.mSurfaceVariant border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) - property real localScaling: ScalingService.getScreenScale(modelData) property var brightnessMonitor: BrightnessService.getMonitorForScreen(modelData) - Connections { - target: ScalingService - function onScaleChanged(screenName, scale) { - if (screenName === modelData.name) { - localScaling = scale - } - } - } - ColumnLayout { id: contentCol - width: parent.width - 2 * Style.marginL * scaling - x: Style.marginL * scaling - y: Style.marginL * scaling - spacing: Style.marginXXS * scaling + width: parent.width - 2 * Style.marginL + x: Style.marginL + y: Style.marginL + spacing: Style.marginXXS NLabel { label: modelData.name || "Unknown" @@ -101,67 +91,19 @@ ColumnLayout { } } - // Scale - ColumnLayout { - spacing: Style.marginS * scaling - Layout.fillWidth: true - - RowLayout { - spacing: Style.marginL * scaling - Layout.fillWidth: true - - NText { - text: I18n.tr("settings.display.monitors.scale") - Layout.preferredWidth: 90 * scaling - Layout.alignment: Qt.AlignVCenter - } - - NValueSlider { - id: scaleSlider - from: 0.7 - to: 1.8 - stepSize: 0.01 - value: localScaling - onPressedChanged: (pressed, value) => ScalingService.setScreenScale(modelData, value) - Layout.fillWidth: true - } - - NText { - text: I18n.tr("system.scaling-percentage", { - "percentage": Math.round(scaleSlider.value * 100) - }) - Layout.preferredWidth: 55 * scaling - horizontalAlignment: Text.AlignRight - Layout.alignment: Qt.AlignVCenter - } - - Item { - Layout.preferredWidth: 30 * scaling - Layout.fillHeight: true - NIconButton { - icon: "refresh" - baseSize: Style.baseWidgetSize * 0.8 - tooltipText: I18n.tr("settings.display.monitors.reset-scaling") - onClicked: ScalingService.setScreenScale(modelData, 1.0) - anchors.centerIn: parent - } - } - } - } - // Brightness ColumnLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS Layout.fillWidth: true visible: brightnessMonitor !== undefined && brightnessMonitor !== null RowLayout { Layout.fillWidth: true - spacing: Style.marginL * scaling + spacing: Style.marginL NText { text: I18n.tr("settings.display.monitors.brightness") - Layout.preferredWidth: 90 * scaling + Layout.preferredWidth: 90 Layout.alignment: Qt.AlignVCenter } @@ -182,13 +124,13 @@ ColumnLayout { NText { text: brightnessMonitor ? Math.round(brightnessSlider.value * 100) + "%" : "N/A" - Layout.preferredWidth: 55 * scaling + Layout.preferredWidth: 55 horizontalAlignment: Text.AlignRight Layout.alignment: Qt.AlignVCenter } Item { - Layout.preferredWidth: 30 * scaling + Layout.preferredWidth: 30 Layout.fillHeight: true NIcon { icon: brightnessMonitor.method == "internal" ? "device-laptop" : "device-desktop" @@ -217,13 +159,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Night Light Section ColumnLayout { - spacing: Style.marginXS * scaling + spacing: Style.marginXS Layout.fillWidth: true NHeader { @@ -251,7 +193,7 @@ ColumnLayout { // Temperature ColumnLayout { - spacing: Style.marginXS * scaling + spacing: Style.marginXS Layout.alignment: Qt.AlignVCenter NLabel { @@ -261,14 +203,14 @@ ColumnLayout { RowLayout { visible: Settings.data.nightLight.enabled - spacing: Style.marginM * scaling + spacing: Style.marginM Layout.fillWidth: false Layout.fillHeight: true Layout.alignment: Qt.AlignVCenter NText { text: I18n.tr("settings.display.night-light.temperature.night") - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignVCenter } @@ -290,7 +232,7 @@ ColumnLayout { NText { text: I18n.tr("settings.display.night-light.temperature.day") - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignVCenter } @@ -323,7 +265,7 @@ ColumnLayout { // Manual scheduling ColumnLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS visible: Settings.data.nightLight.enabled && !Settings.data.nightLight.autoSchedule && !Settings.data.nightLight.forced NLabel { @@ -333,11 +275,11 @@ ColumnLayout { RowLayout { Layout.fillWidth: false - spacing: Style.marginS * scaling + spacing: Style.marginS NText { text: I18n.tr("settings.display.night-light.manual-schedule.sunrise") - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant } @@ -346,16 +288,16 @@ ColumnLayout { currentKey: Settings.data.nightLight.manualSunrise placeholder: I18n.tr("settings.display.night-light.manual-schedule.select-start") onSelected: key => Settings.data.nightLight.manualSunrise = key - minimumWidth: 120 * scaling + minimumWidth: 120 } Item { - Layout.preferredWidth: 20 * scaling + Layout.preferredWidth: 20 } NText { text: I18n.tr("settings.display.night-light.manual-schedule.sunset") - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant } @@ -364,7 +306,7 @@ ColumnLayout { currentKey: Settings.data.nightLight.manualSunset placeholder: I18n.tr("settings.display.night-light.manual-schedule.select-stop") onSelected: key => Settings.data.nightLight.manualSunset = key - minimumWidth: 120 * scaling + minimumWidth: 120 } } } @@ -388,7 +330,7 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } } diff --git a/Modules/Settings/Tabs/DockTab.qml b/Modules/Settings/Tabs/DockTab.qml index 5d31c0747..79c0c8be1 100644 --- a/Modules/Settings/Tabs/DockTab.qml +++ b/Modules/Settings/Tabs/DockTab.qml @@ -9,7 +9,7 @@ import qs.Widgets ColumnLayout { id: root - spacing: Style.marginL * scaling + spacing: Style.marginL // Helper functions to update arrays immutably function addMonitor(list, name) { @@ -50,7 +50,7 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NLabel { label: I18n.tr("settings.dock.appearance.background-opacity.label") @@ -68,7 +68,7 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NLabel { @@ -89,13 +89,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Monitor Configuration ColumnLayout { - spacing: Style.marginM * scaling + spacing: Style.marginM Layout.fillWidth: true NHeader { @@ -134,7 +134,7 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } } diff --git a/Modules/Settings/Tabs/GeneralTab.qml b/Modules/Settings/Tabs/GeneralTab.qml index 558a8860a..bc62a371b 100644 --- a/Modules/Settings/Tabs/GeneralTab.qml +++ b/Modules/Settings/Tabs/GeneralTab.qml @@ -17,16 +17,16 @@ ColumnLayout { // Profile section RowLayout { Layout.fillWidth: true - spacing: Style.marginL * scaling + spacing: Style.marginL // Avatar preview NImageCircled { - width: 108 * scaling - height: 108 * scaling + width: 108 + height: 108 imagePath: Settings.data.general.avatarImage fallbackIcon: "person" borderColor: Color.mPrimary - borderWidth: Math.max(1, Style.borderM * scaling) + borderWidth: Math.max(1, Style.borderM) Layout.alignment: Qt.AlignTop } @@ -61,13 +61,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // User Interface ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { @@ -97,7 +97,7 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NLabel { @@ -118,7 +118,7 @@ ColumnLayout { // Animation Speed ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NToggle { @@ -129,7 +129,7 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true visible: !Settings.data.general.animationDisabled @@ -153,13 +153,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Dock ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { @@ -182,7 +182,7 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NLabel { @@ -204,13 +204,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Control Center ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { @@ -254,13 +254,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Fonts ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { @@ -270,7 +270,7 @@ ColumnLayout { // Font configuration section ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NSearchableComboBox { @@ -280,8 +280,8 @@ ColumnLayout { currentKey: Settings.data.ui.fontDefault placeholder: I18n.tr("settings.general.fonts.default.placeholder") searchPlaceholder: I18n.tr("settings.general.fonts.default.search-placeholder") - popupHeight: 420 * scaling - minimumWidth: 300 * scaling + popupHeight: 420 + minimumWidth: 300 onSelected: function (key) { Settings.data.ui.fontDefault = key } @@ -294,8 +294,8 @@ ColumnLayout { currentKey: Settings.data.ui.fontFixed placeholder: I18n.tr("settings.general.fonts.monospace.placeholder") searchPlaceholder: I18n.tr("settings.general.fonts.monospace.search-placeholder") - popupHeight: 320 * scaling - minimumWidth: 300 * scaling + popupHeight: 320 + minimumWidth: 300 onSelected: function (key) { Settings.data.ui.fontFixed = key } @@ -308,7 +308,7 @@ ColumnLayout { } RowLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NValueSlider { @@ -323,8 +323,8 @@ ColumnLayout { // Reset button container Item { - Layout.preferredWidth: 30 * scaling - Layout.preferredHeight: 30 * scaling + Layout.preferredWidth: 30 + Layout.preferredHeight: 30 NIconButton { icon: "refresh" @@ -345,7 +345,7 @@ ColumnLayout { } RowLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NValueSlider { @@ -360,8 +360,8 @@ ColumnLayout { // Reset button container Item { - Layout.preferredWidth: 30 * scaling - Layout.preferredHeight: 30 * scaling + Layout.preferredWidth: 30 + Layout.preferredHeight: 30 NIconButton { icon: "refresh" diff --git a/Modules/Settings/Tabs/HooksTab.qml b/Modules/Settings/Tabs/HooksTab.qml index ae339d1e8..0b664cd38 100644 --- a/Modules/Settings/Tabs/HooksTab.qml +++ b/Modules/Settings/Tabs/HooksTab.qml @@ -7,7 +7,7 @@ import qs.Widgets ColumnLayout { id: contentColumn - spacing: Style.marginL * scaling + spacing: Style.marginL width: root.width NHeader { @@ -25,7 +25,7 @@ ColumnLayout { ColumnLayout { visible: Settings.data.hooks.enabled - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NDivider { @@ -78,7 +78,7 @@ ColumnLayout { // Info section ColumnLayout { - spacing: Style.marginM * scaling + spacing: Style.marginM Layout.fillWidth: true NLabel { diff --git a/Modules/Settings/Tabs/LauncherTab.qml b/Modules/Settings/Tabs/LauncherTab.qml index a01c13fb9..b64f26b6f 100644 --- a/Modules/Settings/Tabs/LauncherTab.qml +++ b/Modules/Settings/Tabs/LauncherTab.qml @@ -7,7 +7,7 @@ import qs.Widgets ColumnLayout { id: root - spacing: Style.marginL * scaling + spacing: Style.marginL NHeader { label: I18n.tr("settings.launcher.settings.section.label") @@ -48,19 +48,19 @@ ColumnLayout { } ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NText { text: I18n.tr("settings.launcher.settings.background-opacity.label") - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: Color.mOnSurface } NText { text: I18n.tr("settings.launcher.settings.background-opacity.description") - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS color: Color.mOnSurfaceVariant wrapMode: Text.WordWrap Layout.fillWidth: true @@ -111,7 +111,7 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } } diff --git a/Modules/Settings/Tabs/LocationTab.qml b/Modules/Settings/Tabs/LocationTab.qml index 769735d2d..b4ccfe4fe 100644 --- a/Modules/Settings/Tabs/LocationTab.qml +++ b/Modules/Settings/Tabs/LocationTab.qml @@ -7,7 +7,7 @@ import qs.Widgets ColumnLayout { id: root - spacing: Style.marginL * scaling + spacing: Style.marginL NHeader { label: I18n.tr("settings.location.location.section.label") @@ -17,7 +17,7 @@ ColumnLayout { // Location section RowLayout { Layout.fillWidth: true - spacing: Style.marginL * scaling + spacing: Style.marginL NTextInput { label: I18n.tr("settings.location.location.search.label") @@ -37,7 +37,7 @@ ColumnLayout { LocationService.resetWeather() } } - Layout.maximumWidth: 420 * scaling + Layout.maximumWidth: 420 } NText { @@ -46,24 +46,24 @@ ColumnLayout { "name": LocationService.stableName, "coordinates": LocationService.displayCoordinates }) - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: Color.mOnSurfaceVariant verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignRight Layout.alignment: Qt.AlignBottom - Layout.bottomMargin: Style.marginM * scaling + Layout.bottomMargin: Style.marginM } } NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Weather section ColumnLayout { - spacing: Style.marginM * scaling + spacing: Style.marginM Layout.fillWidth: true NHeader { @@ -81,13 +81,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Date & time section ColumnLayout { - spacing: Style.marginM * scaling + spacing: Style.marginM Layout.fillWidth: true NHeader { @@ -112,7 +112,7 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } } diff --git a/Modules/Settings/Tabs/NetworkTab.qml b/Modules/Settings/Tabs/NetworkTab.qml index b19a08194..90e3216f4 100644 --- a/Modules/Settings/Tabs/NetworkTab.qml +++ b/Modules/Settings/Tabs/NetworkTab.qml @@ -9,7 +9,7 @@ import qs.Widgets ColumnLayout { id: root - spacing: Style.marginL * scaling + spacing: Style.marginL NHeader { description: I18n.tr("settings.network.section.description") @@ -29,7 +29,7 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } } diff --git a/Modules/Settings/Tabs/NotificationsTab.qml b/Modules/Settings/Tabs/NotificationsTab.qml index 6673305d1..c5b41f85f 100644 --- a/Modules/Settings/Tabs/NotificationsTab.qml +++ b/Modules/Settings/Tabs/NotificationsTab.qml @@ -24,7 +24,7 @@ ColumnLayout { // General Notification Settings ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { @@ -77,13 +77,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Duration ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { @@ -101,7 +101,7 @@ ColumnLayout { // Low Urgency Duration ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NLabel { @@ -122,7 +122,7 @@ ColumnLayout { // Normal Urgency Duration ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NLabel { @@ -143,7 +143,7 @@ ColumnLayout { // Critical Urgency Duration ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NLabel { @@ -164,8 +164,8 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Monitor Configuration @@ -198,7 +198,7 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } } diff --git a/Modules/Settings/Tabs/OsdTab.qml b/Modules/Settings/Tabs/OsdTab.qml index 785fad638..d549278b6 100644 --- a/Modules/Settings/Tabs/OsdTab.qml +++ b/Modules/Settings/Tabs/OsdTab.qml @@ -24,7 +24,7 @@ ColumnLayout { // Display ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NComboBox { @@ -62,13 +62,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // General ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { @@ -108,13 +108,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Monitor Configuration ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { diff --git a/Modules/Settings/Tabs/ScreenRecorderTab.qml b/Modules/Settings/Tabs/ScreenRecorderTab.qml index 957579bfd..f1bed0753 100644 --- a/Modules/Settings/Tabs/ScreenRecorderTab.qml +++ b/Modules/Settings/Tabs/ScreenRecorderTab.qml @@ -9,7 +9,7 @@ import qs.Widgets ColumnLayout { id: root - spacing: Style.marginL * scaling + spacing: Style.marginL NHeader { label: I18n.tr("settings.screen-recorder.general.section.label") @@ -18,7 +18,7 @@ ColumnLayout { // Output Folder ColumnLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS Layout.fillWidth: true NTextInputButton { @@ -43,13 +43,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Video Settings ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { @@ -179,13 +179,13 @@ ColumnLayout { NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } // Audio Settings ColumnLayout { - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { diff --git a/Modules/Settings/Tabs/WallpaperTab.qml b/Modules/Settings/Tabs/WallpaperTab.qml index d8a2bc56d..0e1e34b86 100644 --- a/Modules/Settings/Tabs/WallpaperTab.qml +++ b/Modules/Settings/Tabs/WallpaperTab.qml @@ -12,7 +12,7 @@ ColumnLayout { property string specificFolderMonitorName: "" - spacing: Style.marginL * scaling + spacing: Style.marginL NHeader { label: I18n.tr("settings.wallpaper.settings.section.label") @@ -24,12 +24,12 @@ ColumnLayout { description: I18n.tr("settings.wallpaper.settings.enable-management.description") checked: Settings.data.wallpaper.enabled onToggled: checked => Settings.data.wallpaper.enabled = checked - Layout.bottomMargin: Style.marginL * scaling + Layout.bottomMargin: Style.marginL } ColumnLayout { visible: Settings.data.wallpaper.enabled - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NTextInputButton { @@ -56,29 +56,29 @@ ColumnLayout { visible: Settings.data.wallpaper.enableMultiMonitorDirectories Layout.fillWidth: true - Layout.minimumWidth: 550 * scaling - radius: Style.radiusM * scaling + Layout.minimumWidth: 550 + radius: Style.radiusM color: Color.mSurfaceVariant border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) - implicitHeight: contentCol.implicitHeight + Style.marginXL * 2 * scaling + border.width: Math.max(1, Style.borderS) + implicitHeight: contentCol.implicitHeight + Style.marginXL * 2 ColumnLayout { id: contentCol anchors.fill: parent - anchors.margins: Style.marginXL * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginXL + spacing: Style.marginM Repeater { model: Quickshell.screens || [] delegate: ColumnLayout { Layout.fillWidth: true - spacing: Style.marginS * scaling + spacing: Style.marginS NText { text: (modelData.name || "Unknown") color: Color.mPrimary font.weight: Style.fontWeightBold - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM } NTextInputButton { @@ -101,13 +101,13 @@ ColumnLayout { NDivider { visible: Settings.data.wallpaper.enabled Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } ColumnLayout { visible: Settings.data.wallpaper.enabled - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { @@ -184,13 +184,13 @@ ColumnLayout { NDivider { visible: Settings.data.wallpaper.enabled Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } ColumnLayout { visible: Settings.data.wallpaper.enabled - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true NHeader { @@ -225,7 +225,7 @@ ColumnLayout { // Preset chips using Repeater RowLayout { id: presetRow - spacing: Style.marginS * scaling + spacing: Style.marginS // Factorized presets data property var intervalPresets: [5 * 60, 10 * 60, 15 * 60, 30 * 60, 45 * 60, 60 * 60, 90 * 60, 120 * 60] @@ -272,8 +272,8 @@ ColumnLayout { RowLayout { id: customRow visible: presetRow.customForcedVisible || !presetRow.isCurrentPreset - spacing: Style.marginS * scaling - Layout.topMargin: Style.marginS * scaling + spacing: Style.marginS + Layout.topMargin: Style.marginS NTextInput { label: I18n.tr("settings.wallpaper.automation.custom-interval.label") @@ -313,8 +313,8 @@ ColumnLayout { radius: height * 0.5 color: selected ? Color.mPrimary : Color.mSurfaceVariant - implicitHeight: Math.max(Style.baseWidgetSize * 0.55 * scaling, 24 * scaling) - implicitWidth: chipLabel.implicitWidth + Style.marginM * 1.5 * scaling + implicitHeight: Math.max(Style.baseWidgetSize * 0.55, 24) + implicitWidth: chipLabel.implicitWidth + Style.marginM * 1.5 border.width: 1 border.color: selected ? Color.transparent : Color.mOutline @@ -328,15 +328,15 @@ ColumnLayout { id: chipLabel anchors.centerIn: parent text: parent.label - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: parent.selected ? Color.mOnPrimary : Color.mOnSurface } } NDivider { Layout.fillWidth: true - Layout.topMargin: Style.marginXL * scaling - Layout.bottomMargin: Style.marginXL * scaling + Layout.topMargin: Style.marginXL + Layout.bottomMargin: Style.marginXL } NFilePicker { diff --git a/Modules/Toast/SimpleToast.qml b/Modules/Toast/SimpleToast.qml index 339e09c64..1575c4a42 100644 --- a/Modules/Toast/SimpleToast.qml +++ b/Modules/Toast/SimpleToast.qml @@ -16,8 +16,8 @@ Rectangle { signal hidden width: parent.width - height: Math.round(contentLayout.implicitHeight + Style.marginL * 2 * scaling) - radius: Style.radiusL * scaling + height: Math.round(contentLayout.implicitHeight + Style.marginL * 2) + radius: Style.radiusL visible: false opacity: 0 scale: initialScale @@ -34,7 +34,7 @@ Rectangle { return Color.mOutline } } - border.width: Math.max(2, Style.borderM * scaling) + border.width: Math.max(2, Style.borderM) Behavior on opacity { NumberAnimation { @@ -74,8 +74,8 @@ Rectangle { RowLayout { id: contentLayout anchors.fill: parent - anchors.margins: Style.marginL * scaling - spacing: Style.marginL * scaling + anchors.margins: Style.marginL + spacing: Style.marginL // Icon NIcon { @@ -100,13 +100,13 @@ Rectangle { return Color.mOnSurface } } - pointSize: Style.fontSizeXXL * 1.5 * scaling + pointSize: Style.fontSizeXXL * 1.5 Layout.alignment: Qt.AlignVCenter } // Label and description ColumnLayout { - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true Layout.alignment: Qt.AlignVCenter @@ -114,7 +114,7 @@ Rectangle { Layout.fillWidth: true text: root.message color: Color.mOnSurface - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold wrapMode: Text.WordWrap visible: text.length > 0 @@ -124,7 +124,7 @@ Rectangle { Layout.fillWidth: true text: root.description color: Color.mOnSurface - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM wrapMode: Text.WordWrap visible: text.length > 0 } diff --git a/Modules/Toast/ToastOverlay.qml b/Modules/Toast/ToastOverlay.qml index 1c8cabab5..3051108da 100644 --- a/Modules/Toast/ToastOverlay.qml +++ b/Modules/Toast/ToastOverlay.qml @@ -11,8 +11,6 @@ Variants { delegate: ToastScreen { required property ShellScreen modelData - screen: modelData - scaling: ScalingService.getScreenScale(modelData) } } diff --git a/Modules/Toast/ToastScreen.qml b/Modules/Toast/ToastScreen.qml index 0c7321842..ee19a625b 100644 --- a/Modules/Toast/ToastScreen.qml +++ b/Modules/Toast/ToastScreen.qml @@ -10,7 +10,6 @@ Item { id: root required property ShellScreen screen - required property real scaling // Local queue for this screen only (bounded to prevent memory issues) property var messageQueue: [] @@ -20,15 +19,6 @@ Item { // If true, immediately show new toasts property bool replaceOnNew: true - Connections { - target: ScalingService - function onScaleChanged(screenName, scale) { - if (screenName === root.screen.name) { - root.scaling = scale - } - } - } - Connections { target: ToastService @@ -161,10 +151,10 @@ Item { margins.top: { if (!(anchors.top)) return 0 - var base = Style.marginM * scaling + var base = Style.marginM if (Settings.data.bar.position === "top") { - var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0 - return (Style.barHeight * scaling) + base + floatExtraV + var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL : 0 + return (Style.barHeight) + base + floatExtraV } return base } @@ -172,10 +162,10 @@ Item { margins.bottom: { if (!(anchors.bottom)) return 0 - var base = Style.marginM * scaling + var base = Style.marginM if (Settings.data.bar.position === "bottom") { - var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0 - return (Style.barHeight * scaling) + base + floatExtraV + var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL : 0 + return (Style.barHeight) + base + floatExtraV } return base } @@ -183,10 +173,10 @@ Item { margins.left: { if (!(anchors.left)) return 0 - var base = Style.marginM * scaling + var base = Style.marginM if (Settings.data.bar.position === "left") { - var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0 - return (Style.barHeight * scaling) + base + floatExtraH + var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL : 0 + return (Style.barHeight) + base + floatExtraH } return base } @@ -194,15 +184,15 @@ Item { margins.right: { if (!(anchors.right)) return 0 - var base = Style.marginM * scaling + var base = Style.marginM if (Settings.data.bar.position === "right") { - var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0 - return (Style.barHeight * scaling) + base + floatExtraH + var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL : 0 + return (Style.barHeight) + base + floatExtraH } return base } - implicitWidth: 420 * root.scaling + implicitWidth: 420 implicitHeight: toastItem.height color: Color.transparent diff --git a/Modules/Tooltip/Tooltip.qml b/Modules/Tooltip/Tooltip.qml index 8e8e532ab..43a6850c1 100644 --- a/Modules/Tooltip/Tooltip.qml +++ b/Modules/Tooltip/Tooltip.qml @@ -8,7 +8,6 @@ import qs.Widgets PopupWindow { id: root - property real scaling: 1.0 property int screenWidth: 0 property int screenHeight: 0 @@ -114,7 +113,6 @@ PopupWindow { if (!screen || !target || !tipText || tipText === "") return - root.scaling = ScalingService.getScreenScaleByName(screen.name) root.screenWidth = screen.width root.screenHeight = screen.height @@ -153,10 +151,10 @@ PopupWindow { } // Calculate tooltip dimensions - const tipWidth = Math.min(tooltipText.implicitWidth + (padding * 2 * scaling), maxWidth * scaling) + const tipWidth = Math.min(tooltipText.implicitWidth + (padding * 2), maxWidth) root.implicitWidth = tipWidth - const tipHeight = tooltipText.implicitHeight + (padding * 2 * scaling) + const tipHeight = tooltipText.implicitHeight + (padding * 2) root.implicitHeight = tipHeight // Get target's global position @@ -179,26 +177,26 @@ PopupWindow { "dir": "bottom", "space": spaceBottom, "x": (targetWidth - tipWidth) / 2, - "y": targetHeight + margin * scaling, - "fits": spaceBottom >= tipHeight + margin * scaling + "y": targetHeight + margin, + "fits": spaceBottom >= tipHeight + margin }, { "dir": "top", "space": spaceTop, "x": (targetWidth - tipWidth) / 2, - "y": -tipHeight - margin * scaling, - "fits": spaceTop >= tipHeight + margin * scaling + "y": -tipHeight - margin, + "fits": spaceTop >= tipHeight + margin }, { "dir": "right", "space": spaceRight, - "x": targetWidth + margin * scaling, + "x": targetWidth + margin, "y": (targetHeight - tipHeight) / 2, - "fits": spaceRight >= tipWidth + margin * scaling + "fits": spaceRight >= tipWidth + margin }, { "dir": "left", "space": spaceLeft, - "x": -tipWidth - margin * scaling, + "x": -tipWidth - margin, "y": (targetHeight - tipHeight) / 2, - "fits": spaceLeft >= tipWidth + margin * scaling + "fits": spaceLeft >= tipWidth + margin }] // Find first position that fits @@ -226,29 +224,29 @@ PopupWindow { if (direction === "auto") { const globalX = targetGlobal.x + newAnchorX if (globalX < 0) { - newAnchorX = -targetGlobal.x + margin * scaling + newAnchorX = -targetGlobal.x + margin } else if (globalX + tipWidth > screenWidth) { - newAnchorX = screenWidth - targetGlobal.x - tipWidth - margin * scaling + newAnchorX = screenWidth - targetGlobal.x - tipWidth - margin } } } else { // Manual direction positioning switch (direction) { case "left": - newAnchorX = -tipWidth - margin * scaling + newAnchorX = -tipWidth - margin newAnchorY = (targetHeight - tipHeight) / 2 break case "right": - newAnchorX = targetWidth + margin * scaling + newAnchorX = targetWidth + margin newAnchorY = (targetHeight - tipHeight) / 2 break case "top": newAnchorX = (targetWidth - tipWidth) / 2 - newAnchorY = -tipHeight - margin * scaling + newAnchorY = -tipHeight - margin break case "bottom": newAnchorX = (targetWidth - tipWidth) / 2 - newAnchorY = targetHeight + margin * scaling + newAnchorY = targetHeight + margin break } } @@ -370,8 +368,8 @@ PopupWindow { anchors.fill: parent color: Color.mSurface border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * root.scaling) - radius: Style.radiusS * root.scaling + border.width: Math.max(1, Style.borderS) + radius: Style.radiusS // Only show content when we have text visible: root.text !== "" @@ -379,14 +377,14 @@ PopupWindow { NText { id: tooltipText anchors.centerIn: parent - anchors.margins: root.padding * root.scaling + anchors.margins: root.padding text: root.text - pointSize: Style.fontSizeS * root.scaling + pointSize: Style.fontSizeS color: Color.mOnSurfaceVariant horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter wrapMode: Text.WordWrap - width: root.maxWidth * root.scaling - (root.padding * 2 * root.scaling) + width: root.maxWidth - (root.padding * 2) } } } diff --git a/Modules/Wallpaper/WallpaperPanel.qml b/Modules/Wallpaper/WallpaperPanel.qml index 6ff2ed498..be3a526b5 100644 --- a/Modules/Wallpaper/WallpaperPanel.qml +++ b/Modules/Wallpaper/WallpaperPanel.qml @@ -58,23 +58,23 @@ NPanel { ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginL * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginL + spacing: Style.marginM // Header RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NIcon { icon: "settings-wallpaper-selector" - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL color: Color.mPrimary } NText { text: I18n.tr("wallpaper.panel.title") - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: Color.mOnSurface Layout.fillWidth: true @@ -125,7 +125,7 @@ NPanel { Layout.fillWidth: true currentIndex: currentScreenIndex onCurrentIndexChanged: currentScreenIndex = currentIndex - spacing: Style.marginM * scaling + spacing: Style.marginM background: Rectangle { color: Color.transparent @@ -135,12 +135,12 @@ NPanel { model: Quickshell.screens delegate: TabButton { text: modelData.name || `Screen ${index + 1}` - width: implicitWidth + Style.marginS * 2 * scaling + width: implicitWidth + Style.marginS * 2 background: Rectangle { color: screenTabBar.currentIndex === index ? Color.mSecondary : Color.transparent - radius: Style.radiusS * scaling - border.width: screenTabBar.currentIndex === index ? 0 : Math.max(1, Style.borderS * scaling) + radius: Style.radiusS + border.width: screenTabBar.currentIndex === index ? 0 : Math.max(1, Style.borderS) border.color: Color.mOutline Behavior on color { @@ -152,7 +152,7 @@ NPanel { contentItem: NText { text: parent.text - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: screenTabBar.currentIndex === index ? Style.fontWeightBold : Style.fontWeightRegular family: Settings.data.ui.fontDefault color: screenTabBar.currentIndex === index ? Color.mOnSecondary : Color.mOnSurfaceVariant @@ -169,7 +169,7 @@ NPanel { anchors.fill: parent color: Color.mOnSurface opacity: tabHover.hovered && screenTabBar.currentIndex !== index ? 0.08 : 0 - radius: Style.radiusS * scaling + radius: Style.radiusS Behavior on opacity { NumberAnimation { @@ -200,12 +200,12 @@ NPanel { // Filter input RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NText { text: I18n.tr("wallpaper.panel.search") color: Color.mOnSurface - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM Layout.preferredWidth: implicitWidth } @@ -306,7 +306,7 @@ NPanel { ColumnLayout { anchors.fill: parent - spacing: Style.marginM * scaling + spacing: Style.marginM GridView { id: wallpaperGridView @@ -327,12 +327,12 @@ NPanel { property int itemSize: cellWidth cellWidth: Math.floor((width - leftMargin - rightMargin) / columns) - cellHeight: Math.floor(itemSize * 0.7) + Style.marginXS * scaling + Style.fontSizeXS * scaling + Style.marginM * scaling + cellHeight: Math.floor(itemSize * 0.7) + Style.marginXS + Style.fontSizeXS + Style.marginM - leftMargin: Style.marginS * scaling - rightMargin: Style.marginS * scaling - topMargin: Style.marginS * scaling - bottomMargin: Style.marginS * scaling + leftMargin: Style.marginS + rightMargin: Style.marginS + topMargin: Style.marginS + bottomMargin: Style.marginS onCurrentIndexChanged: { // Synchronize scroll with current item position @@ -377,7 +377,7 @@ NPanel { property string filename: wallpaperPath.split('/').pop() width: wallpaperGridView.itemSize - spacing: Style.marginXS * scaling + spacing: Style.marginXS Rectangle { id: imageContainer @@ -405,24 +405,24 @@ NPanel { } return Color.mSurface } - border.width: Math.max(1, Style.borderL * 1.5 * scaling) + border.width: Math.max(1, Style.borderL * 1.5) } Rectangle { anchors.top: parent.top anchors.right: parent.right - anchors.margins: Style.marginS * scaling - width: 28 * scaling - height: 28 * scaling + anchors.margins: Style.marginS + width: 28 + height: 28 radius: width / 2 color: Color.mSecondary border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) visible: isSelected NIcon { icon: "check" - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightBold color: Color.mOnSecondary anchors.centerIn: parent @@ -461,10 +461,10 @@ NPanel { NText { text: filename color: (hoverHandler.hovered || isSelected || wallpaperGridView.currentIndex === index) ? Color.mOnSurface : Color.mOnSurfaceVariant - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS Layout.fillWidth: true - Layout.leftMargin: Style.marginS * scaling - Layout.rightMargin: Style.marginS * scaling + Layout.leftMargin: Style.marginS + Layout.rightMargin: Style.marginS Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter elide: Text.ElideRight @@ -475,12 +475,12 @@ NPanel { // Empty / scanning state Rectangle { color: Color.mSurface - radius: Style.radiusM * scaling + radius: Style.radiusM border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) visible: (filteredWallpapers.length === 0 && !WallpaperService.scanning) || WallpaperService.scanning Layout.fillWidth: true - Layout.preferredHeight: 130 * scaling + Layout.preferredHeight: 130 ColumnLayout { anchors.fill: parent @@ -498,7 +498,7 @@ NPanel { } NIcon { icon: "folder-open" - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL color: Color.mOnSurface Layout.alignment: Qt.AlignHCenter } diff --git a/Widgets/NBox.qml b/Widgets/NBox.qml index 4dad5c68a..72ab90f01 100644 --- a/Widgets/NBox.qml +++ b/Widgets/NBox.qml @@ -12,7 +12,7 @@ Rectangle { implicitHeight: childrenRect.height color: Color.mSurfaceVariant - radius: Style.radiusM * scaling + radius: Style.radiusM border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) } diff --git a/Widgets/NBusyIndicator.qml b/Widgets/NBusyIndicator.qml index 67f104ae6..bf93abe8a 100644 --- a/Widgets/NBusyIndicator.qml +++ b/Widgets/NBusyIndicator.qml @@ -7,8 +7,8 @@ Item { property bool running: true property color color: Color.mPrimary - property int size: Style.baseWidgetSize * scaling - property int strokeWidth: Style.borderL * scaling + property int size: Style.baseWidgetSize + property int strokeWidth: Style.borderL property int duration: Style.animationSlow * 2 implicitWidth: size diff --git a/Widgets/NButton.qml b/Widgets/NButton.qml index 3d1b05a3b..654de9526 100644 --- a/Widgets/NButton.qml +++ b/Widgets/NButton.qml @@ -15,9 +15,9 @@ Rectangle { property color textColor: Color.mOnPrimary property color hoverColor: Color.mTertiary property bool enabled: true - property real fontSize: Style.fontSizeM * scaling + property real fontSize: Style.fontSizeM property int fontWeight: Style.fontWeightBold - property real iconSize: Style.fontSizeL * scaling + property real iconSize: Style.fontSizeL property bool outlined: false property int horizontalAlignment: Qt.AlignHCenter @@ -30,11 +30,11 @@ Rectangle { property bool hovered: false // Dimensions - implicitWidth: contentRow.implicitWidth + (Style.marginL * 2 * scaling) - implicitHeight: Math.max(Style.baseWidgetSize * scaling, contentRow.implicitHeight + (Style.marginM * scaling)) + implicitWidth: contentRow.implicitWidth + (Style.marginL * 2) + implicitHeight: Math.max(Style.baseWidgetSize, contentRow.implicitHeight + (Style.marginM)) // Appearance - radius: Style.radiusS * scaling + radius: Style.radiusS color: { if (!enabled) return outlined ? Color.transparent : Qt.lighter(Color.mSurfaceVariant, 1.2) @@ -43,7 +43,7 @@ Rectangle { return outlined ? Color.transparent : backgroundColor } - border.width: outlined ? Math.max(1, Style.borderS * scaling) : 0 + border.width: outlined ? Math.max(1, Style.borderS) : 0 border.color: { if (!enabled) return Color.mOutline @@ -74,8 +74,8 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter anchors.left: root.horizontalAlignment === Qt.AlignLeft ? parent.left : undefined anchors.horizontalCenter: root.horizontalAlignment === Qt.AlignHCenter ? parent.horizontalCenter : undefined - anchors.leftMargin: root.horizontalAlignment === Qt.AlignLeft ? Style.marginL * scaling : 0 - spacing: Style.marginXS * scaling + anchors.leftMargin: root.horizontalAlignment === Qt.AlignLeft ? Style.marginL : 0 + spacing: Style.marginXS // Icon (optional) NIcon { diff --git a/Widgets/NCheckbox.qml b/Widgets/NCheckbox.qml index 4ea76318d..8d3d36d61 100644 --- a/Widgets/NCheckbox.qml +++ b/Widgets/NCheckbox.qml @@ -35,12 +35,12 @@ RowLayout { Rectangle { id: box - implicitWidth: Math.round(root.baseSize * scaling) - implicitHeight: Math.round(root.baseSize * scaling) - radius: Style.radiusXS * scaling + implicitWidth: Math.round(root.baseSize) + implicitHeight: Math.round(root.baseSize) + radius: Style.radiusXS color: root.checked ? root.activeColor : Color.mSurface border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) Behavior on color { ColorAnimation { @@ -57,10 +57,10 @@ RowLayout { NIcon { visible: root.checked anchors.centerIn: parent - anchors.horizontalCenterOffset: -1 * scaling + anchors.horizontalCenterOffset: -1 icon: "check" color: root.activeOnColor - pointSize: Math.max(Style.fontSizeXS, root.baseSize * 0.5) * scaling + pointSize: Math.max(Style.fontSizeXS, root.baseSize * 0.5) font.weight: Style.fontWeightBold } diff --git a/Widgets/NCircleStat.qml b/Widgets/NCircleStat.qml index 1305cec21..3279084e1 100644 --- a/Widgets/NCircleStat.qml +++ b/Widgets/NCircleStat.qml @@ -8,7 +8,6 @@ import qs.Widgets Rectangle { id: root - property real scaling: 1.0 property real value: 0 // 0..100 (or any range visually mapped) property string icon: "" property string suffix: "%" @@ -18,27 +17,20 @@ Rectangle { // outer width/height footprint of the component property real contentScale: 1.0 - width: 68 * scaling - height: 92 * scaling + width: 68 + height: 92 color: flat ? Color.transparent : Color.mSurface - radius: Style.radiusS * scaling + radius: Style.radiusS border.color: flat ? Color.transparent : Color.mSurfaceVariant - border.width: flat ? 0 : Math.max(1, Style.borderS * scaling) + border.width: flat ? 0 : Math.max(1, Style.borderS) // Repaint gauge when the bound value changes onValueChanged: gauge.requestPaint() - - // Force repaint when scaling changes - onScalingChanged: { - Qt.callLater(() => { - gauge.requestPaint() - }) - } ColumnLayout { id: mainLayout anchors.fill: parent - anchors.margins: Style.marginS * scaling * contentScale + anchors.margins: Style.marginS * contentScale spacing: 0 // Main gauge container @@ -47,8 +39,8 @@ Rectangle { Layout.fillWidth: true Layout.fillHeight: true Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: 68 * scaling * contentScale - Layout.preferredHeight: 68 * scaling * contentScale + Layout.preferredWidth: 68 * contentScale + Layout.preferredHeight: 68 * contentScale Canvas { id: gauge @@ -59,7 +51,7 @@ Rectangle { const ctx = getContext("2d") const w = width, h = height const cx = w / 2, cy = h / 2 - const r = Math.min(w, h) / 2 - 5 * scaling * contentScale + const r = Math.min(w, h) / 2 - 5 * contentScale // Rotated 90° to the right: gap at the bottom // Start at 150° and end at 390° (30°) → bottom opening @@ -67,7 +59,7 @@ Rectangle { const endBg = Math.PI * 13 / 6 // 390° (equivalent to 30°) ctx.reset() - ctx.lineWidth = 6 * scaling * contentScale + ctx.lineWidth = 6 * contentScale // Track uses surface for stronger contrast ctx.strokeStyle = Color.mSurface @@ -104,9 +96,9 @@ Rectangle { NText { id: valueLabel anchors.centerIn: parent - anchors.verticalCenterOffset: -4 * scaling * contentScale + anchors.verticalCenterOffset: -4 * contentScale text: `${root.value}${root.suffix}` - pointSize: Style.fontSizeM * scaling * contentScale * 0.9 + pointSize: Style.fontSizeM * contentScale * 0.9 font.weight: Style.fontWeightBold color: Color.mOnSurface horizontalAlignment: Text.AlignHCenter @@ -116,10 +108,10 @@ Rectangle { id: iconText anchors.horizontalCenter: parent.horizontalCenter anchors.top: valueLabel.bottom - anchors.topMargin: 8 * scaling * contentScale + anchors.topMargin: 8 * contentScale icon: root.icon color: Color.mPrimary - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } diff --git a/Widgets/NCollapsible.qml b/Widgets/NCollapsible.qml index 6b78f4fdf..3834220e2 100644 --- a/Widgets/NCollapsible.qml +++ b/Widgets/NCollapsible.qml @@ -8,7 +8,7 @@ ColumnLayout { property string description: "" property bool expanded: false property bool defaultExpanded: false - property real contentSpacing: Style.marginM * scaling + property real contentSpacing: Style.marginM signal toggled(bool expanded) Layout.fillWidth: true @@ -21,15 +21,15 @@ ColumnLayout { Rectangle { id: headerContainer Layout.fillWidth: true - Layout.preferredHeight: headerContent.implicitHeight + (Style.marginM * scaling * 2) + Layout.preferredHeight: headerContent.implicitHeight + (Style.marginM * 2) // Material 3 style background color: root.expanded ? Color.mSecondary : Color.mSurfaceVariant - radius: Style.radiusL * scaling + radius: Style.radiusL // Subtle border border.color: root.expanded ? Color.mOnSecondary : Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) // Smooth color transitions Behavior on color { @@ -75,14 +75,14 @@ ColumnLayout { RowLayout { id: headerContent anchors.fill: parent - anchors.margins: Style.marginM * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginM + spacing: Style.marginM // Expand/collapse icon with rotation animation NIcon { id: chevronIcon icon: "chevron-right" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: root.expanded ? Color.mOnSecondary : Color.mOnSurfaceVariant Layout.alignment: Qt.AlignVCenter @@ -105,11 +105,11 @@ ColumnLayout { RowLayout { Layout.fillWidth: true Layout.alignment: Qt.AlignVCenter - spacing: Style.marginL * scaling + spacing: Style.marginL NText { text: root.label - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightSemiBold color: root.expanded ? Color.mOnSecondary : Color.mOnSurface wrapMode: Text.WordWrap @@ -123,7 +123,7 @@ ColumnLayout { NText { text: root.description - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS font.weight: Style.fontWeightRegular color: root.expanded ? Color.mOnSecondary : Color.mOnSurfaceVariant Layout.fillWidth: true @@ -145,16 +145,16 @@ ColumnLayout { Rectangle { id: contentContainer Layout.fillWidth: true - Layout.topMargin: Style.marginS * scaling + Layout.topMargin: Style.marginS visible: root.expanded color: Color.mSurface - radius: Style.radiusL * scaling + radius: Style.radiusL border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) // Dynamic height based on content - Layout.preferredHeight: visible ? contentLayout.implicitHeight + (Style.marginL * scaling * 2) : 0 + Layout.preferredHeight: visible ? contentLayout.implicitHeight + (Style.marginL * 2) : 0 // Smooth height animation Behavior on Layout.preferredHeight { @@ -168,7 +168,7 @@ ColumnLayout { ColumnLayout { id: contentLayout anchors.fill: parent - anchors.margins: Style.marginL * scaling + anchors.margins: Style.marginL spacing: root.contentSpacing } diff --git a/Widgets/NColorPicker.qml b/Widgets/NColorPicker.qml index 642d74a9c..4aa9b46fb 100644 --- a/Widgets/NColorPicker.qml +++ b/Widgets/NColorPicker.qml @@ -12,13 +12,13 @@ Rectangle { signal colorSelected(color color) - implicitWidth: 150 * scaling - implicitHeight: Math.round(Style.baseWidgetSize * 1.1 * scaling) + implicitWidth: 150 + implicitHeight: Math.round(Style.baseWidgetSize * 1.1) - radius: Style.radiusM * scaling + radius: Style.radiusM color: Color.mSurface border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) // Minimized Look MouseArea { @@ -41,19 +41,19 @@ Rectangle { RowLayout { anchors.fill: parent anchors { - leftMargin: Style.marginL * scaling - rightMargin: Style.marginL * scaling + leftMargin: Style.marginL + rightMargin: Style.marginL } - spacing: Style.marginS * scaling + spacing: Style.marginS // Color preview circle Rectangle { - Layout.preferredWidth: root.height * 0.6 * scaling - Layout.preferredHeight: root.height * 0.6 * scaling + Layout.preferredWidth: root.height * 0.6 + Layout.preferredHeight: root.height * 0.6 radius: Layout.preferredWidth * 0.5 color: root.selectedColor border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) } NText { diff --git a/Widgets/NColorPickerDialog.qml b/Widgets/NColorPickerDialog.qml index de6bb0e96..364dd8f92 100644 --- a/Widgets/NColorPickerDialog.qml +++ b/Widgets/NColorPickerDialog.qml @@ -14,12 +14,12 @@ Popup { signal colorSelected(color color) - width: 580 * scaling + width: 580 height: { const h = scrollView.implicitHeight + padding * 2 - Math.min(h, screen?.height - Style.barHeight * scaling - Style.marginL * 2) + Math.min(h, screen?.height - Style.barHeight - Style.marginL * 2) } - padding: Style.marginXL * scaling + padding: Style.marginXL // Center popup in parent x: (parent.width - width) * 0.5 @@ -112,9 +112,9 @@ Popup { background: Rectangle { color: Color.mSurface - radius: Style.radiusS * scaling + radius: Style.radiusS border.color: Color.mPrimary - border.width: Math.max(1, Style.borderM * scaling) + border.width: Math.max(1, Style.borderM) } contentItem: NScrollView { @@ -126,24 +126,24 @@ Popup { ColumnLayout { width: scrollView.availableWidth - spacing: Style.marginL * scaling + spacing: Style.marginL // Header RowLayout { Layout.fillWidth: true RowLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS NIcon { icon: "color-picker" - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL color: Color.mPrimary } NText { text: I18n.tr("widgets.color-picker.title") - pointSize: Style.fontSizeXL * scaling + pointSize: Style.fontSizeXL font.weight: Style.fontWeightBold color: Color.mPrimary } @@ -162,11 +162,11 @@ Popup { // Color preview section Rectangle { Layout.fillWidth: true - Layout.preferredHeight: 80 * scaling - radius: Style.radiusS * scaling + Layout.preferredHeight: 80 + radius: Style.radiusS color: root.selectedColor border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) ColumnLayout { spacing: 0 @@ -179,7 +179,7 @@ Popup { NText { text: root.selectedColor.toString().toUpperCase() family: Settings.data.ui.fontFixed - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Font.Bold color: root.selectedColor.r + root.selectedColor.g + root.selectedColor.b > 1.5 ? "#000000" : "#FFFFFF" Layout.alignment: Qt.AlignHCenter @@ -188,7 +188,7 @@ Popup { NText { text: "RGB(" + Math.round(root.selectedColor.r * 255) + ", " + Math.round(root.selectedColor.g * 255) + ", " + Math.round(root.selectedColor.b * 255) + ")" family: Settings.data.ui.fontFixed - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: root.selectedColor.r + root.selectedColor.g + root.selectedColor.b > 1.5 ? "#000000" : "#FFFFFF" Layout.alignment: Qt.AlignHCenter } @@ -202,7 +202,7 @@ Popup { // Hex input RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NLabel { label: I18n.tr("widgets.color-picker.hex.label") @@ -225,13 +225,13 @@ Popup { // RGB sliders section NBox { Layout.fillWidth: true - Layout.preferredHeight: slidersSection.implicitHeight + Style.marginL * scaling * 2 + Layout.preferredHeight: slidersSection.implicitHeight + Style.marginL * 2 ColumnLayout { id: slidersSection anchors.fill: parent - anchors.margins: Style.marginL * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginL + spacing: Style.marginM NLabel { label: I18n.tr("widgets.color-picker.rgb.label") @@ -241,12 +241,12 @@ Popup { RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NText { text: "R" font.weight: Font.Bold - Layout.preferredWidth: 20 * scaling + Layout.preferredWidth: 20 } NValueSlider { @@ -267,12 +267,12 @@ Popup { RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NText { text: "G" font.weight: Font.Bold - Layout.preferredWidth: 20 * scaling + Layout.preferredWidth: 20 } NValueSlider { @@ -294,12 +294,12 @@ Popup { RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NText { text: "B" font.weight: Font.Bold - Layout.preferredWidth: 20 * scaling + Layout.preferredWidth: 20 } NValueSlider { @@ -321,12 +321,12 @@ Popup { RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NText { text: I18n.tr("widgets.color-picker.brightness") font.weight: Font.Bold - Layout.preferredWidth: 80 * scaling + Layout.preferredWidth: 80 } NValueSlider { @@ -361,13 +361,13 @@ Popup { NBox { Layout.fillWidth: true - Layout.preferredHeight: themePalette.implicitHeight + Style.marginL * scaling * 2 + Layout.preferredHeight: themePalette.implicitHeight + Style.marginL * 2 ColumnLayout { id: themePalette anchors.fill: parent - anchors.margins: Style.marginL * scaling - spacing: Style.marginS * scaling + anchors.margins: Style.marginL + spacing: Style.marginS NLabel { label: I18n.tr("widgets.color-picker.theme-colors.label") @@ -376,7 +376,7 @@ Popup { } Flow { - spacing: 6 * scaling + spacing: 6 Layout.fillWidth: true flow: Flow.LeftToRight @@ -384,12 +384,12 @@ Popup { model: [Color.mPrimary, Color.mSecondary, Color.mTertiary, Color.mError, Color.mSurface, Color.mSurfaceVariant, Color.mOutline, "#FFFFFF", "#000000"] Rectangle { - width: 24 * scaling - height: 24 * scaling - radius: 4 * scaling + width: 24 + height: 24 + radius: 4 color: modelData border.color: root.selectedColor === modelData ? Color.mPrimary : Color.mOutline - border.width: root.selectedColor === modelData ? 2 * scaling : 1 * scaling + border.width: root.selectedColor === modelData ? 2 : 1 MouseArea { anchors.fill: parent @@ -409,13 +409,13 @@ Popup { NBox { Layout.fillWidth: true - Layout.preferredHeight: genericPalette.implicitHeight + Style.marginL * scaling * 2 + Layout.preferredHeight: genericPalette.implicitHeight + Style.marginL * 2 ColumnLayout { id: genericPalette anchors.fill: parent - anchors.margins: Style.marginL * scaling - spacing: Style.marginS * scaling + anchors.margins: Style.marginL + spacing: Style.marginS NLabel { label: I18n.tr("widgets.color-picker.palette.label") @@ -426,19 +426,19 @@ Popup { Flow { Layout.fillWidth: true Layout.fillHeight: true - spacing: 6 * scaling + spacing: 6 flow: Flow.LeftToRight Repeater { model: ["#F44336", "#E91E63", "#9C27B0", "#673AB7", "#3F51B5", "#2196F3", "#03A9F4", "#00BCD4", "#009688", "#4CAF50", "#8BC34A", "#CDDC39", "#FFEB3B", "#FFC107", "#FF9800", "#FF5722", "#795548", "#9E9E9E", "#E74C3C", "#E67E22", "#F1C40F", "#2ECC71", "#1ABC9C", "#3498DB", "#2980B9", "#9B59B6", "#34495E", "#2C3E50", "#95A5A6", "#7F8C8D", "#FFFFFF", "#000000"] Rectangle { - width: 24 * scaling - height: 24 * scaling - radius: Style.radiusXXS * scaling + width: 24 + height: 24 + radius: Style.radiusXXS color: modelData border.color: root.selectedColor === modelData ? Color.mPrimary : Color.mOutline - border.width: Math.max(1, root.selectedColor === modelData ? Style.borderM * scaling : Style.borderS * scaling) + border.width: Math.max(1, root.selectedColor === modelData ? Style.borderM : Style.borderS) MouseArea { anchors.fill: parent @@ -458,9 +458,9 @@ Popup { RowLayout { Layout.fillWidth: true - Layout.topMargin: 20 * scaling - Layout.bottomMargin: 20 * scaling - spacing: 10 * scaling + Layout.topMargin: 20 + Layout.bottomMargin: 20 + spacing: 10 Item { Layout.fillWidth: true diff --git a/Widgets/NComboBox.qml b/Widgets/NComboBox.qml index a7a054b5a..60dce4367 100644 --- a/Widgets/NComboBox.qml +++ b/Widgets/NComboBox.qml @@ -8,8 +8,8 @@ import qs.Widgets RowLayout { id: root - property real minimumWidth: 280 * scaling - property real popupHeight: 180 * scaling + property real minimumWidth: 280 + property real popupHeight: 180 property string label: "" property string description: "" @@ -17,11 +17,11 @@ RowLayout { property string currentKey: "" property string placeholder: "" - readonly property real preferredHeight: Style.baseWidgetSize * 1.1 * scaling + readonly property real preferredHeight: Style.baseWidgetSize * 1.1 signal selected(string key) - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true function itemCount() { @@ -72,12 +72,12 @@ RowLayout { } background: Rectangle { - implicitWidth: Style.baseWidgetSize * 3.75 * scaling + implicitWidth: Style.baseWidgetSize * 3.75 implicitHeight: preferredHeight color: Color.mSurface border.color: combo.activeFocus ? Color.mSecondary : Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) - radius: Style.radiusM * scaling + border.width: Math.max(1, Style.borderS) + radius: Style.radiusM Behavior on border.color { ColorAnimation { @@ -87,9 +87,9 @@ RowLayout { } contentItem: NText { - leftPadding: Style.marginL * scaling - rightPadding: combo.indicator.width + Style.marginL * scaling - pointSize: Style.fontSizeM * scaling + leftPadding: Style.marginL + rightPadding: combo.indicator.width + Style.marginL + pointSize: Style.fontSizeM verticalAlignment: Text.AlignVCenter elide: Text.ElideRight color: (combo.currentIndex >= 0 && combo.currentIndex < itemCount()) ? Color.mOnSurface : Color.mOnSurfaceVariant @@ -97,17 +97,17 @@ RowLayout { } indicator: NIcon { - x: combo.width - width - Style.marginM * scaling + x: combo.width - width - Style.marginM y: combo.topPadding + (combo.availableHeight - height) / 2 icon: "caret-down" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL } popup: Popup { y: combo.height - implicitWidth: combo.width - Style.marginM * scaling - implicitHeight: Math.min(root.popupHeight, contentItem.implicitHeight + Style.marginM * scaling * 2) - padding: Style.marginM * scaling + implicitWidth: combo.width - Style.marginM + implicitHeight: Math.min(root.popupHeight, contentItem.implicitHeight + Style.marginM * 2) + padding: Style.marginM onOpened: { PanelService.willOpenPopup(root) @@ -144,9 +144,9 @@ RowLayout { } background: Rectangle { - width: combo.width - Style.marginM * scaling * 3 + width: combo.width - Style.marginM * 3 color: highlighted ? Color.mTertiary : Color.transparent - radius: Style.radiusS * scaling + radius: Style.radiusS Behavior on color { ColorAnimation { duration: Style.animationFast @@ -159,7 +159,7 @@ RowLayout { var item = root.getItem(index) return item && item.name ? item.name : "" } - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: highlighted ? Color.mOnTertiary : Color.mOnSurface verticalAlignment: Text.AlignVCenter elide: Text.ElideRight @@ -175,8 +175,8 @@ RowLayout { background: Rectangle { color: Color.mSurfaceVariant border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) - radius: Style.radiusM * scaling + border.width: Math.max(1, Style.borderS) + radius: Style.radiusM } } diff --git a/Widgets/NContextMenu.qml b/Widgets/NContextMenu.qml index 126f28927..9f8e833e0 100644 --- a/Widgets/NContextMenu.qml +++ b/Widgets/NContextMenu.qml @@ -8,13 +8,13 @@ Popup { id: root property alias model: listView.model - property real itemHeight: 36 * scaling - property real itemPadding: Style.marginM * scaling + property real itemHeight: 36 + property real itemPadding: Style.marginM signal triggered(string action) - width: 180 * scaling - padding: Style.marginS * scaling + width: 180 + padding: Style.marginS onOpened: PanelService.willOpenPopup(root) onClosed: PanelService.willClosePopup(root) @@ -22,14 +22,14 @@ Popup { background: Rectangle { color: Color.mSurfaceVariant border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) - radius: Style.radiusM * scaling + border.width: Math.max(1, Style.borderS) + radius: Style.radiusM } contentItem: NListView { id: listView implicitHeight: contentHeight - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS interactive: contentHeight > root.height delegate: ItemDelegate { @@ -45,7 +45,7 @@ Popup { background: Rectangle { color: menuItem.hovered && menuItem.enabled ? Color.mTertiary : Color.transparent - radius: Style.radiusS * scaling + radius: Style.radiusS Behavior on color { ColorAnimation { @@ -55,13 +55,13 @@ Popup { } contentItem: RowLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS // Optional icon NIcon { visible: modelData.icon !== undefined icon: modelData.icon || "" - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: menuItem.hovered && menuItem.enabled ? Color.mOnTertiary : Color.mOnSurface Layout.leftMargin: root.itemPadding @@ -74,7 +74,7 @@ Popup { NText { text: modelData.label || modelData.text || "" - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: menuItem.hovered && menuItem.enabled ? Color.mOnTertiary : Color.mOnSurface verticalAlignment: Text.AlignVCenter Layout.fillWidth: true diff --git a/Widgets/NDateTimeTokens.qml b/Widgets/NDateTimeTokens.qml index 1ad1ec945..4f6c2b9e8 100644 --- a/Widgets/NDateTimeTokens.qml +++ b/Widgets/NDateTimeTokens.qml @@ -7,8 +7,8 @@ Rectangle { id: root color: Color.mSurface border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) - radius: Style.radiusM * scaling + border.width: Math.max(1, Style.borderS) + radius: Style.radiusM property date sampleDate: new Date() // Dec 25, 2023, 2:30:45.123 PM @@ -18,8 +18,8 @@ Rectangle { ColumnLayout { id: column anchors.fill: parent - anchors.margins: Style.marginS * scaling - spacing: Style.marginS * scaling + anchors.margins: Style.marginS + spacing: Style.marginS NListView { id: tokensList @@ -174,8 +174,8 @@ Rectangle { delegate: Rectangle { id: tokenDelegate width: tokensList.width - height: layout.implicitHeight + Style.marginS * scaling - radius: Style.radiusS * scaling + height: layout.implicitHeight + Style.marginS + radius: Style.radiusS color: { if (tokenMouseArea.containsMouse) { return Qt.alpha(Color.mPrimary, 0.1) @@ -216,16 +216,16 @@ Rectangle { RowLayout { id: layout anchors.fill: parent - anchors.margins: Style.marginXS * scaling - spacing: Style.marginM * scaling + anchors.margins: Style.marginXS + spacing: Style.marginM // Category badge Rectangle { Layout.alignment: Qt.AlignVCenter - width: 70 * scaling - height: 22 * scaling + width: 70 + height: 22 color: getCategoryColor(modelData.category)[0] - radius: Style.radiusS * scaling + radius: Style.radiusS opacity: tokenMouseArea.containsMouse ? 0.9 : 1.0 Behavior on opacity { @@ -238,7 +238,7 @@ Rectangle { anchors.centerIn: parent text: modelData.category color: getCategoryColor(modelData.category)[1] - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS } } @@ -246,10 +246,10 @@ Rectangle { Rectangle { id: tokenButton Layout.alignment: Qt.AlignVCenter // Added this line - width: 100 * scaling - height: 22 * scaling + width: 100 + height: 22 color: tokenMouseArea.containsMouse ? Color.mPrimary : Color.mOnSurface - radius: Style.radiusS * scaling + radius: Style.radiusS Behavior on color { ColorAnimation { @@ -261,7 +261,7 @@ Rectangle { anchors.centerIn: parent text: modelData.token color: tokenMouseArea.containsMouse ? Color.mOnPrimary : Color.mSurface - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS font.weight: Style.fontWeightBold Behavior on color { @@ -278,7 +278,7 @@ Rectangle { Layout.alignment: Qt.AlignVCenter // Added this line text: modelData.description color: tokenMouseArea.containsMouse ? Color.mOnSurface : Color.mOnSurfaceVariant - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS wrapMode: Text.WordWrap Behavior on color { @@ -291,12 +291,12 @@ Rectangle { // Live example Rectangle { Layout.alignment: Qt.AlignVCenter // Added this line - width: 90 * scaling - height: 22 * scaling + width: 90 + height: 22 color: tokenMouseArea.containsMouse ? Color.mPrimary : Color.mOnSurfaceVariant - radius: Style.radiusS * scaling + radius: Style.radiusS border.color: tokenMouseArea.containsMouse ? Color.mPrimary : Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) Behavior on color { ColorAnimation { @@ -314,7 +314,7 @@ Rectangle { anchors.centerIn: parent text: Qt.locale().toString(root.sampleDate, modelData.token) color: tokenMouseArea.containsMouse ? Color.mOnPrimary : Color.mSurfaceVariant - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS Behavior on color { ColorAnimation { diff --git a/Widgets/NDivider.qml b/Widgets/NDivider.qml index a95df11db..98f4d1d45 100644 --- a/Widgets/NDivider.qml +++ b/Widgets/NDivider.qml @@ -6,7 +6,7 @@ import qs.Services Rectangle { width: parent.width - height: Math.max(1, Style.borderS * scaling) + height: Math.max(1, Style.borderS) gradient: Gradient { orientation: Gradient.Horizontal GradientStop { diff --git a/Widgets/NFilePicker.qml b/Widgets/NFilePicker.qml index 4013c59c3..4fd7875e5 100644 --- a/Widgets/NFilePicker.qml +++ b/Widgets/NFilePicker.qml @@ -19,7 +19,7 @@ Popup { property var nameFilters: ["*"] property bool showDirs: true property bool showHiddenFiles: false - property real scaling: 1.0 + property var selectedPaths: [] property string currentPath: initialPath property bool shouldResetSelection: false @@ -137,23 +137,23 @@ Popup { } } - width: 900 * scaling - height: 700 * scaling + width: 900 + height: 700 modal: true closePolicy: Popup.CloseOnEscape anchors.centerIn: Overlay.overlay background: Rectangle { color: Color.mSurfaceVariant - radius: Style.radiusL * scaling + radius: Style.radiusL border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) } Rectangle { id: filePickerPanel anchors.fill: parent - anchors.margins: Style.marginL * scaling + anchors.margins: Style.marginL color: Color.transparent property string filterText: "" @@ -181,21 +181,21 @@ Popup { ColumnLayout { anchors.fill: parent - spacing: Style.marginM * scaling + spacing: Style.marginM // Header RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NIcon { icon: "filepicker-folder" color: Color.mPrimary - pointSize: Style.fontSizeXXL * scaling + pointSize: Style.fontSizeXXL } NText { text: root.title - pointSize: Style.fontSizeXL * scaling + pointSize: Style.fontSizeXL font.weight: Style.fontWeightBold color: Color.mPrimary Layout.fillWidth: true @@ -240,19 +240,19 @@ Popup { // Navigation toolbar Rectangle { Layout.fillWidth: true - Layout.preferredHeight: 45 * scaling + Layout.preferredHeight: 45 color: Color.mSurfaceVariant - radius: Style.radiusS * scaling + radius: Style.radiusS border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) RowLayout { anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: Style.marginS * scaling - anchors.rightMargin: Style.marginS * scaling - spacing: Style.marginS * scaling + anchors.leftMargin: Style.marginS + anchors.rightMargin: Style.marginS + spacing: Style.marginS NIconButton { icon: "filepicker-arrow-up" @@ -339,25 +339,25 @@ Popup { // Search bar Rectangle { Layout.fillWidth: true - Layout.preferredHeight: 45 * scaling + Layout.preferredHeight: 45 color: Color.mSurfaceVariant - radius: Style.radiusS * scaling + radius: Style.radiusS border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) visible: filePickerPanel.showSearchBar RowLayout { anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: Style.marginS * scaling - anchors.rightMargin: Style.marginS * scaling - spacing: Style.marginS * scaling + anchors.leftMargin: Style.marginS + anchors.rightMargin: Style.marginS + spacing: Style.marginS NIcon { icon: "filepicker-search" color: Color.mOnSurfaceVariant - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS } NTextInput { id: searchInput @@ -396,9 +396,9 @@ Popup { Layout.fillWidth: true Layout.fillHeight: true color: Color.mSurface - radius: Style.radiusM * scaling + radius: Style.radiusM border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) FolderListModel { id: folderModel @@ -447,9 +447,9 @@ Popup { ScrollBar { policy: ScrollBar.AsNeeded contentItem: Rectangle { - implicitWidth: 6 * scaling + implicitWidth: 6 implicitHeight: 100 - radius: Style.radiusM * scaling + radius: Style.radiusM color: parent.pressed ? Qt.alpha(Color.mTertiary, 0.8) : parent.hovered ? Qt.alpha(Color.mTertiary, 0.8) : Qt.alpha(Color.mTertiary, 0.8) opacity: parent.policy === ScrollBar.AlwaysOn || parent.active ? 1.0 : 0.0 Behavior on opacity { @@ -464,11 +464,11 @@ Popup { } } background: Rectangle { - implicitWidth: 6 * scaling + implicitWidth: 6 implicitHeight: 100 color: Color.transparent opacity: parent.policy === ScrollBar.AlwaysOn || parent.active ? 0.3 : 0.0 - radius: (Style.radiusM * scaling) / 2 + radius: (Style.radiusM) / 2 Behavior on opacity { NumberAnimation { duration: Style.animationFast @@ -482,22 +482,22 @@ Popup { GridView { id: gridView anchors.fill: parent - anchors.margins: Style.marginM * scaling + anchors.margins: Style.marginM model: filteredModel visible: filePickerPanel.viewMode clip: true reuseItems: true - property int columns: Math.max(1, Math.floor(width / (120 * scaling))) - property int itemSize: Math.floor((width - leftMargin - rightMargin - (columns * Style.marginS * scaling)) / columns) + property int columns: Math.max(1, Math.floor(width / (120))) + property int itemSize: Math.floor((width - leftMargin - rightMargin - (columns * Style.marginS)) / columns) cellWidth: Math.floor((width - leftMargin - rightMargin) / columns) - cellHeight: Math.floor(itemSize * 0.8) + Style.marginXS * scaling + Style.fontSizeS * scaling + Style.marginM * scaling + cellHeight: Math.floor(itemSize * 0.8) + Style.marginXS + Style.fontSizeS + Style.marginM - leftMargin: Style.marginS * scaling - rightMargin: Style.marginS * scaling - topMargin: Style.marginS * scaling - bottomMargin: Style.marginS * scaling + leftMargin: Style.marginS + rightMargin: Style.marginS + topMargin: Style.marginS + bottomMargin: Style.marginS ScrollBar.vertical: scrollBarComponent.createObject(gridView, { "parent": gridView, @@ -511,7 +511,7 @@ Popup { width: gridView.itemSize height: gridView.cellHeight color: Color.transparent - radius: Style.radiusM * scaling + radius: Style.radiusM property bool isSelected: filePickerPanel.currentSelection.includes(model.filePath) @@ -520,7 +520,7 @@ Popup { color: Color.transparent radius: parent.radius border.color: isSelected ? Color.mSecondary : Color.mSurface - border.width: Math.max(1, Style.borderL * scaling) + border.width: Math.max(1, Style.borderL) Behavior on color { ColorAnimation { duration: Style.animationFast @@ -533,7 +533,7 @@ Popup { color: (mouseArea.containsMouse && !isSelected) ? Color.mTertiary : Color.transparent radius: parent.radius border.color: (mouseArea.containsMouse && !isSelected) ? Color.mTertiary : Color.transparent - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) Behavior on color { ColorAnimation { duration: Style.animationFast @@ -548,8 +548,8 @@ Popup { ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginS * scaling - spacing: Style.marginXS * scaling + anchors.margins: Style.marginS + spacing: Style.marginXS Rectangle { id: iconContainer @@ -567,15 +567,15 @@ Popup { Image { id: thumbnail anchors.fill: parent - anchors.margins: Style.marginXS * scaling + anchors.margins: Style.marginXS source: iconContainer.isImage ? "file://" + model.filePath : "" fillMode: Image.PreserveAspectFit visible: iconContainer.isImage && status === Image.Ready smooth: false cache: true asynchronous: true - sourceSize.width: 120 * scaling - sourceSize.height: 120 * scaling + sourceSize.width: 120 + sourceSize.height: 120 onStatusChanged: { if (status === Image.Error) visible = false @@ -584,11 +584,11 @@ Popup { Rectangle { anchors.fill: parent color: Color.mSurfaceVariant - radius: Style.radiusS * scaling + radius: Style.radiusS visible: thumbnail.status === Image.Loading NIcon { icon: "filepicker-photo" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: Color.mOnSurfaceVariant anchors.centerIn: parent } @@ -597,7 +597,7 @@ Popup { NIcon { icon: model.fileIsDir ? "filepicker-folder" : root.getFileIcon(model.fileName) - pointSize: Style.fontSizeXXL * 2 * scaling + pointSize: Style.fontSizeXXL * 2 color: { if (isSelected) return Color.mSecondary @@ -613,17 +613,17 @@ Popup { Rectangle { anchors.top: parent.top anchors.right: parent.right - anchors.margins: Style.marginS * scaling - width: 24 * scaling - height: 24 * scaling + anchors.margins: Style.marginS + width: 24 + height: 24 radius: width / 2 color: Color.mSecondary border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) visible: isSelected NIcon { icon: "filepicker-check" - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS font.weight: Style.fontWeightBold color: Color.mOnSecondary anchors.centerIn: parent @@ -641,7 +641,7 @@ Popup { else return Color.mOnSurfaceVariant } - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS font.weight: isSelected ? Style.fontWeightBold : Style.fontWeightRegular Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter @@ -697,14 +697,14 @@ Popup { NListView { id: listView anchors.fill: parent - anchors.margins: Style.marginS * scaling + anchors.margins: Style.marginS model: filteredModel visible: !filePickerPanel.viewMode delegate: Rectangle { id: listItem width: listView.width - height: 40 * scaling + height: 40 color: { if (filePickerPanel.currentSelection.includes(model.filePath)) return Color.mSecondary @@ -712,7 +712,7 @@ Popup { return Color.mTertiary return Color.transparent } - radius: Style.radiusS * scaling + radius: Style.radiusS Behavior on color { ColorAnimation { duration: Style.animationFast @@ -721,20 +721,20 @@ Popup { RowLayout { anchors.fill: parent - anchors.leftMargin: Style.marginM * scaling - anchors.rightMargin: Style.marginM * scaling - spacing: Style.marginM * scaling + anchors.leftMargin: Style.marginM + anchors.rightMargin: Style.marginM + spacing: Style.marginM NIcon { icon: model.fileIsDir ? "filepicker-folder" : root.getFileIcon(model.fileName) - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL color: model.fileIsDir ? (filePickerPanel.currentSelection.includes(model.filePath) ? Color.mOnSecondary : Color.mPrimary) : Color.mOnSurfaceVariant } NText { text: model.fileName color: filePickerPanel.currentSelection.includes(model.filePath) ? Color.mOnSecondary : Color.mOnSurface - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: filePickerPanel.currentSelection.includes(model.filePath) ? Style.fontWeightBold : Style.fontWeightRegular Layout.fillWidth: true elide: Text.ElideRight @@ -743,7 +743,7 @@ Popup { NText { text: model.fileIsDir ? "" : root.formatFileSize(model.fileSize) color: filePickerPanel.currentSelection.includes(model.filePath) ? Color.mOnSecondary : Color.mOnSurfaceVariant - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS visible: !model.fileIsDir Layout.preferredWidth: implicitWidth } @@ -795,7 +795,7 @@ Popup { // Footer RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NText { text: { @@ -809,7 +809,7 @@ Popup { } } color: filePickerPanel.searchText.length > 0 ? Color.mPrimary : Color.mOnSurfaceVariant - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS Layout.fillWidth: true } diff --git a/Widgets/NHeader.qml b/Widgets/NHeader.qml index dfbcfd543..08d58e017 100644 --- a/Widgets/NHeader.qml +++ b/Widgets/NHeader.qml @@ -8,13 +8,13 @@ ColumnLayout { property string label: "" property string description: "" - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true - Layout.bottomMargin: Style.marginM * scaling + Layout.bottomMargin: Style.marginM NText { text: root.label - pointSize: Style.fontSizeXL * scaling + pointSize: Style.fontSizeXL font.weight: Style.fontWeightBold color: Color.mSecondary visible: root.label !== "" @@ -22,7 +22,7 @@ ColumnLayout { NText { text: root.description - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant wrapMode: Text.WordWrap Layout.fillWidth: true diff --git a/Widgets/NIcon.qml b/Widgets/NIcon.qml index adca75f69..f1606d9b6 100644 --- a/Widgets/NIcon.qml +++ b/Widgets/NIcon.qml @@ -7,7 +7,7 @@ Text { id: root property string icon: Icons.defaultIcon - property real pointSize: Style.fontSizeL * scaling + property real pointSize: Style.fontSizeL visible: (icon !== undefined) && (icon !== "") text: { diff --git a/Widgets/NIconButton.qml b/Widgets/NIconButton.qml index e2d0d0fa6..614c06feb 100644 --- a/Widgets/NIconButton.qml +++ b/Widgets/NIconButton.qml @@ -30,14 +30,14 @@ Rectangle { signal rightClicked signal middleClicked - implicitWidth: Math.round(baseSize * scaling) - implicitHeight: Math.round(baseSize * scaling) + implicitWidth: Math.round(baseSize) + implicitHeight: Math.round(baseSize) opacity: root.enabled ? Style.opacityFull : Style.opacityMedium color: root.enabled && root.hovering ? colorBgHover : colorBg radius: width * 0.5 border.color: root.enabled && root.hovering ? colorBorderHover : colorBorder - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) Behavior on color { ColorAnimation { diff --git a/Widgets/NIconPicker.qml b/Widgets/NIconPicker.qml index 6a5cc45d8..7ae7a8f55 100644 --- a/Widgets/NIconPicker.qml +++ b/Widgets/NIconPicker.qml @@ -16,17 +16,17 @@ Popup { signal iconSelected(string iconName) width: { - var w = Math.round(Math.max(screen.width * 0.35, 900) * scaling) + var w = Math.round(Math.max(screen.width * 0.35, 900)) w = Math.min(w, screen.width - Style.marginL * 2) return w } height: { - var h = Math.round(Math.max(screen.height * 0.65, 700) * scaling) - h = Math.min(h, screen.height - Style.barHeight * scaling - Style.marginL * 2) + var h = Math.round(Math.max(screen.height * 0.65, 700)) + h = Math.min(h, screen.height - Style.barHeight - Style.marginL * 2) return h } anchors.centerIn: Overlay.overlay - padding: Style.marginXL * scaling + padding: Style.marginXL property string query: "" property var allIcons: Object.keys(Icons.icons) @@ -38,7 +38,7 @@ Popup { } readonly property int columns: 6 readonly property int cellW: Math.floor(grid.width / columns) - readonly property int cellH: Math.round(cellW * 0.7 + 36 * scaling) + readonly property int cellH: Math.round(cellW * 0.7 + 36) onOpened: { selectedIcon = initialIcon @@ -53,21 +53,21 @@ Popup { background: Rectangle { color: Color.mSurface - radius: Style.radiusL * scaling + radius: Style.radiusL border.color: Color.mPrimary - border.width: Style.borderM * scaling + border.width: Style.borderM } ColumnLayout { anchors.fill: parent - spacing: Style.marginM * scaling + spacing: Style.marginM // Title row RowLayout { Layout.fillWidth: true NText { text: I18n.tr("widgets.icon-picker.title") - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: Color.mPrimary Layout.fillWidth: true @@ -84,7 +84,7 @@ Popup { RowLayout { Layout.fillWidth: true - spacing: Style.marginS * scaling + spacing: Style.marginS NTextInput { id: searchInput Layout.fillWidth: true @@ -100,7 +100,7 @@ Popup { id: grid Layout.fillWidth: true Layout.fillHeight: true - Layout.margins: Style.marginM * scaling + Layout.margins: Style.marginM cellWidth: root.cellW cellHeight: root.cellH model: root.filteredIcons @@ -109,11 +109,11 @@ Popup { delegate: Rectangle { width: grid.cellWidth height: grid.cellHeight - radius: Style.radiusS * scaling + radius: Style.radiusS color: (root.selectedIcon === modelData) ? Qt.alpha(Color.mPrimary, 0.15) : Color.transparent border.color: (root.selectedIcon === modelData) ? Color.mPrimary : Qt.rgba(0, 0, 0, 0) - border.width: (root.selectedIcon === modelData) ? Style.borderS * scaling : 0 + border.width: (root.selectedIcon === modelData) ? Style.borderS : 0 MouseArea { anchors.fill: parent @@ -127,27 +127,27 @@ Popup { ColumnLayout { anchors.fill: parent - anchors.margins: Style.marginS * scaling - spacing: Style.marginS * scaling + anchors.margins: Style.marginS + spacing: Style.marginS Item { Layout.fillHeight: true - Layout.preferredHeight: 4 * scaling + Layout.preferredHeight: 4 } NIcon { Layout.alignment: Qt.AlignHCenter icon: modelData - pointSize: 42 * scaling + pointSize: 42 } NText { Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true - Layout.topMargin: Style.marginXS * scaling + Layout.topMargin: Style.marginXS elide: Text.ElideRight wrapMode: Text.NoWrap maximumLineCount: 1 horizontalAlignment: Text.AlignHCenter color: Color.mOnSurfaceVariant - pointSize: Style.fontSizeXS * scaling + pointSize: Style.fontSizeXS text: modelData } Item { @@ -159,7 +159,7 @@ Popup { RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM Item { Layout.fillWidth: true } diff --git a/Widgets/NImageCircled.qml b/Widgets/NImageCircled.qml index eb0ee9bd8..55ef75688 100644 --- a/Widgets/NImageCircled.qml +++ b/Widgets/NImageCircled.qml @@ -12,11 +12,11 @@ Rectangle { property color borderColor: Color.transparent property real borderWidth: 0 property string fallbackIcon: "" - property real fallbackIconSize: Style.fontSizeXXL * scaling + property real fallbackIconSize: Style.fontSizeXXL color: Color.transparent radius: parent.width * 0.5 - anchors.margins: Style.marginXXS * scaling + anchors.margins: Style.marginXXS Rectangle { color: Color.transparent diff --git a/Widgets/NImageRounded.qml b/Widgets/NImageRounded.qml index ff55a571d..32987e281 100644 --- a/Widgets/NImageRounded.qml +++ b/Widgets/NImageRounded.qml @@ -13,7 +13,7 @@ Rectangle { property real borderWidth: 0 property real imageRadius: width * 0.5 property string fallbackIcon: "" - property real fallbackIconSize: Style.fontSizeXXL * scaling + property real fallbackIconSize: Style.fontSizeXXL property real scaledRadius: imageRadius * Settings.data.general.radiusRatio @@ -21,7 +21,7 @@ Rectangle { color: Color.transparent radius: scaledRadius - anchors.margins: Style.marginXXS * scaling + anchors.margins: Style.marginXXS Rectangle { color: Color.transparent diff --git a/Widgets/NInputAction.qml b/Widgets/NInputAction.qml index d689d3049..a1e683da2 100644 --- a/Widgets/NInputAction.qml +++ b/Widgets/NInputAction.qml @@ -22,8 +22,7 @@ RowLayout { signal actionClicked // Internal properties - property real scaling: 1.0 - spacing: Style.marginM * scaling + spacing: Style.marginM NTextInput { id: textInput diff --git a/Widgets/NLabel.qml b/Widgets/NLabel.qml index 8348fd0c0..f1a424402 100644 --- a/Widgets/NLabel.qml +++ b/Widgets/NLabel.qml @@ -10,12 +10,12 @@ ColumnLayout { property color labelColor: Color.mOnSurface property color descriptionColor: Color.mOnSurfaceVariant - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS Layout.fillWidth: true NText { text: label - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL font.weight: Style.fontWeightBold color: labelColor visible: label !== "" @@ -24,7 +24,7 @@ ColumnLayout { NText { text: description - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: descriptionColor wrapMode: Text.WordWrap visible: description !== "" diff --git a/Widgets/NListView.qml b/Widgets/NListView.qml index 6731d7cea..115bac498 100644 --- a/Widgets/NListView.qml +++ b/Widgets/NListView.qml @@ -10,8 +10,8 @@ Item { property color handleHoverColor: handleColor property color handlePressedColor: handleColor property color trackColor: Color.transparent - property real handleWidth: 6 * scaling - property real handleRadius: Style.radiusM * scaling + property real handleWidth: 6 + property real handleRadius: Style.radiusM property int verticalPolicy: ScrollBar.AsNeeded property int horizontalPolicy: ScrollBar.AsNeeded diff --git a/Widgets/NPanel.qml b/Widgets/NPanel.qml index e7c4c8a36..1003929b5 100644 --- a/Widgets/NPanel.qml +++ b/Widgets/NPanel.qml @@ -8,7 +8,6 @@ Loader { id: root property ShellScreen screen - property real scaling: 1.0 property Component panelContent: null property real preferredWidth: 700 @@ -131,49 +130,30 @@ Loader { // ----------------------------------------- sourceComponent: Component { + // PanelWindow has its own screen property inherited of QsWindow PanelWindow { id: panelWindow - // PanelWindow has its own screen property inherited of QsWindow - property real scaling: ScalingService.getScreenScale(screen) - 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 * scaling) + readonly property real verticalBarWidth: Math.round(Style.barHeight) Component.onCompleted: { Logger.log("NPanel", "Opened", root.objectName, "on", screen.name) dimmingOpacity = Style.opacityHeavy - root.scaling = scaling = ScalingService.getScreenScale(screen) - + // Force refresh panel content when scaling is applied Qt.callLater(() => { - panelContentLoader.active = false - panelContentLoader.active = true - }) - } - - Connections { - target: ScalingService - function onScaleChanged(screenName, scale) { - if ((screen !== null) && (screenName === screen.name)) { - root.scaling = scaling = scale - - // Force refresh panel content when scaling changes - Qt.callLater(() => { - panelContentLoader.active = false - panelContentLoader.active = true - }) - } - } + panelContentLoader.active = false + panelContentLoader.active = true + }) } Connections { target: panelWindow function onScreenChanged() { root.screen = screen - root.scaling = scaling = ScalingService.getScreenScale(screen) // It's mandatory to force refresh the subloader to ensure the scaling is properly dispatched panelContentLoader.active = false @@ -183,7 +163,7 @@ Loader { if (buttonName) { setPosition() } - // Logger.log("NPanel", "OnScreenChanged", root.screen.name) + Logger.log("NPanel", "OnScreenChanged", root.screen.name) } } @@ -230,9 +210,9 @@ Loader { Rectangle { id: panelBackground color: panelBackgroundColor - radius: Style.radiusL * scaling + radius: Style.radiusL border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) // Dragging support property bool draggable: root.draggable property bool isDragged: false @@ -241,9 +221,9 @@ Loader { width: { var w if (preferredWidthRatio !== undefined) { - w = Math.round(Math.max(screen?.width * preferredWidthRatio, preferredWidth) * scaling) + w = Math.round(Math.max(screen?.width * preferredWidthRatio, preferredWidth)) } else { - w = preferredWidth * scaling + w = preferredWidth } // Clamp width so it is never bigger than the screen return Math.min(w, screen?.width - Style.marginL * 2) @@ -251,13 +231,13 @@ Loader { height: { var h if (preferredHeightRatio !== undefined) { - h = Math.round(Math.max(screen?.height * preferredHeightRatio, preferredHeight) * scaling) + h = Math.round(Math.max(screen?.height * preferredHeightRatio, preferredHeight)) } else { - h = preferredHeight * scaling + h = preferredHeight } // Clamp width so it is never bigger than the screen - return Math.min(h, screen?.height - Style.barHeight * scaling - Style.marginL * 2) + return Math.min(h, screen?.height - Style.barHeight - Style.marginL * 2) } scale: root.scaleValue @@ -274,9 +254,9 @@ Loader { } switch (barPosition) { case "top": - return (Style.barHeight + Style.marginS) * scaling + (Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0) + return (Style.barHeight + Style.marginS) + (Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL : 0) default: - return Style.marginS * scaling + return Style.marginS } } @@ -286,9 +266,9 @@ Loader { } switch (barPosition) { case "bottom": - return (Style.barHeight + Style.marginS) * scaling + (Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0) + return (Style.barHeight + Style.marginS) + (Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL : 0) default: - return Style.marginS * scaling + return Style.marginS } } @@ -298,9 +278,9 @@ Loader { } switch (barPosition) { case "left": - return (Style.barHeight + Style.marginS) * scaling + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0) + return (Style.barHeight + Style.marginS) + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL : 0) default: - return Style.marginS * scaling + return Style.marginS } } @@ -310,9 +290,9 @@ Loader { } switch (barPosition) { case "right": - return (Style.barHeight + Style.marginS) * scaling + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0) + return (Style.barHeight + Style.marginS) + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL : 0) default: - return Style.marginS * scaling + return Style.marginS } } @@ -467,14 +447,14 @@ Loader { var ny = dragStartY + translation.y // Calculate gaps so we never overlap the bar on any side - var baseGap = Style.marginS * scaling - var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * 2 * Style.marginXL * scaling : 0 - var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * 2 * Style.marginXL * scaling : 0 + var baseGap = Style.marginS + var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * 2 * Style.marginXL : 0 + var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * 2 * Style.marginXL : 0 - var insetLeft = baseGap + ((barIsVisible && barPosition === "left") ? (Style.barHeight * scaling + floatExtraH) : 0) - var insetRight = baseGap + ((barIsVisible && barPosition === "right") ? (Style.barHeight * scaling + floatExtraH) : 0) - var insetTop = baseGap + ((barIsVisible && barPosition === "top") ? (Style.barHeight * scaling + floatExtraV) : 0) - var insetBottom = baseGap + ((barIsVisible && barPosition === "bottom") ? (Style.barHeight * scaling + floatExtraV) : 0) + var insetLeft = baseGap + ((barIsVisible && barPosition === "left") ? (Style.barHeight + floatExtraH) : 0) + var insetRight = baseGap + ((barIsVisible && barPosition === "right") ? (Style.barHeight + floatExtraH) : 0) + var insetTop = baseGap + ((barIsVisible && barPosition === "top") ? (Style.barHeight + floatExtraV) : 0) + var insetBottom = baseGap + ((barIsVisible && barPosition === "bottom") ? (Style.barHeight + floatExtraV) : 0) // Clamp within screen bounds accounting for insets var maxX = panelWindow.width - panelBackground.width - insetRight @@ -493,7 +473,7 @@ Loader { anchors.margins: 0 color: Color.transparent border.color: Color.mPrimary - border.width: Math.max(2, Style.borderL * scaling) + border.width: Math.max(2, Style.borderL) radius: parent.radius visible: panelBackground.isDragged && dragHandler.active opacity: 0.8 @@ -505,7 +485,7 @@ Loader { anchors.margins: 0 color: Color.transparent border.color: Color.mPrimary - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) radius: parent.radius opacity: 0.3 } diff --git a/Widgets/NQuickSetting.qml b/Widgets/NQuickSetting.qml index 7b559019b..a483a7000 100644 --- a/Widgets/NQuickSetting.qml +++ b/Widgets/NQuickSetting.qml @@ -17,10 +17,10 @@ Rectangle { property string style: "modern" // "modern", "classic", or "compact" // Styling properties - property real fontSize: (style === "classic") ? Style.fontSizeXS * scaling : Style.fontSizeS * scaling + property real fontSize: (style === "classic") ? Style.fontSizeXS : Style.fontSizeS property int fontWeight: Style.fontWeightMedium - property real iconSize: Style.fontSizeL * scaling - property real cornerRadius: Style.radiusM * scaling + property real iconSize: Style.fontSizeL + property real cornerRadius: Style.radiusM // Internal properties property bool hovered: false @@ -73,21 +73,21 @@ Rectangle { // Dimensions - Style-dependent sizing implicitWidth: { if (style === "classic") { - return Style.baseWidgetSize * scaling + return Style.baseWidgetSize } if (style === "compact") { - return Style.baseWidgetSize * 0.8 * scaling + return Style.baseWidgetSize * 0.8 } - return Math.max(120 * scaling, contentRow.implicitWidth + (Style.marginL * scaling)) + return Math.max(120, contentRow.implicitWidth + (Style.marginL)) } implicitHeight: { if (style === "classic") { - return Style.baseWidgetSize * scaling + return Style.baseWidgetSize } if (style === "compact") { - return Style.baseWidgetSize * 0.8 * scaling + return Style.baseWidgetSize * 0.8 } - return Math.max(48 * scaling, contentRow.implicitHeight + (Style.marginL * scaling)) + return Math.max(48, contentRow.implicitHeight + (Style.marginL)) } // Appearance - Style-dependent styling @@ -95,7 +95,7 @@ Rectangle { if (style === "classic") return width * 0.5 if (style === "compact") - return Style.radiusS * scaling // Smaller radius for compact + return Style.radiusS // Smaller radius for compact return cornerRadius } color: { @@ -108,7 +108,7 @@ Rectangle { border.width: { if (style === "classic") - return Math.max(1, Style.borderS * scaling) + return Math.max(1, Style.borderS) if (style === "compact") return 0 return 0 @@ -146,7 +146,7 @@ Rectangle { ColumnLayout { id: contentRow anchors.centerIn: parent - spacing: Style.marginXXS * scaling + spacing: Style.marginXXS visible: root.style !== "classic" && root.style !== "compact" // Icon @@ -202,7 +202,7 @@ Rectangle { anchors.centerIn: parent visible: root.style === "compact" && root.icon !== "" icon: root.icon - pointSize: Style.fontSizeM * scaling // Smaller icon for compact + pointSize: Style.fontSizeM // Smaller icon for compact color: { if (!root.enabled) return Color.mOnSurfaceVariant @@ -223,12 +223,12 @@ Rectangle { RowLayout { anchors.centerIn: parent visible: root.style === "classic" - spacing: Style.marginXS * scaling + spacing: Style.marginXS NIcon { visible: root.icon !== "" icon: root.icon - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: { if (!root.enabled) return Color.mOnSurfaceVariant diff --git a/Widgets/NRadioButton.qml b/Widgets/NRadioButton.qml index d04ea7773..59ff22051 100644 --- a/Widgets/NRadioButton.qml +++ b/Widgets/NRadioButton.qml @@ -10,12 +10,12 @@ RadioButton { indicator: Rectangle { id: outerCircle - implicitWidth: Style.baseWidgetSize * 0.625 * scaling - implicitHeight: Style.baseWidgetSize * 0.625 * scaling + implicitWidth: Style.baseWidgetSize * 0.625 + implicitHeight: Style.baseWidgetSize * 0.625 radius: width * 0.5 color: Color.transparent border.color: root.checked ? Color.mPrimary : Color.mOnSurface - border.width: Math.max(1, Style.borderM * scaling) + border.width: Math.max(1, Style.borderM) anchors.verticalCenter: parent.verticalCenter Rectangle { @@ -41,10 +41,10 @@ RadioButton { contentItem: NText { text: root.text - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM anchors.verticalCenter: parent.verticalCenter anchors.left: outerCircle.right anchors.right: parent.right - anchors.leftMargin: Style.marginS * scaling + anchors.leftMargin: Style.marginS } } diff --git a/Widgets/NScrollView.qml b/Widgets/NScrollView.qml index 63e288195..af5371d93 100644 --- a/Widgets/NScrollView.qml +++ b/Widgets/NScrollView.qml @@ -10,8 +10,8 @@ T.ScrollView { property color handleHoverColor: handleColor property color handlePressedColor: handleColor property color trackColor: Color.transparent - property real handleWidth: 6 * scaling - property real handleRadius: Style.radiusM * scaling + property real handleWidth: 6 + property real handleRadius: Style.radiusM property int verticalPolicy: ScrollBar.AsNeeded property int horizontalPolicy: ScrollBar.AsNeeded property bool preventHorizontalScroll: horizontalPolicy === ScrollBar.AlwaysOff diff --git a/Widgets/NSearchableComboBox.qml b/Widgets/NSearchableComboBox.qml index 3175f1268..bb7701007 100644 --- a/Widgets/NSearchableComboBox.qml +++ b/Widgets/NSearchableComboBox.qml @@ -9,8 +9,8 @@ import "../Helpers/FuzzySort.js" as Fuzzysort RowLayout { id: root - property real minimumWidth: 280 * scaling - property real popupHeight: 180 * scaling + property real minimumWidth: 280 + property real popupHeight: 180 property string label: "" property string description: "" @@ -21,11 +21,11 @@ RowLayout { property string placeholder: "" property string searchPlaceholder: I18n.tr("placeholders.search") - readonly property real preferredHeight: Style.baseWidgetSize * 1.1 * scaling + readonly property real preferredHeight: Style.baseWidgetSize * 1.1 signal selected(string key) - spacing: Style.marginL * scaling + spacing: Style.marginL Layout.fillWidth: true // Filtered model for search results @@ -121,12 +121,12 @@ RowLayout { } background: Rectangle { - implicitWidth: Style.baseWidgetSize * 3.75 * scaling + implicitWidth: Style.baseWidgetSize * 3.75 implicitHeight: preferredHeight color: Color.mSurface border.color: combo.activeFocus ? Color.mSecondary : Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) - radius: Style.radiusM * scaling + border.width: Math.max(1, Style.borderS) + radius: Style.radiusM Behavior on border.color { ColorAnimation { @@ -136,9 +136,9 @@ RowLayout { } contentItem: NText { - leftPadding: Style.marginL * scaling - rightPadding: combo.indicator.width + Style.marginL * scaling - pointSize: Style.fontSizeM * scaling + leftPadding: Style.marginL + rightPadding: combo.indicator.width + Style.marginL + pointSize: Style.fontSizeM verticalAlignment: Text.AlignVCenter elide: Text.ElideRight color: (combo.currentIndex >= 0 && combo.currentIndex < filteredModel.count) ? Color.mOnSurface : Color.mOnSurfaceVariant @@ -146,17 +146,17 @@ RowLayout { } indicator: NIcon { - x: combo.width - width - Style.marginM * scaling + x: combo.width - width - Style.marginM y: combo.topPadding + (combo.availableHeight - height) / 2 icon: "caret-down" - pointSize: Style.fontSizeL * scaling + pointSize: Style.fontSizeL } popup: Popup { y: combo.height width: combo.width - height: root.popupHeight + 60 * scaling - padding: Style.marginM * scaling + height: root.popupHeight + 60 + padding: Style.marginM onOpened: { PanelService.willOpenPopup(root) @@ -167,7 +167,7 @@ RowLayout { } contentItem: ColumnLayout { - spacing: Style.marginS * scaling + spacing: Style.marginS // Search input NTextInput { @@ -176,7 +176,7 @@ RowLayout { placeholderText: root.searchPlaceholder text: root.searchText onTextChanged: root.searchText = text - fontSize: Style.fontSizeS * scaling + fontSize: Style.fontSizeS } NListView { @@ -206,7 +206,7 @@ RowLayout { contentItem: NText { text: name - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM color: highlighted ? Color.mSurface : Color.mOnSurface verticalAlignment: Text.AlignVCenter elide: Text.ElideRight @@ -218,9 +218,9 @@ RowLayout { } background: Rectangle { - width: listView.width * scaling + width: listView.width color: highlighted ? Color.mTertiary : Color.transparent - radius: Style.radiusS * scaling + radius: Style.radiusS Behavior on color { ColorAnimation { duration: Style.animationFast @@ -234,8 +234,8 @@ RowLayout { background: Rectangle { color: Color.mSurfaceVariant border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) - radius: Style.radiusM * scaling + border.width: Math.max(1, Style.borderS) + radius: Style.radiusM } } diff --git a/Widgets/NSlider.qml b/Widgets/NSlider.qml index 77393099e..fb60bae33 100644 --- a/Widgets/NSlider.qml +++ b/Widgets/NSlider.qml @@ -11,9 +11,9 @@ Slider { property bool snapAlways: true property real heightRatio: 0.7 - readonly property real knobDiameter: Math.round((Style.baseWidgetSize * heightRatio * scaling) / 2) * 2 + readonly property real knobDiameter: Math.round((Style.baseWidgetSize * heightRatio) / 2) * 2 readonly property real trackHeight: Math.round((knobDiameter * 0.4) / 2) * 2 - readonly property real cutoutExtra: Math.round((Style.baseWidgetSize * 0.1 * scaling) / 2) * 2 + readonly property real cutoutExtra: Math.round((Style.baseWidgetSize * 0.1) / 2) * 2 padding: cutoutExtra / 2 @@ -30,7 +30,7 @@ Slider { radius: height / 2 color: Qt.alpha(Color.mSurface, 0.5) border.color: Qt.alpha(Color.mOutline, 0.5) - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) // A container composite shape that puts a semicircle on the end Item { @@ -116,7 +116,7 @@ Slider { radius: width / 2 color: root.pressed ? Color.mTertiary : Color.mSurface border.color: Color.mPrimary - border.width: Math.max(1, Style.borderL * scaling) + border.width: Math.max(1, Style.borderL) anchors.centerIn: parent Behavior on color { diff --git a/Widgets/NSpinBox.qml b/Widgets/NSpinBox.qml index 8261135c6..51310439b 100644 --- a/Widgets/NSpinBox.qml +++ b/Widgets/NSpinBox.qml @@ -38,8 +38,8 @@ RowLayout { // Main spinbox container Rectangle { id: spinBoxContainer - implicitWidth: 120 * scaling - implicitHeight: (root.baseSize - 4) * scaling + implicitWidth: 120 + implicitHeight: (root.baseSize - 4) radius: height * 0.5 color: Color.mSurfaceVariant border.color: (root.hovering || decreaseArea.containsMouse || increaseArea.containsMouse) ? Color.mTertiary : Color.mOutline @@ -153,7 +153,7 @@ RowLayout { anchors.leftMargin: parent.width * 0.25 anchors.verticalCenter: parent.verticalCenter icon: "chevron-left" - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: decreaseArea.containsMouse ? Color.mOnTertiary : Color.mPrimary } @@ -248,7 +248,7 @@ RowLayout { anchors.rightMargin: parent.width * 0.25 anchors.verticalCenter: parent.verticalCenter icon: "chevron-right" - pointSize: Style.fontSizeS * scaling + pointSize: Style.fontSizeS color: increaseArea.containsMouse ? Color.mOnTertiary : Color.mPrimary } @@ -271,7 +271,7 @@ RowLayout { anchors.left: decreaseButton.right anchors.right: increaseButton.left anchors.verticalCenter: parent.verticalCenter - anchors.margins: 4 * scaling + anchors.margins: 4 height: parent.height color: Color.transparent @@ -283,7 +283,7 @@ RowLayout { NText { text: root.prefix family: Settings.data.ui.fontFixed - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightMedium color: Color.mOnSurface verticalAlignment: Text.AlignVCenter @@ -296,7 +296,7 @@ RowLayout { id: valueInput text: valueInput.focus ? valueInput.text : root.value.toString() font.family: Settings.data.ui.fontFixed - font.pointSize: Style.fontSizeM * scaling + font.pointSize: Style.fontSizeM font.weight: Style.fontWeightMedium color: Color.mOnSurface verticalAlignment: Text.AlignVCenter @@ -342,7 +342,7 @@ RowLayout { NText { text: root.suffix family: Settings.data.ui.fontFixed - pointSize: Style.fontSizeM * scaling + pointSize: Style.fontSizeM font.weight: Style.fontWeightMedium color: Color.mOnSurface verticalAlignment: Text.AlignVCenter diff --git a/Widgets/NText.qml b/Widgets/NText.qml index 9efd199e5..30b95ea5b 100644 --- a/Widgets/NText.qml +++ b/Widgets/NText.qml @@ -8,7 +8,7 @@ Text { id: root property string family: Settings.data.ui.fontDefault - property real pointSize: Style.fontSizeM * scaling + property real pointSize: Style.fontSizeM property real fontScale: { return (root.family === Settings.data.ui.fontDefault ? Settings.data.ui.fontDefaultScale : Settings.data.ui.fontFixedScale) } diff --git a/Widgets/NTextInput.qml b/Widgets/NTextInput.qml index 7f2ec9d7d..5615d2f7e 100644 --- a/Widgets/NTextInput.qml +++ b/Widgets/NTextInput.qml @@ -14,7 +14,7 @@ ColumnLayout { property color labelColor: Color.mOnSurface property color descriptionColor: Color.mOnSurfaceVariant property string fontFamily: Settings.data.ui.fontDefault - property real fontSize: Style.fontSizeS * scaling + property real fontSize: Style.fontSizeS property int fontWeight: Style.fontWeightRegular property alias text: input.text @@ -24,7 +24,7 @@ ColumnLayout { signal editingFinished - spacing: Style.marginS * scaling + spacing: Style.marginS NLabel { label: root.label @@ -40,8 +40,8 @@ ColumnLayout { id: frameControl Layout.fillWidth: true - Layout.minimumWidth: 80 * scaling - implicitHeight: Style.baseWidgetSize * 1.1 * scaling + Layout.minimumWidth: 80 + implicitHeight: Style.baseWidgetSize * 1.1 // This is important - makes the control accept focus focusPolicy: Qt.StrongFocus @@ -50,10 +50,10 @@ ColumnLayout { background: Rectangle { id: frame - radius: Style.radiusM * scaling + radius: Style.radiusM color: Color.mSurface border.color: input.activeFocus ? Color.mSecondary : Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) Behavior on border.color { ColorAnimation { @@ -79,7 +79,7 @@ ColumnLayout { input.forceActiveFocus() var inputPos = mapToItem(inputContainer, mouse.x, mouse.y) if (inputPos.x >= 0 && inputPos.x <= inputContainer.width) { - var textPos = inputPos.x - Style.marginM * scaling + var textPos = inputPos.x - Style.marginM if (textPos >= 0 && textPos <= input.width) { input.cursorPosition = input.positionAt(textPos, input.height / 2) } @@ -105,8 +105,8 @@ ColumnLayout { Item { id: inputContainer anchors.fill: parent - anchors.leftMargin: Style.marginM * scaling - anchors.rightMargin: Style.marginM * scaling + anchors.leftMargin: Style.marginM + anchors.rightMargin: Style.marginM z: 1 TextField { diff --git a/Widgets/NTextInputButton.qml b/Widgets/NTextInputButton.qml index 5e157c1e9..89ec8ffd5 100644 --- a/Widgets/NTextInputButton.qml +++ b/Widgets/NTextInputButton.qml @@ -21,7 +21,7 @@ ColumnLayout { signal inputTextChanged(string text) signal inputEditingFinished - spacing: Style.marginS * scaling + spacing: Style.marginS // Label and description NLabel { @@ -34,7 +34,7 @@ ColumnLayout { // Input field with button RowLayout { Layout.fillWidth: true - spacing: Style.marginM * scaling + spacing: Style.marginM NTextInput { id: input diff --git a/Widgets/NToggle.qml b/Widgets/NToggle.qml index 3e464bb8e..822eca55a 100644 --- a/Widgets/NToggle.qml +++ b/Widgets/NToggle.qml @@ -27,12 +27,12 @@ RowLayout { Rectangle { id: switcher - implicitWidth: Math.round(root.baseSize * .85 * scaling) * 2 - implicitHeight: Math.round(root.baseSize * scaling * .5) * 2 + implicitWidth: Math.round(root.baseSize * .85) * 2 + implicitHeight: Math.round(root.baseSize * .5) * 2 radius: height * 0.5 color: root.checked ? Color.mPrimary : Color.mSurface border.color: Color.mOutline - border.width: Math.max(1, Style.borderS * scaling) + border.width: Math.max(1, Style.borderS) Behavior on color { ColorAnimation { @@ -48,15 +48,15 @@ RowLayout { Rectangle { - implicitWidth: Math.round(root.baseSize * 0.4 * scaling) * 2 - implicitHeight: Math.round(root.baseSize * 0.4 * scaling) * 2 + implicitWidth: Math.round(root.baseSize * 0.4) * 2 + implicitHeight: Math.round(root.baseSize * 0.4) * 2 radius: height * 0.5 color: root.checked ? Color.mOnPrimary : Color.mPrimary border.color: root.checked ? Color.mSurface : Color.mSurface - border.width: Math.max(1, Style.borderM * scaling) + border.width: Math.max(1, Style.borderM) anchors.verticalCenter: parent.verticalCenter anchors.verticalCenterOffset: 0 - x: root.checked ? switcher.width - width - 3 * scaling : 3 * scaling + x: root.checked ? switcher.width - width - 3 : 3 Behavior on x { NumberAnimation { diff --git a/Widgets/NValueSlider.qml b/Widgets/NValueSlider.qml index 3eb6538b2..74cc1cb01 100644 --- a/Widgets/NValueSlider.qml +++ b/Widgets/NValueSlider.qml @@ -16,7 +16,7 @@ RowLayout { property bool snapAlways: true property real heightRatio: 0.7 property string text: "" - property real textSize: Style.fontSizeM * scaling + property real textSize: Style.fontSizeM property real customHeight: -1 property real customHeightRatio: -1 @@ -24,7 +24,7 @@ RowLayout { signal moved(real value) signal pressedChanged(bool pressed, real value) - spacing: Style.marginL * scaling + spacing: Style.marginL implicitHeight: root.customHeight > 0 ? root.customHeight : slider.implicitHeight NSlider { @@ -47,7 +47,7 @@ RowLayout { pointSize: root.textSize family: Settings.data.ui.fontFixed Layout.alignment: Qt.AlignVCenter - Layout.preferredWidth: 45 * scaling + Layout.preferredWidth: 45 horizontalAlignment: Text.AlignRight } }