Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions src/EasyApp/Gui/Elements/ScrollBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
10 changes: 8 additions & 2 deletions src/EasyApp/Gui/Elements/ScrollIndicator.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import QtQuick
import QtQuick.Templates as T

import EasyApp.Gui.Style as EaStyle

T.ScrollIndicator {
id: control

Expand All @@ -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

Expand Down