diff options
Diffstat (limited to 'src/imports/controls/macos/ScrollBar.qml')
-rw-r--r-- | src/imports/controls/macos/ScrollBar.qml | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/imports/controls/macos/ScrollBar.qml b/src/imports/controls/macos/ScrollBar.qml index cfd5735e..72430e95 100644 --- a/src/imports/controls/macos/ScrollBar.qml +++ b/src/imports/controls/macos/ScrollBar.qml @@ -34,10 +34,29 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.NativeStyle 6.0 as NativeStyle +import QtQuick +import QtQuick.Controls +import QtQuick.NativeStyle as NativeStyle NativeStyle.DefaultScrollBar { + id: controlRoot + + contentItem: NativeStyle.ScrollBar { + control: controlRoot + subControl: NativeStyle.ScrollBar.Handle + overrideState: NativeStyle.ScrollBar.NeverHovered + } + + NativeStyle.ScrollBar { + // Fade a hovered-looking version of the handle + // on top of the default handle when hovering it + anchors.fill: contentItem + control: controlRoot + subControl: NativeStyle.ScrollBar.Handle + overrideState: NativeStyle.ScrollBar.AlwaysHovered + opacity: controlRoot.hovered || control.pressed ? 1 : 0 + visible: contentItem instanceof NativeStyle.StyleItem + Behavior on opacity { NumberAnimation { duration: 150 } } + } + } |