MauiKit Controls

AboutDialog.qml
1
2/*
3 * Copyright 2018 Camilo Higuita <milo.h@aol.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Library General Public License as
7 * published by the Free Software Foundation; either version 2, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21import QtQuick
22import QtQuick.Controls
23import QtQuick.Layouts
24import QtQuick.Window
25
26import org.mauikit.controls as Maui
27
28Maui.PopupPage
29{
30 id: control
31 persistent: false
32 widthHint: 0.9
33 heightHint: 0.8
34
35 width: 360
36 maxHeight: implicitHeight
37
38 Maui.Theme.inherit: false
39 Maui.Theme.colorSet: Maui.Theme.Complementary
40
41 Maui.SectionItem
42 {
43 imageSource: Maui.App.iconName
44
45 template.fillMode: Image.PreserveAspectFit
46
47 template.iconSizeHint: Maui.Style.iconSizes.huge
48 template.imageSizeHint: template.iconSizeHint
49 template.isMask: false
50 template.headerSizeHint: template.iconSizeHint
51
52 // spacing: Maui.Style.space.big
53 label1.wrapMode: Text.WrapAtWordBoundaryOrAnywhere
54 label1.text: Maui.App.about.displayName
55 label1.font.weight: Font.Black
56 label1.font.pointSize: Maui.Style.fontSizes.enormous
57
58 label2.text: Maui.App.about.shortDescription
59 label2.font.pointSize: Maui.Style.fontSizes.big
60 label2.elide: Text.ElideRight
61 label2.wrapMode: Text.WrapAtWordBoundaryOrAnywhere
62 }
63
64 Label
65 {
66 Maui.Theme.inherit: true
67 Layout.alignment: horizontalAlignment
68 // Layout.fillWidth: true
69 horizontalAlignment:Qt.AlignLeft
70 text: Maui.App.about.version + " " + Maui.App.about.otherText
71 font.family: "Monospace"
72 opacity: 0.6
73 font.pointSize: Maui.Style.fontSizes.tiny
74 padding: Maui.Style.space.small
75 background: Rectangle
76 {
77 opacity: 0.5
78 color: "black"
79 radius: Maui.Style.radiusV
80 }
81
82 MouseArea
83 {
84 anchors.fill: parent
85 hoverEnabled: true
86 cursorShape: Qt.PointingHandCursor
87 onClicked:
88 {
89 Maui.Handy.copyTextToClipboard(parent.text)
90 root.notify("dialog-information", i18n("Version ID copied to clipboard"))
91 control.close()
92
93 }
94
95 ToolTip.delay: 1000
96 ToolTip.timeout: 5000
97 ToolTip.visible: containsMouse
98 ToolTip.text: i18n("Copy")
99 }
100 }
101
102 Column
103 {
104 spacing: Maui.Style.defaultSpacing
105 Layout.fillWidth: true
106
107 Button
108 {
109 width: parent.width
110 text: i18nd("mauikit", "Reports")
111 onClicked: Qt.openUrlExternally(Maui.App.about.bugAddress)
112 }
113
114 Button
115 {
116 width: parent.width
117 text: i18nd("mauikit", "Home Page")
118 onClicked: Qt.openUrlExternally(Maui.App.about.homepage)
119 }
120 }
121
122 Maui.Separator
123 {
124 Layout.fillWidth: true
125 }
126
127 Item{}
128
129 Maui.SectionItem
130 {
131 label1.text: i18nd("mauikit", "Authors")
132 visible: Maui.App.about.authors.length > 0
133
134 // iconSource: "view-media-artist"
135 template.isMask: true
136 template.iconSizeHint: Maui.Style.iconSize
137
138 Column
139 {
140 spacing: Maui.Style.defaultSpacing
141 Layout.fillWidth: true
142 opacity: 0.8
143
144 Repeater
145 {
146 model: Maui.App.about.authors
147
148 Maui.ListItemTemplate
149 {
150 id: _credits
151
152 width: parent.width
153
154 label1.text: modelData.emailAddress ? formatLink(modelData.name, String("mailto:%1").arg(modelData.emailAddress)) : modelData.name
155 label1.textFormat: Text.RichText
156 // label1.linkColor: Maui.Theme.textColor
157 label3.text: modelData.task
158
159 Connections
160 {
161 target: _credits.label1
162 function onLinkActivated(link)
163 {
164 Qt.openUrlExternally(link)
165 }
166 }
167 }
168 }
169 }
170 }
171
172 Maui.SectionItem
173 {
174 label1.text: i18nd("mauikit", "Translators")
175 visible: Maui.App.about.translators.length > 0
176 // iconSource: "folder-language"
177 template.isMask: true
178 template.iconSizeHint: Maui.Style.iconSize
179
180 Column
181 {
182 id: _translators
183 spacing: Maui.Style.defaultSpacing
184 Layout.fillWidth: true
185 opacity: 0.8
186
187 Repeater
188 {
189 model: Maui.App.about.translators
190
191 Maui.ListItemTemplate
192 {
193 id: _tCredits
194
195 width: parent.width
196
197 label1.text: modelData.emailAddress ? formatLink(modelData.name, String("mailto:%1").arg(modelData.emailAddress)) : modelData.name
198 label1.textFormat: Text.RichText
199 label3.text: modelData.task
200 Connections
201 {
202 target: _tCredits.label1
203 function onLinkActivated(link)
204 {
205 Qt.openUrlExternally(link)
206 }
207 }
208 }
209 }
210 }
211 }
212
213 Maui.SectionItem
214 {
215 label1.text: i18nd("mauikit", "Credits")
216 visible: Maui.App.about.credits.length > 0
217 // iconSource: "love"
218 template.isMask: true
219 template.iconSizeHint: Maui.Style.iconSize
220
221 Column
222 {
223 spacing: Maui.Style.defaultSpacing
224 Layout.fillWidth: true
225 opacity: 0.8
226
227 Repeater
228 {
229 model: Maui.App.about.credits
230
231 Maui.ListItemTemplate
232 {
233 id: _tCredits
234
235 width: parent.width
236
237 label1.text: modelData.emailAddress ? formatLink(modelData.name, String("mailto:%1").arg(modelData.emailAddress)) : modelData.name
238 label1.textFormat: Text.RichText
239 label3.text: modelData.task
240 Connections
241 {
242 target: _tCredits.label1
243 function onLinkActivated(link)
244 {
245 Qt.openUrlExternally(link)
246 }
247 }
248 }
249 }
250 }
251 }
252
253 Maui.SectionItem
254 {
255 visible: Maui.App.about.licenses.length > 0
256 // iconSource: "license"
257
258 template.isMask: true
259 template.iconSizeHint: Maui.Style.iconSize
260
261 label1.text: i18nd("mauikit", "Licenses")
262
263 Column
264 {
265 spacing: Maui.Style.defaultSpacing
266 Layout.fillWidth: true
267 opacity: 0.8
268
269 Repeater
270 {
271 model: Maui.App.about.licenses
272 Maui.ListItemTemplate
273 {
274 width: parent.width
275 label1.text: modelData.name
276 label3.text: modelData.spdx
277 }
278 }
279 }
280 }
281
282 Maui.SectionItem
283 {
284 // iconSource: "code-context"
285 visible: Maui.App.about.components.length > 0
286 template.isMask: true
287 template.iconSizeHint: Maui.Style.iconSize
288
289 label1.text: i18nd("mauikit", "Components")
290
291 Column
292 {
293 spacing: Maui.Style.defaultSpacing
294 Layout.fillWidth: true
295 opacity: 0.8
296 Repeater
297 {
298 model: Maui.App.about.components
299 Maui.ListItemTemplate
300 {
301 width: parent.width
302 label1.textFormat: Text.RichText
303
304 label1.text: modelData.webAddress ? formatLink(modelData.name, modelData.webAddress) : modelData.name
305
306 label2.text: modelData.description
307 label3.text: modelData.version
308
309 Connections
310 {
311 target: label1
312 function onLinkActivated(link)
313 {
314 Qt.openUrlExternally(link)
315 }
316 }
317 }
318 }
319 }
320 }
321
322 Item
323 {
324 Layout.fillWidth: true
325 implicitHeight: Maui.Style.space.big
326 }
327
328 ColumnLayout
329 {
330 Layout.fillWidth: true
331 opacity: 0.7
332 spacing: Maui.Style.space.small
333
334 Maui.Icon
335 {
336 visible: Maui.App.about.copyrightStatement.indexOf("Maui") > 0
337 Layout.alignment: Qt.AlignCenter
338 source: "qrc:/assets/mauikit.svg"
339 color: Maui.Theme.textColor
340 isMask: true
341 implicitHeight: Maui.Style.iconSizes.big
342 implicitWidth: implicitHeight
343 }
344
345 Maui.ListItemTemplate
346 {
347 Layout.fillWidth: true
348 isMask: true
349
350 iconSizeHint: Maui.Style.iconSizes.medium
351 // headerSizeHint: iconSizeHint + Maui.Style.space.medium
352
353 spacing: Maui.Style.defaultSpacing
354 label1.text: Maui.App.about.copyrightStatement
355 label1.horizontalAlignment: Qt.AlignHCenter
356 label1.font.pointSize: Maui.Style.fontSizes.small
357 label1.font.family: "Monospace"
358 }
359 }
360
361 Item
362 {
363 parent: control.background
364 clip: true
365 anchors.fill: parent
366
367 Image
368 {
369 anchors.fill: parent
370 source: "qrc:/assets/subtle-dots.png"
371 fillMode: Image.Tile
372 opacity: 0.15
373 }
374
375 DragHandler
376 {
377 enabled: !Maui.Handy.isMobile
378 target: null
379 grabPermissions: TapHandler.CanTakeOverFromAnything
380 onActiveChanged: if (active) { Maui.App.rootComponent.startSystemMove(); }
381 }
382 }
383
384 /**
385 * @private
386 */
387 function formatLink(text, url)
388 {
389 return String("<a href='%1' style=\"text-decoration:none;color:%2\">%3</a>").arg(url).arg(control.Maui.Theme.textColor).arg(text)
390 }
391}
The MauiKit Style preferences singleton object.
Definition style.h:86
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
KCOREADDONS_EXPORT unsigned int version()
QString name(StandardAction id)
QTaskBuilder< Task > task(Task &&task)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.