2022-05-13 13:12:05 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2017-09-25 09:38:08 +00:00
|
|
|
|
2020-03-26 16:01:51 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
2017-09-25 09:38:08 +00:00
|
|
|
|
|
|
|
QtObject {
|
|
|
|
property var supportedStates: [
|
|
|
|
[],
|
|
|
|
["disabled"],
|
|
|
|
["pressed"],
|
2022-11-01 03:54:07 +00:00
|
|
|
["checkable", "checked"],
|
|
|
|
["checkable", "checked", "disabled"],
|
|
|
|
["checkable", "checked"],
|
2017-09-25 09:38:08 +00:00
|
|
|
["highlighted"],
|
|
|
|
["highlighted", "disabled"],
|
|
|
|
["highlighted", "pressed"],
|
2022-11-01 03:54:07 +00:00
|
|
|
["highlighted", "checkable"],
|
2017-09-25 09:38:08 +00:00
|
|
|
["highlighted", "checkable", "pressed"],
|
|
|
|
["highlighted", "checkable", "checked"],
|
|
|
|
["flat"],
|
|
|
|
["flat", "disabled"],
|
|
|
|
["flat", "pressed"],
|
|
|
|
["flat", "checkable"],
|
2022-11-01 03:54:07 +00:00
|
|
|
["flat", "checkable", "checked"],
|
2017-09-25 09:38:08 +00:00
|
|
|
["flat", "checkable", "pressed"],
|
|
|
|
["flat", "checkable", "checked", "pressed"],
|
|
|
|
["flat", "checkable", "highlighted"],
|
|
|
|
["flat", "checkable", "highlighted", "pressed"],
|
|
|
|
["flat", "checkable", "highlighted", "checked"]
|
|
|
|
]
|
|
|
|
|
|
|
|
property Component component: Button {
|
|
|
|
text: "Button"
|
|
|
|
enabled: !is("disabled")
|
|
|
|
flat: is("flat")
|
|
|
|
checkable: is("checkable")
|
2018-02-14 11:06:14 +00:00
|
|
|
checked: is("checked")
|
2017-09-25 09:38:08 +00:00
|
|
|
// Only set it if it's pressed, or the non-pressed examples will have no press effects
|
|
|
|
down: is("pressed") ? true : undefined
|
|
|
|
highlighted: is("highlighted")
|
|
|
|
}
|
|
|
|
}
|