ukui-menu/qml/AppControls2/ScrollBar.qml

27 lines
747 B
QML
Raw Normal View History

2023-02-13 16:38:54 +08:00
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
2023-02-13 16:38:54 +08:00
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 {
2023-02-13 16:38:54 +08:00
radius: width / 2
useStyleTransparency: false
paletteRole: Platform.Theme.Text
2023-02-13 16:38:54 +08:00
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
}
}