From 5404ca22fbc826415466bd834e5055404294da0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= Date: Wed, 25 Sep 2019 23:55:21 -0400 Subject: Fix QML binding loop in TextImageButton (used in incoming call popup) --- src/gui/qml/TextImageButton.qml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/qml/TextImageButton.qml b/src/gui/qml/TextImageButton.qml index 83f61d7..c183630 100644 --- a/src/gui/qml/TextImageButton.qml +++ b/src/gui/qml/TextImageButton.qml @@ -12,6 +12,12 @@ Rectangle { signal clicked color: "red" + // Pre-compute this to avoid binding color to itself + property color darkerColor + Component.onCompleted: { + darkerColor = Qt.darker(color) + } + z: 2 Image { @@ -53,7 +59,7 @@ Rectangle { states: State { name: "pressed"; when: mouseArea.pressed - PropertyChanges { target: backgroundRect; color: Qt.darker(color) } + PropertyChanges { target: backgroundRect; color: darkerColor } } } -- cgit v1.2.3