2020-06-20 02:03:04 +10:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.12
|
|
|
|
|
|
|
|
ScrollBar {
|
2020-06-23 03:48:55 +10:00
|
|
|
id: scrollBar
|
2020-07-12 14:25:57 +10:00
|
|
|
|
2020-06-20 02:03:04 +10:00
|
|
|
minimumSize: (Math.min(height / 1.5, 48) * theme.uiScale) / height
|
2020-06-23 03:48:55 +10:00
|
|
|
opacity: size < 1 && (active || hovered) ? 1 : 0
|
|
|
|
padding: 0
|
|
|
|
|
|
|
|
background: Rectangle {
|
2020-06-26 22:21:24 +10:00
|
|
|
color: theme.controls.scrollBar.track
|
2020-06-23 03:48:55 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: Item {
|
2020-06-26 22:21:24 +10:00
|
|
|
implicitWidth: theme.controls.scrollBar.width
|
2020-06-23 03:48:55 +10:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
2020-06-26 22:21:24 +10:00
|
|
|
anchors.leftMargin: theme.controls.scrollBar.sliderPadding
|
2020-06-23 03:48:55 +10:00
|
|
|
anchors.rightMargin: anchors.leftMargin
|
|
|
|
|
2020-06-26 22:21:24 +10:00
|
|
|
radius: theme.controls.scrollBar.sliderRadius
|
2020-06-23 03:48:55 +10:00
|
|
|
color:
|
2020-06-26 22:21:24 +10:00
|
|
|
scrollBar.pressed ? theme.controls.scrollBar.pressedSlider :
|
|
|
|
sliderHover.hovered ? theme.controls.scrollBar.hoveredSlider :
|
|
|
|
theme.controls.scrollBar.slider
|
2020-06-23 03:48:55 +10:00
|
|
|
|
|
|
|
Behavior on color { HColorAnimation {} }
|
|
|
|
|
|
|
|
HoverHandler { id: sliderHover }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Behavior on opacity { HNumberAnimation {} }
|
2020-06-20 02:03:04 +10:00
|
|
|
}
|