From b36bef4cc06e94224200a739fc44dba2ef4a05d1 Mon Sep 17 00:00:00 2001 From: Lemmy Date: Fri, 20 Feb 2026 21:01:35 -0500 Subject: [PATCH] layout: implement double margin (e.g. Style.margin2M) instead of what PR #1408 did. --- Commons/Style.qml | 9 +++++++++ Modules/Bar/Extras/BarPillVertical.qml | 4 ++-- Modules/Bar/Extras/TrayMenu.qml | 2 +- Modules/Bar/Widgets/ActiveWindow.qml | 8 ++++---- Modules/Bar/Widgets/Clock.qml | 2 +- Modules/Bar/Widgets/LockKeys.qml | 4 ++-- Modules/Bar/Widgets/MediaMini.qml | 2 +- Modules/Bar/Widgets/SystemMonitor.qml | 4 ++-- Modules/Bar/Widgets/Taskbar.qml | 6 +++--- Modules/Cards/CalendarHeaderCard.qml | 6 +++--- Modules/Cards/CalendarMonthCard.qml | 2 +- .../Widgets/DesktopMediaPlayer.qml | 2 +- .../DesktopWidgets/Widgets/DesktopWeather.qml | 4 ++-- Modules/Dock/DockMenu.qml | 4 ++-- Modules/Notification/Notification.qml | 2 +- Modules/Panels/Audio/AudioPanel.qml | 14 +++++++------- Modules/Panels/Battery/BatteryPanel.qml | 2 +- Modules/Panels/Bluetooth/BluetoothPanel.qml | 6 +++--- Modules/Panels/Brightness/BrightnessPanel.qml | 4 ++-- Modules/Panels/Media/MediaPlayerPanel.qml | 2 +- Modules/Panels/Network/NetworkPanel.qml | 18 +++++++++--------- Modules/Panels/Network/WiFiNetworksList.qml | 14 +++++++------- .../NotificationHistoryPanel.qml | 4 ++-- Modules/Panels/SessionMenu/SessionMenu.qml | 18 ++++++++---------- Modules/Panels/Settings/SettingsContent.qml | 2 +- .../Settings/Tabs/About/ContributorsSubTab.qml | 4 ++-- .../SessionMenuEntrySettingsDialog.qml | 2 +- .../Panels/SetupWizard/SetupAppearanceStep.qml | 2 +- Modules/Panels/SetupWizard/SetupWizard.qml | 2 +- .../Panels/SystemStats/SystemStatsPanel.qml | 4 ++-- Modules/Toast/Toast.qml | 6 +++--- Widgets/NCollapsible.qml | 2 +- Widgets/NComboBox.qml | 2 +- Widgets/NPopupContextMenu.qml | 2 +- Widgets/NTabButton.qml | 3 ++- 35 files changed, 91 insertions(+), 83 deletions(-) diff --git a/Commons/Style.qml b/Commons/Style.qml index 63660bd68..1910401cd 100644 --- a/Commons/Style.qml +++ b/Commons/Style.qml @@ -55,6 +55,15 @@ Singleton { readonly property int marginL: Math.round(13 * uiScaleRatio) readonly property int marginXL: Math.round(18 * uiScaleRatio) + // Double margins, for proper container sizing only (e.g. height: id.implicitHeight + Style.margin2M) + readonly property int margin2XXXS: marginXXXS * 2 + readonly property int margin2XXS: marginXXS * 2 + readonly property int margin2XS: marginXS * 2 + readonly property int margin2S: marginS * 2 + readonly property int margin2M: marginM * 2 + readonly property int margin2L: marginL * 2 + readonly property int margin2XL: marginXL * 2 + // Opacity readonly property real opacityNone: 0.0 readonly property real opacityLight: 0.25 diff --git a/Modules/Bar/Extras/BarPillVertical.qml b/Modules/Bar/Extras/BarPillVertical.qml index c3683e51b..15eb07f12 100644 --- a/Modules/Bar/Extras/BarPillVertical.qml +++ b/Modules/Bar/Extras/BarPillVertical.qml @@ -45,8 +45,8 @@ Item { readonly property real barFontSize: Style.getBarFontSizeForScreen(screen?.name) readonly property int pillHeight: buttonSize readonly property int pillOverlap: Math.round(buttonSize * 0.5) - readonly property int maxPillWidth: rotateText ? Math.max(buttonSize, Math.round(textItem.implicitHeight + Style.marginXL)) : buttonSize - readonly property int maxPillHeight: rotateText ? Math.max(1, Math.round(textItem.implicitWidth + Style.marginXL + Math.round(iconCircle.height / 4))) : Math.max(1, Math.round(textItem.implicitHeight + Style.marginXL)) + readonly property int maxPillWidth: rotateText ? Math.max(buttonSize, Math.round(textItem.implicitHeight + Style.margin2M)) : buttonSize + readonly property int maxPillHeight: rotateText ? Math.max(1, Math.round(textItem.implicitWidth + Style.margin2M + Math.round(iconCircle.height / 4))) : Math.max(1, Math.round(textItem.implicitHeight + Style.margin2M)) // Determine pill direction based on section position readonly property bool openDownward: oppositeDirection diff --git a/Modules/Bar/Extras/TrayMenu.qml b/Modules/Bar/Extras/TrayMenu.qml index 021e6bb49..d1b133f93 100644 --- a/Modules/Bar/Extras/TrayMenu.qml +++ b/Modules/Bar/Extras/TrayMenu.qml @@ -276,7 +276,7 @@ PopupWindow { NDivider { anchors.centerIn: parent - width: parent.width - (Style.marginXL) + width: parent.width - Style.margin2M visible: modelData?.isSeparator ?? false } diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index e4db4140e..2775653c8 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -105,7 +105,7 @@ Item { contentWidth += titleContainer.measuredWidth; // Additional small margin for text - contentWidth += Style.marginXS; + contentWidth += Style.margin2XXS; // Add container margins contentWidth += margins; @@ -259,7 +259,7 @@ Item { maxWidth: { // Calculate available width based on other elements var iconWidth = (showIcon && windowIcon.visible ? (iconSize + Style.marginS) : 0); - var totalMargins = Style.marginXS; + var totalMargins = Style.margin2XXS; var availableWidth = mainContainer.width - iconWidth - totalMargins; return Math.max(20, availableWidth); } @@ -288,8 +288,8 @@ Item { // Vertical layout for left/right bars - icon only Item { id: verticalLayout - width: parent.width - Style.marginXL - height: parent.height - Style.marginXL + width: parent.width - Style.margin2M + height: parent.height - Style.margin2M x: Style.pixelAlignCenter(parent.width, width) y: Style.pixelAlignCenter(parent.height, height) visible: isVerticalBar diff --git a/Modules/Bar/Widgets/Clock.qml b/Modules/Bar/Widgets/Clock.qml index 840dd594d..fce20cf09 100644 --- a/Modules/Bar/Widgets/Clock.qml +++ b/Modules/Bar/Widgets/Clock.qml @@ -48,7 +48,7 @@ Item { readonly property color textColor: Color.resolveColorKey(clockColor) // Content dimensions for implicit sizing - readonly property real contentWidth: isBarVertical ? capsuleHeight : Math.round((isBarVertical ? verticalLoader.implicitWidth : horizontalLoader.implicitWidth) + Style.marginXL) + readonly property real contentWidth: isBarVertical ? capsuleHeight : Math.round((isBarVertical ? verticalLoader.implicitWidth : horizontalLoader.implicitWidth) + Style.margin2M) readonly property real contentHeight: isBarVertical ? Math.round(verticalLoader.implicitHeight + Style.marginS * 2) : capsuleHeight // Size: use implicit width/height diff --git a/Modules/Bar/Widgets/LockKeys.qml b/Modules/Bar/Widgets/LockKeys.qml index d42c139b6..8447201f4 100644 --- a/Modules/Bar/Widgets/LockKeys.qml +++ b/Modules/Bar/Widgets/LockKeys.qml @@ -39,8 +39,8 @@ Item { readonly property real capsuleHeight: Style.getCapsuleHeightForScreen(screenName) // Content dimensions for implicit sizing - readonly property real contentWidth: isVertical ? capsuleHeight : Math.round(layout.implicitWidth + Style.marginXL) - readonly property real contentHeight: isVertical ? Math.round(layout.implicitHeight + Style.marginXL) : capsuleHeight + readonly property real contentWidth: isVertical ? capsuleHeight : Math.round(layout.implicitWidth + Style.margin2M) + readonly property real contentHeight: isVertical ? Math.round(layout.implicitHeight + Style.margin2M) : capsuleHeight readonly property bool hideWhenOff: (widgetSettings.hideWhenOff !== undefined) ? widgetSettings.hideWhenOff : (widgetMetadata.hideWhenOff !== undefined ? widgetMetadata.hideWhenOff : false) diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 83f38ebb1..427fa3b85 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -133,7 +133,7 @@ Item { var textWidth = 0; if (titleContainer.measuredWidth > 0) { margins += Style.marginS; - textWidth = titleContainer.measuredWidth + Style.marginXS; + textWidth = titleContainer.measuredWidth + Style.margin2XXS; } var total = iconWidth + textWidth + margins; diff --git a/Modules/Bar/Widgets/SystemMonitor.qml b/Modules/Bar/Widgets/SystemMonitor.qml index fc060ab20..778c1f743 100644 --- a/Modules/Bar/Widgets/SystemMonitor.qml +++ b/Modules/Bar/Widgets/SystemMonitor.qml @@ -70,8 +70,8 @@ Item { readonly property real miniGaugeWidth: Math.max(3, Style.toOdd(root.iconSize * 0.25)) // Content dimensions for implicit sizing - readonly property real contentWidth: isVertical ? capsuleHeight : Math.round(mainGrid.implicitWidth + Style.marginXL) - readonly property real contentHeight: isVertical ? Math.round(mainGrid.implicitHeight + Style.marginXL) : capsuleHeight + readonly property real contentWidth: isVertical ? capsuleHeight : Math.round(mainGrid.implicitWidth + Style.margin2M) + readonly property real contentHeight: isVertical ? Math.round(mainGrid.implicitHeight + Style.margin2M) : capsuleHeight readonly property color iconColor: Color.resolveColorKey(iconColorKey) readonly property color textColor: Color.resolveColorKey(textColorKey) diff --git a/Modules/Bar/Widgets/Taskbar.qml b/Modules/Bar/Widgets/Taskbar.qml index 71dc00b1e..211893dfd 100644 --- a/Modules/Bar/Widgets/Taskbar.qml +++ b/Modules/Bar/Widgets/Taskbar.qml @@ -68,7 +68,7 @@ Item { if (smartWidth && combinedModel.length > 0) { if (maxTaskbarWidth > 0) { var entriesCount = combinedModel.length; - var maxWidthPerEntry = (maxTaskbarWidth / entriesCount) - itemSize - Style.marginS - Style.marginXL; + var maxWidthPerEntry = (maxTaskbarWidth / entriesCount) - itemSize - Style.marginS - Style.margin2M; calculatedWidth = Math.min(calculatedWidth, maxWidthPerEntry); } @@ -598,7 +598,7 @@ Item { if (isVerticalBar) return barHeight; - var calculatedWidth = showTitle ? taskbarLayout.implicitWidth : taskbarLayout.implicitWidth + Style.marginXL; + var calculatedWidth = showTitle ? taskbarLayout.implicitWidth : taskbarLayout.implicitWidth + Style.margin2M; // Apply maximum width constraint when smartWidth is enabled if (smartWidth && maxTaskbarWidth > 0) { @@ -659,7 +659,7 @@ Item { readonly property color titleBgColor: (isHovered || isFocused) ? Color.mHover : Style.capsuleColor readonly property color titleFgColor: (isHovered || isFocused) ? Color.mOnHover : Color.mOnSurface - Layout.preferredWidth: root.isVerticalBar ? root.barHeight : (root.showTitle ? Math.round(contentWidth + Style.marginXL) : Math.round(contentWidth)) // Add margins for both pinned and running apps + Layout.preferredWidth: root.isVerticalBar ? root.barHeight : (root.showTitle ? Math.round(contentWidth + Style.margin2M) : Math.round(contentWidth)) // Add margins for both pinned and running apps Layout.preferredHeight: root.isVerticalBar ? root.itemSize : root.barHeight Layout.alignment: Qt.AlignCenter diff --git a/Modules/Cards/CalendarHeaderCard.qml b/Modules/Cards/CalendarHeaderCard.qml index e1c2c1d6d..94146fc96 100644 --- a/Modules/Cards/CalendarHeaderCard.qml +++ b/Modules/Cards/CalendarHeaderCard.qml @@ -10,9 +10,9 @@ import qs.Widgets Rectangle { id: root Layout.fillWidth: true - Layout.minimumHeight: (60 * Style.uiScaleRatio) + (Style.marginXL) - Layout.preferredHeight: (60 * Style.uiScaleRatio) + (Style.marginXL) - implicitHeight: (60 * Style.uiScaleRatio) + (Style.marginXL) + Layout.minimumHeight: (60 * Style.uiScaleRatio) + Style.margin2M + Layout.preferredHeight: (60 * Style.uiScaleRatio) + Style.margin2M + implicitHeight: (60 * Style.uiScaleRatio) + Style.margin2M radius: Style.radiusL color: Color.mPrimary diff --git a/Modules/Cards/CalendarMonthCard.qml b/Modules/Cards/CalendarMonthCard.qml index 423dcff7b..6008a28cb 100644 --- a/Modules/Cards/CalendarMonthCard.qml +++ b/Modules/Cards/CalendarMonthCard.qml @@ -12,7 +12,7 @@ import qs.Widgets NBox { id: root Layout.fillWidth: true - implicitHeight: calendarContent.implicitHeight + Style.marginXL + implicitHeight: calendarContent.implicitHeight + Style.margin2M // Internal state - independent from header readonly property var now: Time.now diff --git a/Modules/DesktopWidgets/Widgets/DesktopMediaPlayer.qml b/Modules/DesktopWidgets/Widgets/DesktopMediaPlayer.qml index 667a13bea..406d4c900 100644 --- a/Modules/DesktopWidgets/Widgets/DesktopMediaPlayer.qml +++ b/Modules/DesktopWidgets/Widgets/DesktopMediaPlayer.qml @@ -58,7 +58,7 @@ DraggableDesktopWidget { readonly property int visibleButtonCount: root.showButtons ? (1 + (showPrev ? 1 : 0) + (showNext ? 1 : 0)) : 0 implicitWidth: Math.round(400 * widgetScale) - implicitHeight: Math.round(64 * widgetScale + Style.marginXL * widgetScale) + implicitHeight: Math.round(64 * widgetScale + Style.margin2M * widgetScale) width: implicitWidth height: implicitHeight diff --git a/Modules/DesktopWidgets/Widgets/DesktopWeather.qml b/Modules/DesktopWidgets/Widgets/DesktopWeather.qml index a658949c5..a7a958828 100644 --- a/Modules/DesktopWidgets/Widgets/DesktopWeather.qml +++ b/Modules/DesktopWidgets/Widgets/DesktopWeather.qml @@ -44,8 +44,8 @@ DraggableDesktopWidget { return chunks[0]; } - implicitWidth: Math.round(Math.max(240 * widgetScale, contentLayout.implicitWidth + Style.marginXL * widgetScale)) - implicitHeight: Math.round(64 * widgetScale + Style.marginXL * widgetScale) + implicitWidth: Math.round(Math.max(240 * widgetScale, contentLayout.implicitWidth + Style.margin2M * widgetScale)) + implicitHeight: Math.round(64 * widgetScale + Style.margin2M * widgetScale) width: implicitWidth height: implicitHeight diff --git a/Modules/Dock/DockMenu.qml b/Modules/Dock/DockMenu.qml index 70e3fa023..374092b70 100644 --- a/Modules/Dock/DockMenu.qml +++ b/Modules/Dock/DockMenu.qml @@ -61,8 +61,8 @@ PopupWindow { return listHeight(root.items); } - implicitWidth: menuContentWidth + (Style.marginXL) - implicitHeight: Math.min(menuBodyHeight + (Style.marginXL), menuMaxHeight) + implicitWidth: menuContentWidth + Style.margin2M + implicitHeight: Math.min(menuBodyHeight + Style.margin2M, menuMaxHeight) color: "transparent" visible: false diff --git a/Modules/Notification/Notification.qml b/Modules/Notification/Notification.qml index 0bc1246eb..1305ee14f 100644 --- a/Modules/Notification/Notification.qml +++ b/Modules/Notification/Notification.qml @@ -205,7 +205,7 @@ Variants { readonly property int slideDistance: 300 Layout.preferredWidth: notifWidth + notifWindow.shadowPadding * 2 - Layout.preferredHeight: (notifWindow.isCompact ? compactContent.implicitHeight : notificationContent.implicitHeight) + Style.marginXL + notifWindow.shadowPadding * 2 + Layout.preferredHeight: (notifWindow.isCompact ? compactContent.implicitHeight : notificationContent.implicitHeight) + Style.margin2M + notifWindow.shadowPadding * 2 Layout.maximumHeight: Layout.preferredHeight // Animation properties diff --git a/Modules/Panels/Audio/AudioPanel.qml b/Modules/Panels/Audio/AudioPanel.qml index 5f9663e14..07af57dc0 100644 --- a/Modules/Panels/Audio/AudioPanel.qml +++ b/Modules/Panels/Audio/AudioPanel.qml @@ -149,7 +149,7 @@ SmartPanel { readonly property var appStreams: AudioService.appStreams // Use implicitHeight from content + margins to avoid binding loops - property real contentPreferredHeight: mainColumn.implicitHeight + Style.marginL * 2 + property real contentPreferredHeight: mainColumn.implicitHeight + Style.margin2L ColumnLayout { id: mainColumn @@ -160,7 +160,7 @@ SmartPanel { // HEADER NBox { Layout.fillWidth: true - implicitHeight: header.implicitHeight + (Style.marginXL) + implicitHeight: header.implicitHeight + Style.margin2M ColumnLayout { id: header @@ -238,7 +238,7 @@ SmartPanel { // Output Volume NBox { Layout.fillWidth: true - Layout.preferredHeight: outputVolumeColumn.implicitHeight + (Style.marginXL) + Layout.preferredHeight: outputVolumeColumn.implicitHeight + Style.margin2M ColumnLayout { id: outputVolumeColumn @@ -313,7 +313,7 @@ SmartPanel { // Input Volume NBox { Layout.fillWidth: true - Layout.preferredHeight: inputVolumeColumn.implicitHeight + (Style.marginXL) + Layout.preferredHeight: inputVolumeColumn.implicitHeight + Style.margin2M ColumnLayout { id: inputVolumeColumn @@ -398,7 +398,7 @@ SmartPanel { id: appBox required property PwNode modelData Layout.fillWidth: true - Layout.preferredHeight: appRow.implicitHeight + (Style.marginXL) + Layout.preferredHeight: appRow.implicitHeight + Style.margin2M visible: !isCaptureStream // Track individual node to ensure properties are bound @@ -698,7 +698,7 @@ SmartPanel { NBox { Layout.fillWidth: true - Layout.preferredHeight: outputColumn.implicitHeight + (Style.marginXL) + Layout.preferredHeight: outputColumn.implicitHeight + Style.margin2M ColumnLayout { id: outputColumn @@ -740,7 +740,7 @@ SmartPanel { NBox { Layout.fillWidth: true - Layout.preferredHeight: inputColumn.implicitHeight + (Style.marginXL) + Layout.preferredHeight: inputColumn.implicitHeight + Style.margin2M ColumnLayout { id: inputColumn diff --git a/Modules/Panels/Battery/BatteryPanel.qml b/Modules/Panels/Battery/BatteryPanel.qml index c582a1943..328934bf9 100644 --- a/Modules/Panels/Battery/BatteryPanel.qml +++ b/Modules/Panels/Battery/BatteryPanel.qml @@ -80,7 +80,7 @@ SmartPanel { // HEADER NBox { Layout.fillWidth: true - implicitHeight: headerRow.implicitHeight + (Style.marginXL) + implicitHeight: headerRow.implicitHeight + Style.margin2M RowLayout { id: headerRow diff --git a/Modules/Panels/Bluetooth/BluetoothPanel.qml b/Modules/Panels/Bluetooth/BluetoothPanel.qml index f4d0f4837..6fd42d005 100644 --- a/Modules/Panels/Bluetooth/BluetoothPanel.qml +++ b/Modules/Panels/Bluetooth/BluetoothPanel.qml @@ -33,7 +33,7 @@ SmartPanel { // Header NBox { Layout.fillWidth: true - Layout.preferredHeight: headerRow.implicitHeight + Style.marginXL + Layout.preferredHeight: headerRow.implicitHeight + Style.margin2M RowLayout { id: headerRow @@ -96,7 +96,7 @@ SmartPanel { id: disabledBox visible: !BluetoothService.enabled Layout.fillWidth: true - Layout.preferredHeight: disabledColumn.implicitHeight + Style.marginXL + Layout.preferredHeight: disabledColumn.implicitHeight + Style.margin2M ColumnLayout { id: disabledColumn @@ -147,7 +147,7 @@ SmartPanel { return (btSource.pairedDevices.length === 0 && btSource.connectedDevices.length === 0); } Layout.fillWidth: true - Layout.preferredHeight: emptyColumn.implicitHeight + Style.marginXL + Layout.preferredHeight: emptyColumn.implicitHeight + Style.margin2M ColumnLayout { id: emptyColumn diff --git a/Modules/Panels/Brightness/BrightnessPanel.qml b/Modules/Panels/Brightness/BrightnessPanel.qml index 0323a353b..795362feb 100644 --- a/Modules/Panels/Brightness/BrightnessPanel.qml +++ b/Modules/Panels/Brightness/BrightnessPanel.qml @@ -105,7 +105,7 @@ SmartPanel { // HEADER NBox { Layout.fillWidth: true - implicitHeight: headerRow.implicitHeight + (Style.marginXL) + implicitHeight: headerRow.implicitHeight + Style.margin2M RowLayout { id: headerRow @@ -215,7 +215,7 @@ SmartPanel { model: Quickshell.screens || [] delegate: NBox { Layout.fillWidth: true - Layout.preferredHeight: outputColumn.implicitHeight + (Style.marginXL) + Layout.preferredHeight: outputColumn.implicitHeight + Style.margin2M property var brightnessMonitor: BrightnessService.getMonitorForScreen(modelData) diff --git a/Modules/Panels/Media/MediaPlayerPanel.qml b/Modules/Panels/Media/MediaPlayerPanel.qml index 2bfe780af..246f9dff4 100644 --- a/Modules/Panels/Media/MediaPlayerPanel.qml +++ b/Modules/Panels/Media/MediaPlayerPanel.qml @@ -100,7 +100,7 @@ SmartPanel { NBox { Layout.fillWidth: true - Layout.preferredHeight: headerRow.implicitHeight + Style.marginXL + Layout.preferredHeight: headerRow.implicitHeight + Style.margin2M RowLayout { id: headerRow diff --git a/Modules/Panels/Network/NetworkPanel.qml b/Modules/Panels/Network/NetworkPanel.qml index 30e14a92d..110a3b418 100644 --- a/Modules/Panels/Network/NetworkPanel.qml +++ b/Modules/Panels/Network/NetworkPanel.qml @@ -114,7 +114,7 @@ SmartPanel { // Header NBox { Layout.fillWidth: true - Layout.preferredHeight: header.implicitHeight + Style.marginXL + Layout.preferredHeight: header.implicitHeight + Style.margin2M ColumnLayout { id: header @@ -228,7 +228,7 @@ SmartPanel { Rectangle { visible: panelViewMode === "wifi" && NetworkService.lastError.length > 0 Layout.fillWidth: true - Layout.preferredHeight: errorRow.implicitHeight + (Style.marginXL) + Layout.preferredHeight: errorRow.implicitHeight + Style.margin2M color: Qt.alpha(Color.mError, 0.1) radius: Style.radiusS border.width: Style.borderS @@ -282,7 +282,7 @@ SmartPanel { id: disabledBox visible: panelViewMode === "wifi" && !Settings.data.network.wifiEnabled Layout.fillWidth: true - Layout.preferredHeight: disabledColumn.implicitHeight + Style.marginXL + Layout.preferredHeight: disabledColumn.implicitHeight + Style.margin2M ColumnLayout { id: disabledColumn @@ -328,7 +328,7 @@ SmartPanel { id: scanningBox visible: panelViewMode === "wifi" && Settings.data.network.wifiEnabled && Object.keys(NetworkService.networks).length === 0 && NetworkService.scanning Layout.fillWidth: true - Layout.preferredHeight: scanningColumn.implicitHeight + Style.marginXL + Layout.preferredHeight: scanningColumn.implicitHeight + Style.margin2M ColumnLayout { id: scanningColumn @@ -365,7 +365,7 @@ SmartPanel { id: emptyBox visible: panelViewMode === "wifi" && Settings.data.network.wifiEnabled && !NetworkService.scanning && Object.keys(NetworkService.networks).length === 0 && !NetworkService.scanning Layout.fillWidth: true - Layout.preferredHeight: emptyColumn.implicitHeight + Style.marginXL + Layout.preferredHeight: emptyColumn.implicitHeight + Style.margin2M ColumnLayout { id: emptyColumn @@ -474,7 +474,7 @@ SmartPanel { NBox { visible: !(NetworkService.ethernetInterfaces && NetworkService.ethernetInterfaces.length > 0) Layout.fillWidth: true - Layout.preferredHeight: emptyEthColumn.implicitHeight + Style.marginXL + Layout.preferredHeight: emptyEthColumn.implicitHeight + Style.margin2M ColumnLayout { id: emptyEthColumn @@ -521,7 +521,7 @@ SmartPanel { Layout.fillWidth: true Layout.leftMargin: Style.marginXS Layout.rightMargin: Style.marginXS - implicitHeight: ethItemColumn.implicitHeight + Style.marginXL + implicitHeight: ethItemColumn.implicitHeight + Style.margin2M radius: Style.radiusM border.width: Style.borderS border.color: modelData.connected ? Color.mPrimary : Color.mOutline @@ -529,7 +529,7 @@ SmartPanel { ColumnLayout { id: ethItemColumn - width: parent.width - (Style.marginXL) + width: parent.width - Style.margin2M x: Style.marginM y: Style.marginM spacing: Style.marginS @@ -571,7 +571,7 @@ SmartPanel { color: Color.mPrimary radius: height * 0.5 width: ethConnectedText.implicitWidth + (Style.marginS * 2) - height: ethConnectedText.implicitHeight + (Style.marginXS) + height: ethConnectedText.implicitHeight + (Style.margin2XXS) NText { id: ethConnectedText diff --git a/Modules/Panels/Network/WiFiNetworksList.qml b/Modules/Panels/Network/WiFiNetworksList.qml index 1fb34c48e..8edc17055 100644 --- a/Modules/Panels/Network/WiFiNetworksList.qml +++ b/Modules/Panels/Network/WiFiNetworksList.qml @@ -48,7 +48,7 @@ NBox { } Layout.fillWidth: true - Layout.preferredHeight: column.implicitHeight + Style.marginXL + Layout.preferredHeight: column.implicitHeight + Style.margin2M visible: root.model.length > 0 ColumnLayout { @@ -78,7 +78,7 @@ NBox { Layout.fillWidth: true Layout.leftMargin: Style.marginXS Layout.rightMargin: Style.marginXS - implicitHeight: netColumn.implicitHeight + Style.marginXL + implicitHeight: netColumn.implicitHeight + Style.margin2M opacity: (NetworkService.disconnectingFrom === modelData.ssid || NetworkService.forgettingNetwork === modelData.ssid) ? 0.6 : 1.0 @@ -92,7 +92,7 @@ NBox { ColumnLayout { id: netColumn - width: parent.width - (Style.marginXL) + width: parent.width - Style.margin2M x: Style.marginM y: Style.marginM spacing: Style.marginS @@ -155,7 +155,7 @@ NBox { color: NetworkService.internetConnectivity ? Color.mPrimary : Color.mError radius: height * 0.5 width: Math.round(connectedText.implicitWidth + Style.marginS * 2) - height: Math.round(connectedText.implicitHeight + Style.marginXS) + height: Math.round(connectedText.implicitHeight + Style.margin2XXS) NText { id: connectedText @@ -185,7 +185,7 @@ NBox { color: Color.mError radius: height * 0.5 width: Math.round(disconnectingText.implicitWidth + Style.marginS * 2) - height: Math.round(disconnectingText.implicitHeight + Style.marginXS) + height: Math.round(disconnectingText.implicitHeight + Style.margin2XXS) NText { id: disconnectingText @@ -201,7 +201,7 @@ NBox { color: Color.mError radius: height * 0.5 width: Math.round(forgettingText.implicitWidth + Style.marginS * 2) - height: math.round(forgettingText.implicitHeight + Style.marginXS) + height: math.round(forgettingText.implicitHeight + Style.margin2XXS) NText { id: forgettingText @@ -219,7 +219,7 @@ NBox { border.width: Style.borderS radius: height * 0.5 width: savedText.implicitWidth + (Style.marginS * 2) - height: savedText.implicitHeight + (Style.marginXS) + height: savedText.implicitHeight + (Style.margin2XXS) NText { id: savedText diff --git a/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml b/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml index 1478a4048..521e9e761 100644 --- a/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml +++ b/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml @@ -377,7 +377,7 @@ SmartPanel { NBox { id: headerBox Layout.fillWidth: true - implicitHeight: header.implicitHeight + Style.marginXL + implicitHeight: header.implicitHeight + Style.margin2M ColumnLayout { id: header @@ -556,7 +556,7 @@ SmartPanel { id: notificationDelegate width: parent.width visible: panelContent.isInCurrentRange(model.timestamp) - height: visible && !isRemoving ? contentColumn.height + Style.marginXL : 0 + height: visible && !isRemoving ? contentColumn.height + Style.margin2M : 0 property int listIndex: index property string notificationId: model.id diff --git a/Modules/Panels/SessionMenu/SessionMenu.qml b/Modules/Panels/SessionMenu/SessionMenu.qml index 0e30c8071..365d841a0 100644 --- a/Modules/Panels/SessionMenu/SessionMenu.qml +++ b/Modules/Panels/SessionMenu/SessionMenu.qml @@ -828,8 +828,8 @@ SmartPanel { anchors.left: countdownText.visible ? countdownText.right : parent.left anchors.leftMargin: countdownText.visible ? Style.marginXS : 0 anchors.verticalCenter: parent.verticalCenter - width: Math.max(Style.marginXL, labelText.implicitWidth + Style.marginM) - height: Style.marginXL + width: labelText.implicitWidth + Style.margin2M + height: labelText.height + Style.margin2XS radius: Math.min(Style.radiusM, height / 2) color: (buttonRoot.isSelected || buttonRoot.effectiveHover) ? Color.mOnPrimary : Qt.alpha(Color.mSurfaceVariant, 0.5) border.width: Style.borderS @@ -840,9 +840,8 @@ SmartPanel { id: labelText anchors.centerIn: parent text: buttonRoot.keybind - pointSize: Style.fontSizeS - font.weight: Style.fontWeightBold - color: (buttonRoot.isSelected || buttonRoot.effectiveHover) ? Color.mPrimary : Color.mOnSurface + pointSize: Style.fontSizeXS + color: (buttonRoot.isSelected || buttonRoot.effectiveHover) ? Color.mPrimary : Color.mOnSurfaceVariant Behavior on color { ColorAnimation { @@ -1065,8 +1064,8 @@ SmartPanel { anchors.top: parent.top anchors.right: parent.right anchors.margins: Style.marginM - width: Math.max(Style.fontSizeM * 2, largeNumberText.implicitWidth + Style.marginM) - height: Style.fontSizeM * 2 + width: largeNumberText.implicitWidth + Style.margin2M + height: largeNumberText.implicitHeight + Style.margin2XS radius: Math.min(Style.radiusM, height / 2) color: (largeButtonRoot.isSelected || largeButtonRoot.effectiveHover) ? Color.mOnPrimary : Qt.alpha(Color.mSurfaceVariant, 0.7) border.width: Style.borderS @@ -1078,12 +1077,11 @@ SmartPanel { id: largeNumberText anchors.centerIn: parent text: largeButtonRoot.keybind - pointSize: Style.fontSizeM - font.weight: Style.fontWeightBold + pointSize: Style.fontSizeS color: { if (largeButtonRoot.isSelected || largeButtonRoot.effectiveHover) return Color.mPrimary; - return Color.mOnSurface; + return Color.mOnSurfaceVariant; } Behavior on color { diff --git a/Modules/Panels/Settings/SettingsContent.qml b/Modules/Panels/Settings/SettingsContent.qml index 2ca6a1cf5..61a7fd3b6 100644 --- a/Modules/Panels/Settings/SettingsContent.qml +++ b/Modules/Panels/Settings/SettingsContent.qml @@ -737,7 +737,7 @@ Item { id: sidebar clip: true - Layout.preferredWidth: Math.round(root.sidebarExpanded ? 200 * Style.uiScaleRatio : sidebarToggle.width + (root.panelVeryTransparent ? Style.marginXL : 0) + (sidebarList.verticalScrollBarActive ? Style.marginM : 0)) + Layout.preferredWidth: Math.round(root.sidebarExpanded ? 200 * Style.uiScaleRatio : sidebarToggle.width + (root.panelVeryTransparent ? Style.margin2M : 0) + (sidebarList.verticalScrollBarActive ? Style.marginM : 0)) Layout.fillHeight: true Layout.alignment: Qt.AlignTop diff --git a/Modules/Panels/Settings/Tabs/About/ContributorsSubTab.qml b/Modules/Panels/Settings/Tabs/About/ContributorsSubTab.qml index a774458b9..2448483e3 100644 --- a/Modules/Panels/Settings/Tabs/About/ContributorsSubTab.qml +++ b/Modules/Panels/Settings/Tabs/About/ContributorsSubTab.qml @@ -203,8 +203,8 @@ ColumnLayout { model: Math.max(0, root.contributors.length - root.topContributorsCount) delegate: Rectangle { - width: nameText.implicitWidth + Style.marginXL - height: nameText.implicitHeight + Style.marginS * 2 + width: nameText.implicitWidth + Style.margin2M + height: nameText.implicitHeight + Style.margin2S radius: Style.radiusS color: nameArea.containsMouse ? Color.mHover : "transparent" border.width: Style.borderS diff --git a/Modules/Panels/Settings/Tabs/SessionMenu/SessionMenuEntrySettingsDialog.qml b/Modules/Panels/Settings/Tabs/SessionMenu/SessionMenuEntrySettingsDialog.qml index d2abcf8a0..d8b67fd90 100644 --- a/Modules/Panels/Settings/Tabs/SessionMenu/SessionMenuEntrySettingsDialog.qml +++ b/Modules/Panels/Settings/Tabs/SessionMenu/SessionMenuEntrySettingsDialog.qml @@ -126,7 +126,7 @@ Popup { // Default command display Rectangle { Layout.fillWidth: true - Layout.preferredHeight: defaultCommandText.implicitHeight + Style.marginXL + Layout.preferredHeight: defaultCommandText.implicitHeight + Style.margin2M radius: Style.radiusM color: Color.mSurfaceVariant border.color: Color.mOutline diff --git a/Modules/Panels/SetupWizard/SetupAppearanceStep.qml b/Modules/Panels/SetupWizard/SetupAppearanceStep.qml index 148d94f58..34a6430b5 100644 --- a/Modules/Panels/SetupWizard/SetupAppearanceStep.qml +++ b/Modules/Panels/SetupWizard/SetupAppearanceStep.qml @@ -265,7 +265,7 @@ ColumnLayout { // Predefined schemes Grid (matches ColorSchemeTab) GridLayout { id: schemesGrid - columns: Math.max(2, Math.floor((parent.width - Style.marginXL) / 180)) + columns: Math.max(2, Math.floor((parent.width - Style.margin2M) / 180)) rowSpacing: Style.marginM columnSpacing: Style.marginM Layout.fillWidth: true diff --git a/Modules/Panels/SetupWizard/SetupWizard.qml b/Modules/Panels/SetupWizard/SetupWizard.qml index 7e4f287b4..9acb42c92 100644 --- a/Modules/Panels/SetupWizard/SetupWizard.qml +++ b/Modules/Panels/SetupWizard/SetupWizard.qml @@ -254,7 +254,7 @@ SmartPanel { Rectangle { Layout.fillWidth: true Layout.topMargin: Style.marginL - Layout.preferredHeight: childrenRect.height + Style.marginXL + Layout.preferredHeight: childrenRect.height + Style.margin2M color: Color.mSurfaceVariant radius: Style.radiusL diff --git a/Modules/Panels/SystemStats/SystemStatsPanel.qml b/Modules/Panels/SystemStats/SystemStatsPanel.qml index 1bddf1a7b..ce1a91f4a 100644 --- a/Modules/Panels/SystemStats/SystemStatsPanel.qml +++ b/Modules/Panels/SystemStats/SystemStatsPanel.qml @@ -39,7 +39,7 @@ SmartPanel { // HEADER NBox { Layout.fillWidth: true - implicitHeight: headerRow.implicitHeight + (Style.marginXL) + implicitHeight: headerRow.implicitHeight + Style.margin2M RowLayout { id: headerRow @@ -277,7 +277,7 @@ SmartPanel { // Detailed Stats section NBox { Layout.fillWidth: true - implicitHeight: detailsColumn.implicitHeight + Style.marginXL + implicitHeight: detailsColumn.implicitHeight + Style.margin2M ColumnLayout { id: detailsColumn diff --git a/Modules/Toast/Toast.qml b/Modules/Toast/Toast.qml index 2e6f07d04..92795f05f 100644 --- a/Modules/Toast/Toast.qml +++ b/Modules/Toast/Toast.qml @@ -23,7 +23,7 @@ Item { readonly property int shadowPadding: Style.shadowBlurMax + Style.marginL width: notificationWidth + shadowPadding * 2 - height: Math.round(contentLayout.implicitHeight + Style.marginXL * 2 + shadowPadding * 2) + height: Math.round(contentLayout.implicitHeight + Style.margin2M * 2 + shadowPadding * 2) visible: true opacity: 0 scale: initialScale @@ -287,8 +287,8 @@ Item { anchors.fill: background anchors.topMargin: Style.marginM anchors.bottomMargin: Style.marginM - anchors.leftMargin: Style.marginXL - anchors.rightMargin: Style.marginXL + anchors.leftMargin: Style.margin2M + anchors.rightMargin: Style.margin2M spacing: Style.marginL // Icon diff --git a/Widgets/NCollapsible.qml b/Widgets/NCollapsible.qml index f73731d8e..37f8bf6a3 100644 --- a/Widgets/NCollapsible.qml +++ b/Widgets/NCollapsible.qml @@ -23,7 +23,7 @@ ColumnLayout { Rectangle { id: headerContainer Layout.fillWidth: true - Layout.preferredHeight: headerContent.implicitHeight + (Style.marginXL) + Layout.preferredHeight: headerContent.implicitHeight + Style.margin2M color: root.expanded ? Color.mSecondary : Color.mPrimary radius: Style.iRadiusM border.color: root.expanded ? Color.mOnSecondary : Color.mOutline diff --git a/Widgets/NComboBox.qml b/Widgets/NComboBox.qml index e265dc48a..09a5b7649 100644 --- a/Widgets/NComboBox.qml +++ b/Widgets/NComboBox.qml @@ -247,7 +247,7 @@ RowLayout { popup: Popup { y: combo.height + Style.marginS implicitWidth: combo.width - implicitHeight: Math.min(Math.round(root.popupHeight * Style.uiScaleRatio), listView.contentHeight + Style.marginXL) + implicitHeight: Math.min(Math.round(root.popupHeight * Style.uiScaleRatio), listView.contentHeight + Style.margin2M) padding: Style.marginM onOpened: { diff --git a/Widgets/NPopupContextMenu.qml b/Widgets/NPopupContextMenu.qml index 315c01178..ff8621607 100644 --- a/Widgets/NPopupContextMenu.qml +++ b/Widgets/NPopupContextMenu.qml @@ -74,7 +74,7 @@ PopupWindow { itemWidth += iconMeasure.width + Style.marginS; } - itemWidth += Style.marginXL; + itemWidth += Style.margin2M; if (itemWidth > maxWidth) { maxWidth = itemWidth; diff --git a/Widgets/NTabButton.qml b/Widgets/NTabButton.qml index 73f3162e7..8a3e4a6ff 100644 --- a/Widgets/NTabButton.qml +++ b/Widgets/NTabButton.qml @@ -2,6 +2,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts import qs.Commons +import qs.Services.UI import qs.Widgets Rectangle { @@ -25,7 +26,7 @@ Rectangle { // Sizing Layout.fillHeight: true - implicitWidth: contentLayout.implicitWidth + Style.marginXL + implicitWidth: contentLayout.implicitWidth + Style.margin2M topLeftRadius: isFirst ? Style.iRadiusM : Style.iRadiusXXXS bottomLeftRadius: isFirst ? Style.iRadiusM : Style.iRadiusXXXS