Changeset View
Changeset View
Standalone View
Standalone View
src/activities/scalesboard/Question.qml
Show All 33 Lines | 33 | Rectangle { | |||
---|---|---|---|---|---|
34 | id: questionBg | 34 | id: questionBg | ||
35 | x: questionText.x - 4 | 35 | x: questionText.x - 4 | ||
36 | y: questionText.y - 4 | 36 | y: questionText.y - 4 | ||
37 | width: questionText.width + 8 | 37 | width: questionText.width + 8 | ||
38 | height: questionText.height + 8 | 38 | height: questionText.height + 8 | ||
39 | border.color: "black" | 39 | border.color: "black" | ||
40 | border.width: 2 | 40 | border.width: 2 | ||
41 | radius: 8 | 41 | radius: 8 | ||
42 | opacity: question.displayed ? 1 : 0 | 42 | opacity: question.displayed ? 1 : 0 | ||
jjazeix: you don't need to set the opacity to 0 if it is not visible | |||||
I forget to update this. Sorry for that. I would change the opacity and update the diff. dekumar: I forget to update this. Sorry for that. I would change the opacity and update the diff.
| |||||
43 | 43 | | |||
44 | gradient: Gradient { | 44 | gradient: Gradient { | ||
45 | GradientStop { position: 0.0; color: "#F0FFFFFF" } | 45 | GradientStop { position: 0.0; color: "#F0FFFFFF" } | ||
46 | GradientStop { position: 0.9; color: "#F0F0F0F0" } | 46 | GradientStop { position: 0.9; color: "#F0F0F0F0" } | ||
47 | GradientStop { position: 1.0; color: "#F0CECECE" } | 47 | GradientStop { position: 1.0; color: "#F0CECECE" } | ||
48 | } | 48 | } | ||
49 | 49 | | |||
50 | Behavior on opacity { NumberAnimation { duration: 100 } } | 50 | Behavior on opacity { NumberAnimation { duration: 100 } } | ||
51 | } | 51 | } | ||
52 | 52 | | |||
53 | GCText { | 53 | GCText { | ||
54 | id: questionText | 54 | id: questionText | ||
55 | color: "black" | 55 | color: "black" | ||
56 | fontSize: largeSize | 56 | fontSize: largeSize | ||
57 | width: parent.width | 57 | width: parent.width | ||
58 | horizontalAlignment: Text.AlignHCenter | 58 | horizontalAlignment: Text.AlignHCenter | ||
59 | verticalAlignment: Text.AlignVCenter | 59 | verticalAlignment: Text.AlignVCenter | ||
60 | wrapMode: TextEdit.WordWrap | 60 | wrapMode: TextEdit.WordWrap | ||
61 | opacity: question.displayed ? 1 : 0 | 61 | opacity: question.displayed ? 1 : 0 | ||
jjazeix: same as above + opacity is a real between 0.0 and 1.0, not a boolean | |||||
yeah, I forgot to change this and by removing the displayed property. Would change the opacity to value between 0 to 1. dekumar: yeah, I forgot to change this and by removing the displayed property. Would change the opacity… | |||||
62 | text: question.text != "" ? question.text.arg(question.userEntry) : "" | 62 | text: question.text != "" ? question.text.arg(question.userEntry) : "" | ||
63 | Behavior on opacity { NumberAnimation { duration: 100 } } | 63 | Behavior on opacity { NumberAnimation { duration: 100 } } | ||
64 | 64 | | |||
65 | } | 65 | } | ||
66 | | ||||
67 | onUserEntryChanged: { | | |||
68 | if(userEntry === question.answer) | | |||
69 | bonus.good("flower") | | |||
70 | } | | |||
71 | } | 66 | } |
you don't need to set the opacity to 0 if it is not visible