From e87f9c921571a8da1467fc40fecbafc9e2ef2101 Mon Sep 17 00:00:00 2001 From: Ales Kutsepau Date: Tue, 24 Mar 2026 15:56:53 +0100 Subject: [PATCH 1/2] scrollbar and scrollindicator size and color updates --- src/EasyApp/Gui/Elements/ScrollBar.qml | 22 +++++++++++++------- src/EasyApp/Gui/Elements/ScrollIndicator.qml | 9 ++++++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/EasyApp/Gui/Elements/ScrollBar.qml b/src/EasyApp/Gui/Elements/ScrollBar.qml index 1384ecda..8460a467 100644 --- a/src/EasyApp/Gui/Elements/ScrollBar.qml +++ b/src/EasyApp/Gui/Elements/ScrollBar.qml @@ -2,6 +2,8 @@ import QtQuick import QtQuick.Templates as T import QtQuick.Controls.Material +import EasyApp.Gui.Style as EaStyle + T.ScrollBar { id: control @@ -10,25 +12,29 @@ T.ScrollBar { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) - padding: control.interactive ? 1 : 2 + + property int _padding: control.interactive ? 1 : 2 + padding: _padding + topInset: parent.showHeader ? parent.tableRowHeight : 0 + topPadding: parent.showHeader ? parent.tableRowHeight + _padding : 0 visible: control.policy !== T.ScrollBar.AlwaysOff minimumSize: orientation === Qt.Horizontal ? height / width : width / height contentItem: Rectangle { - implicitWidth: control.interactive ? 13 : 4 - implicitHeight: control.interactive ? 13 : 4 + implicitWidth: control.interactive ? 6 : 4 + implicitHeight: control.interactive ? 6 : 4 color: control.pressed ? - control.Material.scrollBarPressedColor : + EaStyle.Colors.themeAccent : control.interactive && control.hovered ? - control.Material.scrollBarHoveredColor : - control.Material.scrollBarColor + EaStyle.Colors.themeForegroundMinor : + EaStyle.Colors.themeForegroundDisabled opacity: 0.0 } background: Rectangle { - implicitWidth: control.interactive ? 16 : 4 - implicitHeight: control.interactive ? 16 : 4 + implicitWidth: control.interactive ? 8 : 4 + implicitHeight: control.interactive ? 8 : 4 color: "#0e000000" opacity: 0.0 visible: control.interactive diff --git a/src/EasyApp/Gui/Elements/ScrollIndicator.qml b/src/EasyApp/Gui/Elements/ScrollIndicator.qml index 0e99a83f..8f8a767b 100644 --- a/src/EasyApp/Gui/Elements/ScrollIndicator.qml +++ b/src/EasyApp/Gui/Elements/ScrollIndicator.qml @@ -1,6 +1,8 @@ import QtQuick import QtQuick.Templates as T +import EasyApp.Gui.Style as EaStyle + T.ScrollIndicator { id: control @@ -9,13 +11,16 @@ T.ScrollIndicator { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) - padding: 2 + property int _padding: 2 + padding: _padding + topInset: parent.showHeader ? parent.tableRowHeight : 0 + topPadding: parent.showHeader ? parent.tableRowHeight + _padding : 0 contentItem: Rectangle { implicitWidth: 4 implicitHeight: 4 - ///color: control.Material.scrollBarColor + color: EaStyle.Colors.themeForegroundDisabled visible: control.size < 1.0 opacity: 0.0 From e73f6ad6499aa0fca9ffdb05d00ca57fd9e37359 Mon Sep 17 00:00:00 2001 From: Ales Kutsepau Date: Tue, 24 Mar 2026 16:17:25 +0100 Subject: [PATCH 2/2] added radius and a flag to snap to header --- src/EasyApp/Gui/Elements/ScrollBar.qml | 15 ++++++++------- src/EasyApp/Gui/Elements/ScrollIndicator.qml | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/EasyApp/Gui/Elements/ScrollBar.qml b/src/EasyApp/Gui/Elements/ScrollBar.qml index 8460a467..5fad1c09 100644 --- a/src/EasyApp/Gui/Elements/ScrollBar.qml +++ b/src/EasyApp/Gui/Elements/ScrollBar.qml @@ -12,17 +12,18 @@ T.ScrollBar { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) - + property bool snapToHeader: false property int _padding: control.interactive ? 1 : 2 padding: _padding - topInset: parent.showHeader ? parent.tableRowHeight : 0 - topPadding: parent.showHeader ? parent.tableRowHeight + _padding : 0 + topInset: snapToHeader && parent.showHeader ? parent.tableRowHeight : 0 + topPadding: snapToHeader && parent.showHeader ? parent.tableRowHeight + _padding : 0 visible: control.policy !== T.ScrollBar.AlwaysOff minimumSize: orientation === Qt.Horizontal ? height / width : width / height contentItem: Rectangle { - implicitWidth: control.interactive ? 6 : 4 - implicitHeight: control.interactive ? 6 : 4 + implicitWidth: 4 + implicitHeight: 4 + radius: width / 4 color: control.pressed ? EaStyle.Colors.themeAccent : @@ -33,8 +34,8 @@ T.ScrollBar { } background: Rectangle { - implicitWidth: control.interactive ? 8 : 4 - implicitHeight: control.interactive ? 8 : 4 + implicitWidth: control.interactive ? 7 : 4 + implicitHeight: control.interactive ? 7 : 4 color: "#0e000000" opacity: 0.0 visible: control.interactive diff --git a/src/EasyApp/Gui/Elements/ScrollIndicator.qml b/src/EasyApp/Gui/Elements/ScrollIndicator.qml index 8f8a767b..321662f0 100644 --- a/src/EasyApp/Gui/Elements/ScrollIndicator.qml +++ b/src/EasyApp/Gui/Elements/ScrollIndicator.qml @@ -19,6 +19,7 @@ T.ScrollIndicator { contentItem: Rectangle { implicitWidth: 4 implicitHeight: 4 + radius: width / 4 color: EaStyle.Colors.themeForegroundDisabled visible: control.size < 1.0