From c4402bf42656bce6d52c32bbf13379a7a8c2649f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 24 Apr 2017 16:28:31 +0200 Subject: [PATCH] fix(ui/modules/Linphone/TelKeypad/TelKeypad): clear correctly button color --- .../ui/modules/Linphone/TelKeypad/TelKeypad.qml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/linphone-desktop/ui/modules/Linphone/TelKeypad/TelKeypad.qml b/linphone-desktop/ui/modules/Linphone/TelKeypad/TelKeypad.qml index 33a2488c4..4257c0ddf 100644 --- a/linphone-desktop/ui/modules/Linphone/TelKeypad/TelKeypad.qml +++ b/linphone-desktop/ui/modules/Linphone/TelKeypad/TelKeypad.qml @@ -66,6 +66,8 @@ Rectangle { }] TelKeypadButton { + property var _timeout + Layout.fillHeight: true Layout.fillWidth: true @@ -84,7 +86,6 @@ Rectangle { readonly property int delta: 5 - property var _timeout property int _id property var _mouseX property var _mouseY @@ -107,15 +108,17 @@ Rectangle { onReleased: { if (Math.abs(_mouseX - mouse.x) <= delta && Math.abs(_mouseY - mouse.y) <= delta) { - grid.children[_id].color = TelKeypadStyle.button.color.pressed + var children = grid.children[_id] - grid.children[_id].clicked() + children.color = TelKeypadStyle.button.color.pressed + children.clicked() - if (_timeout) { - Utils.clearTimeout(_timeout) + var timeout = children._timeout + if (timeout) { + Utils.clearTimeout(timeout) } - _timeout = Utils.setTimeout(this, 100, (function (id) { + children._timeout = Utils.setTimeout(this, 100, (function (id) { grid.children[id].color = TelKeypadStyle.button.color.normal }).bind(this, _id)) }