mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-30 02:37:26 +02:00
28 lines
No EOL
762 B
QML
28 lines
No EOL
762 B
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
|
|
/**
|
|
* MScrollBar is a custom scrollbar implementation.
|
|
* It is a vertical scrollbar that can be used to scroll a ListView.
|
|
*/
|
|
|
|
ScrollBar {
|
|
id: root
|
|
policy: ScrollBar.AlwaysOn
|
|
|
|
visible: root.horizontal ? parent.contentWidth > parent.width : parent.contentHeight > parent.height
|
|
minimumSize: 0.1
|
|
|
|
Component.onCompleted: {
|
|
contentItem.color = Qt.lighter(palette.mid, 2)
|
|
}
|
|
|
|
onHoveredChanged: {
|
|
if (pressed) return
|
|
contentItem.color = hovered ? Qt.lighter(palette.mid, 3) : Qt.lighter(palette.mid, 2)
|
|
}
|
|
|
|
onPressedChanged: {
|
|
contentItem.color = pressed ? Qt.lighter(palette.mid, 4) : hovered ? Qt.lighter(palette.mid, 3) : Qt.lighter(palette.mid, 2)
|
|
}
|
|
} |