Index: sources/gui/qml/components/TouchRect.qml =================================================================== diff -u -r227f28b202f81ab3dd04a81868697025ccab6220 -rd4b88173e0d4a683a315d2fc57b8e1ec356b1232 --- sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision 227f28b202f81ab3dd04a81868697025ccab6220) +++ sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision d4b88173e0d4a683a315d2fc57b8e1ec356b1232) @@ -14,7 +14,6 @@ // Qt import QtQuick 2.12 -import QtQuick.Controls 2.12 // Project // Qml imports @@ -36,8 +35,10 @@ property color textColor : Colors.textButton property color borderColor : Colors.borderButton - property color backgroungColor : Colors.backgroundButtonNormal + property color backgroundColor : Colors.backgroundButtonNormal + signal clicked + onDurationChanged: { _colorAnimationOn .duration = duration; _colorAnimationOff.duration = duration; @@ -51,14 +52,10 @@ } } else { _clickAnimation.stop() - _root.color = backgroungColor + _root.color = backgroundColor } } - onBackgroungColorChanged: { - _root.color = backgroungColor - } - onDisabledChanged: { if (disabled) { text.color = Colors.textDisableButton @@ -72,31 +69,32 @@ width : Variables.touchRectWidth height : Variables.touchRectHeight radius : Variables.touchRectRadius - color : backgroungColor + color : backgroundColor border { - color: Colors.borderButton + color: borderColor width: Variables.borderWidth } Text { id: _text anchors.centerIn: parent - color: Colors.textMain + color: textColor font.pixelSize: Fonts.fontPixelButton } MouseArea { id: _mouseArea anchors.fill: parent - onPressed: { + onClicked : { if ( disabled ) { return } animate(true) + _root.clicked() } } SequentialAnimation { id: _clickAnimation running: false onStopped: { - _root.color = backgroungColor + _root.color = backgroundColor } onFinished: { - _root.color = backgroungColor + _root.color = backgroundColor } PropertyAnimation { id: _colorAnimationOn ; target: _root; property: "color"; to: _root.border.color; duration: duration; } PropertyAnimation { id: _colorAnimationOff; target: _root; property: "color"; to: _root.color ; duration: duration; }