diff --git a/src/EasyApp/Gui/Elements/ScrollBar.qml b/src/EasyApp/Gui/Elements/ScrollBar.qml index 1384ecd..5fad1c0 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,30 @@ T.ScrollBar { implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) - padding: control.interactive ? 1 : 2 + property bool snapToHeader: false + property int _padding: control.interactive ? 1 : 2 + padding: _padding + 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 ? 13 : 4 - implicitHeight: control.interactive ? 13 : 4 + implicitWidth: 4 + implicitHeight: 4 + radius: width / 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 ? 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 0e99a83..321662f 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,17 @@ 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 + radius: width / 4 - ///color: control.Material.scrollBarColor + color: EaStyle.Colors.themeForegroundDisabled visible: control.size < 1.0 opacity: 0.0