diff options
| author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2024-04-22 21:19:19 +0200 |
|---|---|---|
| committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2024-04-29 10:15:37 +0200 |
| commit | 257b09138d6c4f93fdc1e81f5a75af87e7a66718 (patch) | |
| tree | 768be857e9ce8e3e892757b8e33d5d3b9a58f7c9 /src/quickcontrols/macos/impl/CheckIndicator.qml | |
| parent | b0e37f32b5547b6d870f8f8db473ad1bf11d8167 (diff) | |
macos style: add CheckIndicator
The macOS style is currently falling back to use
a CheckIndicator from the Fusion style. This doesn't look
very native on macOS.
This patch will therefore implement the missing
CheckIndicator for the macOS style, and try to make
it look as native as possible.
Change-Id: I4c0a56de3972a92e4e3791852c043f08a2006eb1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quickcontrols/macos/impl/CheckIndicator.qml')
| -rw-r--r-- | src/quickcontrols/macos/impl/CheckIndicator.qml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/quickcontrols/macos/impl/CheckIndicator.qml b/src/quickcontrols/macos/impl/CheckIndicator.qml new file mode 100644 index 0000000000..9a41895475 --- /dev/null +++ b/src/quickcontrols/macos/impl/CheckIndicator.qml @@ -0,0 +1,21 @@ +// Copyright (C) 2024 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.Controls.impl + +Item { + id: indicator + implicitWidth: 14 + implicitHeight: 10 + + property Item control + + ColorImage { + y: (parent.height - height) / 2 + color: control.palette.text + source: "qrc:/qt-project.org/imports/QtQuick/Controls/macOS/images/checkmark.png" + visible: indicator.control.checkState === Qt.Checked + || (indicator.control.checked && indicator.control.checkState === undefined) + } +} |
