Index: sources/gui/qml/components/TouchRect.qml =================================================================== diff -u -r27cb1be1e85e93cab858216f35c5d4d36a6ade5f -r5d211a3d77e20d369319231f5534211caf58fec2 --- sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision 27cb1be1e85e93cab858216f35c5d4d36a6ade5f) +++ sources/gui/qml/components/TouchRect.qml (.../TouchRect.qml) (revision 5d211a3d77e20d369319231f5534211caf58fec2) @@ -29,7 +29,7 @@ property alias pixelSize : _text.font.pixelSize property alias fgColor : _text.color //TODO need to update code to use bgColor instead of backgroundColor property -// property alias bgColor : _root.color +// property alias bgColor : _root.color property alias textString : _text.text property bool touchable : true @@ -55,10 +55,10 @@ Colors.backgroundButtonSelectDark : Qt.darker (_root.backgroundColor, 1.15) - Timer { id: clickDeboundeTimer + Timer { id: clickDebounceTimer interval: _root.debouncingTime // ms } - Timer { id: pressDeboundeTimer + Timer { id: pressDebounceTimer interval: _root.debouncingTime // ms } QtObject { id: _private @@ -85,8 +85,8 @@ return _root.borderColor } - property bool clickDeboucing: clickDeboundeTimer.running // if a click/press happens the timer starts, meaning we have to debounce. - property bool pressDeboucing: pressDeboundeTimer.running // if a click/press happens the timer starts, meaning we have to debounce. + property bool clickDeboucing: clickDebounceTimer.running // if a click/press happens the timer starts, meaning we have to debounce. + property bool pressDeboucing: pressDebounceTimer.running // if a click/press happens the timer starts, meaning we have to debounce. property bool pressed : false // this will take care of releases happening during debounced press, therefor no release should happen as well. } @@ -121,8 +121,7 @@ border.width: Variables.borderWidth function onMouseEventLog(vMsg) { - // DEBUG: - console.log(vMsg, _text.text, Qt.formatTime(new Date(), "hh:mm:ss.zzz")) + // DEBUG: console.log(vMsg, _text.text, Qt.formatTime(new Date(), "hh:mm:ss.zzz")) } Text { id: _text @@ -136,9 +135,9 @@ enabled : _root.touchable anchors.fill : parent anchors.margins : touchExpanding * -1 - onClicked : { if ( ! _private.clickDeboucing ) { onMouseEventLog("Clicked ") ; _root.clicked (); clickDeboundeTimer.start(); } } - onPressed : { if ( ! _private.pressDeboucing ) { onMouseEventLog("Pressed ") ; _private.pressed = true ; _root.pressed (); pressDeboundeTimer.start(); } } - onReleased : { if ( _private.pressed ) { onMouseEventLog("Released ") ; _private.pressed = false; _root.released (); pressDeboundeTimer.start(); } } - onPressAndHold : { onMouseEventLog("PressAndHold ") ; _root.pressAndHold(); } + onClicked : { if ( ! _private.clickDeboucing ) { onMouseEventLog("Clicked ") ; _root.clicked (); clickDebounceTimer.start(); } } + onPressed : { if ( ! _private.pressDeboucing ) { onMouseEventLog("Pressed ") ; _private.pressed = true ; _root.pressed (); pressDebounceTimer.start(); } } + onReleased : { if ( _private.pressed ) { onMouseEventLog("Released ") ; _private.pressed = false; _root.released (); pressDebounceTimer.start(); } } + onPressAndHold : { onMouseEventLog("PressAndHold ") ; _root.pressAndHold(); } } }