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
|
2016-07-27 09:12:41 +00:00
|
|
|
|
2020-03-26 16:01:51 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
2021-10-22 12:38:20 +00:00
|
|
|
import QtQuick.Templates as T
|
2016-07-27 09:12:41 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
implicitWidth: activeButton.implicitWidth
|
|
|
|
implicitHeight: activeButton.implicitHeight
|
|
|
|
|
|
|
|
property bool round: false
|
|
|
|
|
|
|
|
property string text
|
|
|
|
property bool flat
|
|
|
|
property bool hoverEnabled
|
|
|
|
property bool highlighted
|
|
|
|
property bool checked
|
|
|
|
property var down: undefined
|
|
|
|
|
2021-10-22 12:38:20 +00:00
|
|
|
property T.AbstractButton activeButton: round ? roundButton : button
|
2016-07-27 09:12:41 +00:00
|
|
|
|
|
|
|
Button {
|
|
|
|
id: button
|
|
|
|
visible: !round
|
|
|
|
text: root.text
|
|
|
|
flat: root.flat
|
|
|
|
hoverEnabled: root.hoverEnabled
|
|
|
|
highlighted: root.highlighted
|
|
|
|
checked: root.checked
|
|
|
|
down: root.down
|
|
|
|
enabled: root.enabled
|
|
|
|
}
|
|
|
|
|
|
|
|
RoundButton {
|
|
|
|
id: roundButton
|
|
|
|
visible: round
|
|
|
|
text: "\u2713"
|
|
|
|
flat: root.flat
|
|
|
|
hoverEnabled: root.hoverEnabled
|
|
|
|
highlighted: root.highlighted
|
|
|
|
checked: root.checked
|
|
|
|
down: root.down
|
|
|
|
enabled: root.enabled
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: root.text
|
2017-06-08 13:33:52 +00:00
|
|
|
font.pixelSize: roundButton.font.pixelSize * 0.5
|
2016-07-27 09:12:41 +00:00
|
|
|
anchors.top: parent.bottom
|
|
|
|
anchors.topMargin: 2
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|