Changeset View
Changeset View
Standalone View
Standalone View
src/activities/gletters/Gletters.qml
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | 78 | Component.onCompleted: { | |||
---|---|---|---|---|---|
81 | activity.stop.connect(stop) | 81 | activity.stop.connect(stop) | ||
82 | } | 82 | } | ||
83 | 83 | | |||
84 | QtObject { | 84 | QtObject { | ||
85 | id: items | 85 | id: items | ||
86 | property Item main: activity.main | 86 | property Item main: activity.main | ||
87 | property Item ourActivity: activity | 87 | property Item ourActivity: activity | ||
88 | property GCAudio audioVoices: activity.audioVoices | 88 | property GCAudio audioVoices: activity.audioVoices | ||
89 | property var levels: activity.datasetLoader.item !== null ? activity.datasetLoader.item.data : null | ||||
90 | property var instructionText: "" | ||||
jjazeix: string? | |||||
89 | property alias background: background | 91 | property alias background: background | ||
90 | property alias bar: bar | 92 | property alias bar: bar | ||
91 | property alias bonus: bonus | 93 | property alias bonus: bonus | ||
92 | property alias wordlist: wordlist | 94 | property alias wordlist: wordlist | ||
93 | property alias score: score | 95 | property alias score: score | ||
94 | property alias keyboard: keyboard | 96 | property alias keyboard: keyboard | ||
95 | property alias wordDropTimer: wordDropTimer | 97 | property alias wordDropTimer: wordDropTimer | ||
96 | property GCSfx audioEffects: activity.audioEffects | 98 | property GCSfx audioEffects: activity.audioEffects | ||
97 | property alias locale: background.locale | 99 | property alias locale: background.locale | ||
98 | property alias textinput: textinput | 100 | property alias textinput: textinput | ||
99 | } | 101 | } | ||
100 | 102 | | |||
101 | onStart: { | 103 | onStart: { | ||
102 | Activity.start(items, uppercaseOnly, mode); | 104 | Activity.start(items, uppercaseOnly, mode); | ||
103 | Activity.focusTextInput() | 105 | Activity.focusTextInput() | ||
104 | } | 106 | } | ||
105 | onStop: { Activity.stop() } | 107 | onStop: { Activity.stop() } | ||
106 | 108 | | |||
109 | //instruction rectangle | ||||
110 | Rectangle { | ||||
111 | id: instruction | ||||
112 | anchors { | ||||
113 | top: parent.top | ||||
114 | topMargin: 5 | ||||
115 | horizontalCenter: parent.horizontalCenter | ||||
116 | } | ||||
117 | height: instructionTxt.contentHeight * 1.1 | ||||
118 | width: Math.max(Math.min(parent.width * 0.8, instructionTxt.text.length * 10), parent.width * 0.3) | ||||
parent.width * 0.3 seems to small, can you make it at least half of the screen? jjazeix: parent.width * 0.3 seems to small, can you make it at least half of the screen? | |||||
@jjazeix I tried using 0.5, but it looks to far stretched https://snag.gy/zfLn6A.jpg (using 0.5) https://snag.gy/Bkx1MZ.jpg (using 0.3) what do you say AkshayCHD: @jjazeix I tried using 0.5, but it looks to far stretched https://snag.gy/zfLn6A.jpg (using 0. | |||||
2 points to take in account:
jjazeix: 2 points to take in account:
* how does it render on smaller screens (phones)
* when it is… | |||||
119 | opacity: 0.8 | ||||
120 | visible: items.levels | ||||
121 | radius: 10 | ||||
122 | border.width: 2 | ||||
123 | z: 10 | ||||
124 | border.color: "#DDD" | ||||
125 | color: "#373737" | ||||
126 | | ||||
127 | Behavior on opacity { PropertyAnimation { duration: 200 } } | ||||
128 | | ||||
129 | //shows/hides the Instruction | ||||
130 | MouseArea { | ||||
131 | anchors.fill: parent | ||||
132 | onClicked: instruction.opacity = instruction.opacity == 0 ? 0.8 : 0 | ||||
133 | } | ||||
134 | | ||||
135 | GCText { | ||||
136 | id: instructionTxt | ||||
137 | anchors { | ||||
138 | top: parent.top | ||||
139 | topMargin: 5 | ||||
140 | horizontalCenter: parent.horizontalCenter | ||||
141 | } | ||||
142 | opacity: instruction.opacity | ||||
143 | z: instruction.z | ||||
144 | fontSize: smallSize | ||||
145 | color: "white" | ||||
146 | text: items.instructionText | ||||
147 | horizontalAlignment: Text.AlignHCenter | ||||
148 | width: parent.width * 0.8 | ||||
149 | wrapMode: TextEdit.WordWrap | ||||
150 | } | ||||
151 | } | ||||
152 | | ||||
107 | TextInput { | 153 | TextInput { | ||
108 | // Helper element to capture composed key events like french ô which | 154 | // Helper element to capture composed key events like french ô which | ||
109 | // are not available via Keys.onPressed() on linux. Must be | 155 | // are not available via Keys.onPressed() on linux. Must be | ||
110 | // disabled on mobile! | 156 | // disabled on mobile! | ||
111 | id: textinput | 157 | id: textinput | ||
112 | anchors.centerIn: background | 158 | anchors.centerIn: background | ||
113 | enabled: !ApplicationInfo.isMobile | 159 | enabled: !ApplicationInfo.isMobile | ||
114 | focus: true | 160 | focus: true | ||
▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines |
string?