ukui-menu/qml/AppControls2/ScrollBar.qml

27 lines
747 B
QML

import QtQuick 2.0
import QtQuick.Controls 2.5
import org.ukui.menu.core 1.0
import org.ukui.quick.items 1.0 as UkuiItems
import org.ukui.quick.platform 1.0 as Platform
ScrollBar {
id: control
padding: (hovered || pressed) ? 3 : 5
property bool visual: true
Behavior on padding {
NumberAnimation {
duration: 200
easing.type: Easing.InOutQuad
}
}
contentItem: UkuiItems.StyleBackground {
radius: width / 2
useStyleTransparency: false
paletteRole: Platform.Theme.Text
alpha: control.pressed ? 0.28 : control.hovered ? 0.18 : 0.10
opacity: ((control.policy === ScrollBar.AlwaysOn || control.size < 1.0 ) && control.visual) ? 1.0 : 0.0
}
}