diff options
Diffstat (limited to 'src/quickcontrols/macos/impl/SwitchHandle.qml')
-rw-r--r-- | src/quickcontrols/macos/impl/SwitchHandle.qml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/quickcontrols/macos/impl/SwitchHandle.qml b/src/quickcontrols/macos/impl/SwitchHandle.qml new file mode 100644 index 0000000000..3ef17410e4 --- /dev/null +++ b/src/quickcontrols/macos/impl/SwitchHandle.qml @@ -0,0 +1,27 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +import QtQuick +import QtQuick.Templates as T +import QtQuick.Effects + +Rectangle { + id: handle + width: 20 + height: 20 + radius: 10 + color: Qt.styleHints.colorScheme === Qt.Light + ? Qt.darker(palette.base, down ? 1.05 : 1) + : Qt.lighter("#cdcbc9", down ? 1.05 : 1) + + required property bool down + + layer.enabled: true + layer.effect: MultiEffect { + shadowEnabled: true + blurMax: 10 + shadowBlur: 0.2 + shadowScale: 0.92 + shadowOpacity: 1 + } +} |