From 6d032e5159695b3fb5319627630a292114047ef4 Mon Sep 17 00:00:00 2001 From: notiant <238434866+notiant@users.noreply.github.com> Date: Tue, 18 Nov 2025 10:12:44 +0100 Subject: [PATCH] Remove double bottom spacing in panels & hide scrollbar in NScrollView if not necessary --- Modules/Panels/Audio/AudioPanel.qml | 4 ---- Modules/Panels/Bluetooth/BluetoothPanel.qml | 4 ---- Modules/Panels/Calendar/CalendarPanel.qml | 1 + Widgets/NScrollView.qml | 10 ++++++---- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Modules/Panels/Audio/AudioPanel.qml b/Modules/Panels/Audio/AudioPanel.qml index 093d433f..d388c1cb 100644 --- a/Modules/Panels/Audio/AudioPanel.qml +++ b/Modules/Panels/Audio/AudioPanel.qml @@ -241,10 +241,6 @@ SmartPanel { } } } - - Item { - Layout.fillHeight: true - } } } } diff --git a/Modules/Panels/Bluetooth/BluetoothPanel.qml b/Modules/Panels/Bluetooth/BluetoothPanel.qml index 8c5a1fc9..9785f092 100644 --- a/Modules/Panels/Bluetooth/BluetoothPanel.qml +++ b/Modules/Panels/Bluetooth/BluetoothPanel.qml @@ -238,10 +238,6 @@ SmartPanel { } } } - - Item { - Layout.fillHeight: true - } } } } diff --git a/Modules/Panels/Calendar/CalendarPanel.qml b/Modules/Panels/Calendar/CalendarPanel.qml index e661b9cb..dd148704 100644 --- a/Modules/Panels/Calendar/CalendarPanel.qml +++ b/Modules/Panels/Calendar/CalendarPanel.qml @@ -650,6 +650,7 @@ SmartPanel { Loader { id: weatherLoader active: Settings.data.location.weatherEnabled && Settings.data.location.showCalendarWeather + visible: active Layout.fillWidth: true sourceComponent: WeatherCard { diff --git a/Widgets/NScrollView.qml b/Widgets/NScrollView.qml index b3699afe..6e2a8fa9 100644 --- a/Widgets/NScrollView.qml +++ b/Widgets/NScrollView.qml @@ -17,6 +17,8 @@ T.ScrollView { property bool preventHorizontalScroll: horizontalPolicy === ScrollBar.AlwaysOff property int boundsBehavior: Flickable.StopAtBounds property int flickableDirection: Flickable.VerticalFlick + readonly property bool verticalScrollable: contentItem.contentHeight > contentItem.height + readonly property bool horizontalScrollable: contentItem.contentWidth > contentItem.width implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) @@ -65,7 +67,7 @@ T.ScrollView { implicitHeight: 100 radius: root.handleRadius color: parent.pressed ? root.handlePressedColor : parent.hovered ? root.handleHoverColor : root.handleColor - opacity: parent.policy === ScrollBar.AlwaysOn || parent.active ? 1.0 : 0.0 + opacity: parent.policy === ScrollBar.AlwaysOn ? 1.0 : root.verticalScrollable ? (parent.active ? 1.0 : 0.0) : 0.0 Behavior on opacity { NumberAnimation { @@ -84,7 +86,7 @@ T.ScrollView { implicitWidth: root.handleWidth implicitHeight: 100 color: root.trackColor - opacity: parent.policy === ScrollBar.AlwaysOn || parent.active ? 0.3 : 0.0 + opacity: parent.policy === ScrollBar.AlwaysOn ? 0.3 : root.verticalScrollable ? (parent.active ? 0.3 : 0.0) : 0.0 radius: root.handleRadius / 2 Behavior on opacity { @@ -108,7 +110,7 @@ T.ScrollView { implicitHeight: root.handleWidth radius: root.handleRadius color: parent.pressed ? root.handlePressedColor : parent.hovered ? root.handleHoverColor : root.handleColor - opacity: parent.policy === ScrollBar.AlwaysOn || parent.active ? 1.0 : 0.0 + opacity: parent.policy === ScrollBar.AlwaysOn ? 1.0 : root.horizontalScrollable ? (parent.active ? 1.0 : 0.0) : 0.0 Behavior on opacity { NumberAnimation { @@ -127,7 +129,7 @@ T.ScrollView { implicitWidth: 100 implicitHeight: root.handleWidth color: root.trackColor - opacity: parent.policy === ScrollBar.AlwaysOn || parent.active ? 0.3 : 0.0 + opacity: parent.policy === ScrollBar.AlwaysOn ? 0.3 : root.horizontalScrollable ? (parent.active ? 0.3 : 0.0) : 0.0 radius: root.handleRadius / 2 Behavior on opacity {