Meshroom/meshroom/ui/qml/Controls/MScrollBar.qml
Candice Bentéjac 0e71f2a520 [qt6] Update versions for all the imported modules
Qt3D.Extras cannot be updated to 2.6 yet, otherwise there are errors.
2024-11-07 18:09:01 +01:00

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)
}
}