Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/ApplicationPage.qml
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Line(s) | 140 | Button { | |||
---|---|---|---|---|---|
143 | text: i18n("Launch") | 143 | text: i18n("Launch") | ||
144 | onClicked: application.invokeApplication() | 144 | onClicked: application.invokeApplication() | ||
145 | } | 145 | } | ||
146 | } | 146 | } | ||
147 | } | 147 | } | ||
148 | 148 | | |||
149 | ColumnLayout { | 149 | ColumnLayout { | ||
150 | spacing: 0 | 150 | spacing: 0 | ||
151 | | ||||
152 | QQC2.Label { | 151 | QQC2.Label { | ||
153 | Layout.fillWidth: true | 152 | Layout.fillWidth: true | ||
153 | Text { | ||||
alexeymin: Why do you put a `Text` inside a label? Why not use `font.bold` property of Label itself? | |||||
This was actually the only way I could get it to work. Doing this: QQC2.Label { Layout.fillWidth: true text: appInfo.application.comment font.bold: true wrapMode: Text.WordWrap elide: Text.ElideRight maximumLineCount: 1 bottomPadding: 20 } ...had no effect, and did not make the text bold. ngraham: This was actually the only way I could get it to work. Doing this:
```
QQC2.Label {… | |||||
154 | text: appInfo.application.comment | 154 | text: appInfo.application.comment | ||
155 | font.bold: true | ||||
156 | } | ||||
155 | wrapMode: Text.WordWrap | 157 | wrapMode: Text.WordWrap | ||
156 | elide: Text.ElideRight | 158 | elide: Text.ElideRight | ||
157 | maximumLineCount: 1 | 159 | maximumLineCount: 1 | ||
160 | bottomPadding: 20 | ||||
158 | } | 161 | } | ||
159 | QQC2.Label { | 162 | | ||
163 | GridLayout { | ||||
164 | rowSpacing: 0 | ||||
165 | columns: 2 | ||||
160 | Layout.fillWidth: true | 166 | Layout.fillWidth: true | ||
Does Layout.fillWidth have an effect here? Shouldn't it be inside of QQC2.Label block? alexeymin: Does `Layout.fillWidth` have an effect here? Shouldn't it be inside of QQC2.Label block? | |||||
167 | | ||||
168 | // Category row | ||||
169 | QQC2.Label { | ||||
170 | Layout.alignment: Qt.AlignRight | ||||
171 | text: i18n("Category:") | ||||
172 | } | ||||
173 | QQC2.Label { | ||||
161 | elide: Text.ElideRight | 174 | elide: Text.ElideRight | ||
162 | text: appInfo.application.categoryDisplay | 175 | text: appInfo.application.categoryDisplay | ||
163 | color: Kirigami.Theme.linkColor | | |||
164 | } | 176 | } | ||
165 | 177 | | |||
166 | Item { | 178 | // Version row | ||
167 | Layout.fillWidth: true | 179 | QQC2.Label { | ||
168 | Layout.fillHeight: true | 180 | readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion | ||
181 | visible: version.length > 0 | ||||
182 | Layout.alignment: Qt.AlignRight | ||||
183 | text: i18n("Version:") | ||||
169 | } | 184 | } | ||
170 | QQC2.Label { | 185 | QQC2.Label { | ||
171 | readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion | 186 | readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion | ||
172 | visible: version.length > 0 | 187 | visible: version.length > 0 | ||
173 | text: version ? i18n("Version: %1", version) : "" | 188 | elide: Text.ElideRight | ||
189 | text: version ? i18n("%1", version) : "" | ||||
alexeymin: Translation is probably not needed here now | |||||
174 | } | 190 | } | ||
191 | | ||||
192 | // Size row | ||||
175 | QQC2.Label { | 193 | QQC2.Label { | ||
176 | text: i18n("Size: %1", appInfo.application.sizeDescription) | 194 | Layout.alignment: Qt.AlignRight | ||
195 | text: i18n("Size:") | ||||
177 | } | 196 | } | ||
178 | RowLayout { | | |||
179 | QQC2.Label { | 197 | QQC2.Label { | ||
198 | elide: Text.ElideRight | ||||
199 | text: i18n("%1", appInfo.application.sizeDescription) | ||||
200 | } | ||||
201 | | ||||
202 | // Source row | ||||
203 | QQC2.Label { | ||||
204 | Layout.alignment: Qt.AlignRight | ||||
180 | text: i18n("Source:") | 205 | text: i18n("Source:") | ||
181 | } | 206 | } | ||
182 | LinkButton { | 207 | LinkButton { | ||
183 | enabled: alternativeResourcesView.count > 1 | 208 | enabled: alternativeResourcesView.count > 1 | ||
184 | text: appInfo.application.displayOrigin | 209 | text: appInfo.application.displayOrigin | ||
210 | elide: Text.ElideRight | ||||
185 | onClicked: originsOverlay.open() | 211 | onClicked: originsOverlay.open() | ||
186 | } | 212 | } | ||
187 | } | 213 | | ||
188 | RowLayout { | 214 | // License row | ||
189 | QQC2.Label { | 215 | QQC2.Label { | ||
216 | Layout.alignment: Qt.AlignRight | ||||
190 | text: i18n("License:") | 217 | text: i18n("License:") | ||
191 | } | 218 | } | ||
192 | LinkButton { | 219 | LinkButton { | ||
193 | text: appInfo.application.license | 220 | text: appInfo.application.license | ||
194 | // tooltip: i18n("See full license terms") | 221 | // tooltip: i18n("See full license terms") | ||
195 | onClicked: Qt.openUrlExternally("https://spdx.org/licenses/" + appInfo.application.license + ".html#licenseText") | 222 | onClicked: Qt.openUrlExternally("https://spdx.org/licenses/" + appInfo.application.license + ".html#licenseText") | ||
196 | } | 223 | } | ||
197 | } | 224 | } | ||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |
Why do you put a Text inside a label? Why not use font.bold property of Label itself?