summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Brière <fbriere@fbriere.net>2019-09-25 23:55:21 -0400
committerFrédéric Brière <fbriere@fbriere.net>2019-09-25 23:55:21 -0400
commit5404ca22fbc826415466bd834e5055404294da0a (patch)
treeb6deaa9bfcf67b19c50af1ca3a0d2833d257177f
parent05082ae12051821b1d969e6672d9e4e5afe1bc07 (diff)
downloadtwinkle-5404ca22fbc826415466bd834e5055404294da0a.tar
twinkle-5404ca22fbc826415466bd834e5055404294da0a.tar.gz
twinkle-5404ca22fbc826415466bd834e5055404294da0a.tar.lz
twinkle-5404ca22fbc826415466bd834e5055404294da0a.tar.xz
twinkle-5404ca22fbc826415466bd834e5055404294da0a.zip
Fix QML binding loop in TextImageButton (used in incoming call popup)
-rw-r--r--src/gui/qml/TextImageButton.qml8
1 files changed, 7 insertions, 1 deletions
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 }
}
}