From aede9bd13b6337f7efd6713792bd6b47721c3ac9 Mon Sep 17 00:00:00 2001 From: Lemmy Date: Sun, 25 Jan 2026 18:35:56 -0500 Subject: [PATCH] nscrollview: more fixes --- Modules/Notification/Notification.qml | 7 +++---- Modules/Panels/Launcher/Launcher.qml | 3 ++- .../NotificationHistory/NotificationHistoryPanel.qml | 5 +++-- .../ControlCenterWidgetSettingsDialog.qml | 5 ++++- .../DesktopWidgets/DesktopWidgetSettingsDialog.qml | 3 ++- .../Settings/Tabs/ColorScheme/SchemeDownloader.qml | 10 ++-------- Widgets/NColorPickerDialog.qml | 3 ++- Widgets/NIconPicker.qml | 3 +++ Widgets/NPluginSettingsPopup.qml | 5 +++-- Widgets/NSectionEditor.qml | 2 +- 10 files changed, 25 insertions(+), 21 deletions(-) diff --git a/Modules/Notification/Notification.qml b/Modules/Notification/Notification.qml index c54f715ce..0bca4b356 100644 --- a/Modules/Notification/Notification.qml +++ b/Modules/Notification/Notification.qml @@ -233,13 +233,12 @@ Variants { height: 2 color: "transparent" - readonly property real availableWidth: parent.width - (2 * parent.radius) - Rectangle { id: progressBar + readonly property real progressWidth: cardBackground.width - (2 * cardBackground.radius) height: parent.height - x: parent.parent.radius + (parent.availableWidth * (1 - model.progress)) / 2 - width: parent.availableWidth * model.progress + x: cardBackground.radius + (progressWidth * (1 - model.progress)) / 2 + width: progressWidth * model.progress color: { var baseColor = model.urgency === 2 ? Color.mError : model.urgency === 0 ? Color.mOnSurface : Color.mPrimary; diff --git a/Modules/Panels/Launcher/Launcher.qml b/Modules/Panels/Launcher/Launcher.qml index aa36c48ab..cb2aa8152 100644 --- a/Modules/Panels/Launcher/Launcher.qml +++ b/Modules/Panels/Launcher/Launcher.qml @@ -1306,6 +1306,7 @@ SmartPanel { } NScrollView { + id: descriptionScrollView Layout.alignment: Qt.AlignTop | Qt.AlignLeft Layout.topMargin: Style.fontSizeL + Style.marginXL Layout.fillWidth: true @@ -1314,7 +1315,7 @@ SmartPanel { reserveScrollbarSpace: false NText { - width: parent.availableWidth + width: descriptionScrollView.availableWidth text: root.results.length > 0 ? root.results[0].description : "" pointSize: Style.fontSizeM font.weight: Font.Bold diff --git a/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml b/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml index 0c9391f1a..454219c03 100644 --- a/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml +++ b/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml @@ -255,9 +255,10 @@ SmartPanel { NScrollView { id: scrollView anchors.fill: parent - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: ScrollBar.AsNeeded + horizontalPolicy: ScrollBar.AlwaysOff + verticalPolicy: ScrollBar.AsNeeded reserveScrollbarSpace: false + gradientColor: Color.mSurface // Track which notification is expanded property string expandedId: "" diff --git a/Modules/Panels/Settings/ControlCenter/ControlCenterWidgetSettingsDialog.qml b/Modules/Panels/Settings/ControlCenter/ControlCenterWidgetSettingsDialog.qml index 4d7c38b35..c2c570c7e 100644 --- a/Modules/Panels/Settings/ControlCenter/ControlCenterWidgetSettingsDialog.qml +++ b/Modules/Panels/Settings/ControlCenter/ControlCenterWidgetSettingsDialog.qml @@ -22,6 +22,7 @@ Popup { readonly property real settingsContentWidth: { if (settingsLoader.item && settingsLoader.item.implicitWidth > 0) { return settingsLoader.item.implicitWidth; + d; } return defaultContentWidth; } @@ -89,9 +90,11 @@ Popup { Layout.fillWidth: true Layout.fillHeight: true Layout.minimumHeight: 100 + gradientColor: Color.mSurface + reserveScrollbarSpace: false ColumnLayout { - width: scrollView.width + width: scrollView.availableWidth spacing: Style.marginM Loader { diff --git a/Modules/Panels/Settings/DesktopWidgets/DesktopWidgetSettingsDialog.qml b/Modules/Panels/Settings/DesktopWidgets/DesktopWidgetSettingsDialog.qml index 96c43cc98..6befb2c1e 100644 --- a/Modules/Panels/Settings/DesktopWidgets/DesktopWidgetSettingsDialog.qml +++ b/Modules/Panels/Settings/DesktopWidgets/DesktopWidgetSettingsDialog.qml @@ -90,9 +90,10 @@ Popup { Layout.fillWidth: true Layout.fillHeight: true Layout.minimumHeight: 100 + gradientColor: Color.mSurface ColumnLayout { - width: scrollView.width + width: scrollView.availableWidth spacing: Style.marginM Loader { diff --git a/Modules/Panels/Settings/Tabs/ColorScheme/SchemeDownloader.qml b/Modules/Panels/Settings/Tabs/ColorScheme/SchemeDownloader.qml index 6e54b4d5f..6dccf5fbd 100644 --- a/Modules/Panels/Settings/Tabs/ColorScheme/SchemeDownloader.qml +++ b/Modules/Panels/Settings/Tabs/ColorScheme/SchemeDownloader.qml @@ -837,16 +837,10 @@ Popup { visible: hasInitialData && availableSchemes.length > 0 verticalPolicy: ScrollBar.AsNeeded horizontalPolicy: ScrollBar.AlwaysOff - - // Only show scrollbar when content actually overflows (size < 1.0 means content is larger than viewport) - ScrollBar.vertical.visible: schemesScrollView.ScrollBar.vertical.size < 1.0 + gradientColor: Color.mSurface ColumnLayout { - width: { - // Always account for scrollbar width when it's visible (for testing with visible: true) - var scrollbarWidth = schemesScrollView.ScrollBar.vertical.visible ? (schemesScrollView.handleWidth + Style.marginS) : 0; - return parent.width - scrollbarWidth; - } + width: schemesScrollView.availableWidth spacing: Style.marginS Repeater { diff --git a/Widgets/NColorPickerDialog.qml b/Widgets/NColorPickerDialog.qml index fab1ba58b..540895d67 100644 --- a/Widgets/NColorPickerDialog.qml +++ b/Widgets/NColorPickerDialog.qml @@ -608,6 +608,7 @@ Popup { } NScrollView { + id: paletteScrollView Layout.fillWidth: true Layout.preferredHeight: Math.min(paletteGrid.implicitHeight, 200) verticalPolicy: paletteGrid.implicitHeight > 200 ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff @@ -615,7 +616,7 @@ Popup { GridLayout { id: paletteGrid - width: parent.availableWidth + width: paletteScrollView.availableWidth columns: 17 columnSpacing: 6 rowSpacing: 6 diff --git a/Widgets/NIconPicker.qml b/Widgets/NIconPicker.qml index 335336084..20ee31e4a 100644 --- a/Widgets/NIconPicker.qml +++ b/Widgets/NIconPicker.qml @@ -91,6 +91,9 @@ Popup { cellWidth: root.cellW cellHeight: root.cellH model: root.filteredIcons + reserveScrollbarSpace: false + gradientColor: Color.mSurface + delegate: Rectangle { width: grid.cellWidth height: grid.cellHeight diff --git a/Widgets/NPluginSettingsPopup.qml b/Widgets/NPluginSettingsPopup.qml index 2be7b67bf..01dc52cad 100644 --- a/Widgets/NPluginSettingsPopup.qml +++ b/Widgets/NPluginSettingsPopup.qml @@ -67,15 +67,16 @@ Popup { // Settings loader - pluginApi is passed via setSource() in openPluginSettings() NScrollView { + id: settingsScrollView Layout.fillWidth: true Layout.fillHeight: true Layout.minimumHeight: 100 horizontalPolicy: ScrollBar.AlwaysOff - rightPadding: verticalScrollable ? Style.marginM : 0 // Only add padding when scrollbar is visible + gradientColor: Color.mSurface Loader { id: settingsLoader - width: parent.width + width: settingsScrollView.availableWidth } } diff --git a/Widgets/NSectionEditor.qml b/Widgets/NSectionEditor.qml index 556439133..af5ce27da 100644 --- a/Widgets/NSectionEditor.qml +++ b/Widgets/NSectionEditor.qml @@ -37,7 +37,7 @@ NBox { } property var widgetRegistry: null - property string settingsDialogComponent: "BarWidgetSettingsDialog.qml" + property string settingsDialogComponent: "invalid-settings-dialog" property var screen: null // Screen reference for per-screen widget settings property var _activeDialog: null