mirror of
https://github.com/overte-org/overte.git
synced 2025-05-06 11:09:26 +02:00
36 lines
717 B
QML
36 lines
717 B
QML
import QtQuick 2.5
|
|
import QtQuick.Controls 1.4
|
|
|
|
StateImage {
|
|
id: button
|
|
property int hoverState: -1
|
|
property int defaultState: -1
|
|
|
|
signal clicked()
|
|
|
|
Timer {
|
|
id: asyncClickSender
|
|
interval: 10
|
|
repeat: false
|
|
running: false
|
|
onTriggered: button.clicked();
|
|
}
|
|
|
|
MouseArea {
|
|
id: mouseArea
|
|
hoverEnabled: true
|
|
anchors.fill: parent
|
|
onClicked: asyncClickSender.start();
|
|
onEntered: {
|
|
if (hoverState >= 0) {
|
|
buttonState = hoverState;
|
|
}
|
|
}
|
|
onExited: {
|
|
if (defaultState >= 0) {
|
|
buttonState = defaultState;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|