2022-06-03 11:26:02 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2018-06-26 13:53:07 +00:00
|
|
|
|
2020-12-01 12:57:32 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Particles
|
2018-06-26 13:53:07 +00:00
|
|
|
|
|
|
|
Item {
|
2024-09-02 14:11:53 +00:00
|
|
|
id: button
|
2018-06-26 13:53:07 +00:00
|
|
|
property alias imgSrc: image.source
|
|
|
|
property alias system: emitter.system
|
|
|
|
property alias group: emitter.group
|
|
|
|
signal clicked
|
|
|
|
property bool rotatedButton: false
|
|
|
|
|
|
|
|
width: image.width
|
|
|
|
height: image.sourceSize.height
|
|
|
|
Image {
|
|
|
|
id: image
|
|
|
|
height: parent.height
|
|
|
|
width: height/sourceSize.height * sourceSize.width
|
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2024-09-02 14:11:53 +00:00
|
|
|
rotation: button.rotatedButton ? ((Math.random() * 3 + 2) * (Math.random() <= 0.5 ? -1 : 1)) : 0
|
2018-06-26 13:53:07 +00:00
|
|
|
MenuEmitter {
|
|
|
|
id: emitter
|
|
|
|
anchors.fill: parent
|
|
|
|
//shape: MaskShape {source: image.source}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {parent.clicked(); emitter.burst(400);}
|
|
|
|
}
|
|
|
|
}
|