aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/macos/impl/SwitchHandle.qml
blob: 3ef17410e49ef825fd7ce95096d06939593e86ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
    }
}