2023-02-13 16:38:54 +08:00
|
|
|
import QtQuick 2.0
|
|
|
|
import QtQuick.Controls 2.5
|
|
|
|
import org.ukui.menu.core 1.0
|
2024-01-18 03:24:01 +08:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-18 03:24:01 +08:00
|
|
|
contentItem: UkuiItems.StyleBackground {
|
2023-02-13 16:38:54 +08:00
|
|
|
radius: width / 2
|
2024-01-18 03:24:01 +08:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|