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 Qt5Compat.GraphicalEffects
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 id: _header
44 imageSource: Maui.App.iconName
45
46 template.fillMode: Image.PreserveAspectFit
47
48 template.iconSizeHint: Maui.Style.iconSizes.huge
49 template.imageSizeHint: template.iconSizeHint
50 template.isMask: false
51 template.headerSizeHint: template.iconSizeHint
52
53 // spacing: Maui.Style.space.big
54 label1.wrapMode: Text.WrapAtWordBoundaryOrAnywhere
55 label1.text: Maui.App.about.displayName
56 label1.font.weight: Font.Black
57 label1.font.pointSize: Maui.Style.fontSizes.enormous
58
59 label2.text: Maui.App.about.shortDescription
60 label2.font.pointSize: Maui.Style.fontSizes.big
61 label2.elide: Text.ElideRight
62 label2.wrapMode: Text.WrapAtWordBoundaryOrAnywhere
63 }
64
65 Label
66 {
67 Maui.Theme.inherit: true
68 Layout.alignment: horizontalAlignment
69 // Layout.fillWidth: true
70 horizontalAlignment:Qt.AlignLeft
71 text: Maui.App.about.version + " " + Maui.App.about.otherText
72 font.family: "Monospace"
73 opacity: 0.6
74 font.pointSize: Maui.Style.fontSizes.tiny
75 padding: Maui.Style.space.small
76 background: Rectangle
77 {
78 opacity: 0.5
79 color: "black"
80 radius: Maui.Style.radiusV
81 }
82
83 MouseArea
84 {
85 anchors.fill: parent
86 hoverEnabled: true
87 cursorShape: Qt.PointingHandCursor
88 onClicked:
89 {
90 Maui.Handy.copyTextToClipboard(parent.text)
91 root.notify("dialog-information", i18n("Version ID copied to clipboard"))
92 control.close()
93
94 }
95
96 ToolTip.delay: 1000
97 ToolTip.timeout: 5000
98 ToolTip.visible: containsMouse
99 ToolTip.text: i18n("Copy")
100 }
101 }
102
103 Column
104 {
105 id: _links
106 spacing: Maui.Style.defaultSpacing
107 Layout.fillWidth: true
108
109 Button
110 {
111 Maui.Theme.inherit: false
112 Maui.Theme.colorSet: Maui.Theme.Complementary
113
114 width: parent.width
115 text: i18nd("mauikit", "Reports")
116 onClicked: Qt.openUrlExternally(Maui.App.about.bugAddress)
117 }
118
119 Button
120 {
121 Maui.Theme.inherit: false
122 Maui.Theme.colorSet: Maui.Theme.Complementary
123
124 width: parent.width
125 text: i18nd("mauikit", "Home Page")
126 onClicked: Qt.openUrlExternally(Maui.App.about.homepage)
127 }
128 }
129
130 Maui.Separator
131 {
132 Layout.fillWidth: true
133 }
134
135 Item{}
136
137 Maui.SectionItem
138 {
139 id: _authorsSection
140 label1.text: i18nd("mauikit", "Authors")
141 visible: Maui.App.about.authors.length > 0
142
143 // iconSource: "view-media-artist"
144 template.isMask: true
145 template.iconSizeHint: Maui.Style.iconSize
146
147 Column
148 {
149 spacing: Maui.Style.defaultSpacing
150 Layout.fillWidth: true
151 opacity: 0.8
152
153 Repeater
154 {
155 model: Maui.App.about.authors
156
157 Maui.ListItemTemplate
158 {
159 id: _credits
160
161 width: parent.width
162
163 label1.text: modelData.emailAddress ? formatLink(modelData.name, String("mailto:%1").arg(modelData.emailAddress)) : modelData.name
164 label1.textFormat: Text.RichText
165 // label1.linkColor: Maui.Theme.textColor
166 label3.text: modelData.task
167
168 Connections
169 {
170 target: _credits.label1
171 function onLinkActivated(link)
172 {
173 Qt.openUrlExternally(link)
174 }
175 }
176 }
177 }
178 }
179 }
180
181 Maui.SectionItem
182 {
183 id: _translatorsSection
184 label1.text: i18nd("mauikit", "Translators")
185 visible: Maui.App.about.translators.length > 0
186 // iconSource: "folder-language"
187 template.isMask: true
188 template.iconSizeHint: Maui.Style.iconSize
189
190 Column
191 {
192 id: _translators
193 spacing: Maui.Style.defaultSpacing
194 Layout.fillWidth: true
195 opacity: 0.8
196
197 Repeater
198 {
199 model: Maui.App.about.translators
200
201 Maui.ListItemTemplate
202 {
203 id: _tCredits
204
205 width: parent.width
206
207 label1.text: modelData.emailAddress ? formatLink(modelData.name, String("mailto:%1").arg(modelData.emailAddress)) : modelData.name
208 label1.textFormat: Text.RichText
209 label3.text: modelData.task
210 Connections
211 {
212 target: _tCredits.label1
213 function onLinkActivated(link)
214 {
215 Qt.openUrlExternally(link)
216 }
217 }
218 }
219 }
220 }
221 }
222
223 Maui.SectionItem
224 {
225 id: _creditsSection
226 label1.text: i18nd("mauikit", "Credits")
227 visible: Maui.App.about.credits.length > 0
228 // iconSource: "love"
229 template.isMask: true
230 template.iconSizeHint: Maui.Style.iconSize
231
232 Column
233 {
234 spacing: Maui.Style.defaultSpacing
235 Layout.fillWidth: true
236 opacity: 0.8
237
238 Repeater
239 {
240 model: Maui.App.about.credits
241
242 Maui.ListItemTemplate
243 {
244 id: _tCredits
245
246 width: parent.width
247
248 label1.text: modelData.emailAddress ? formatLink(modelData.name, String("mailto:%1").arg(modelData.emailAddress)) : modelData.name
249 label1.textFormat: Text.RichText
250 label3.text: modelData.task
251 Connections
252 {
253 target: _tCredits.label1
254 function onLinkActivated(link)
255 {
256 Qt.openUrlExternally(link)
257 }
258 }
259 }
260 }
261 }
262 }
263
264 Maui.SectionItem
265 {
266 id: _licensesSection
267 visible: Maui.App.about.licenses.length > 0
268 // iconSource: "license"
269
270 template.isMask: true
271 template.iconSizeHint: Maui.Style.iconSize
272
273 label1.text: i18nd("mauikit", "Licenses")
274
275 Column
276 {
277 id: _licenses
278 spacing: Maui.Style.defaultSpacing
279 Layout.fillWidth: true
280 opacity: 0.8
281
282 Repeater
283 {
284 model: Maui.App.about.licenses
285 Maui.ListItemTemplate
286 {
287 width: parent.width
288 label1.text: modelData.name
289 label3.text: modelData.spdx
290 }
291 }
292 }
293 }
294
295 Maui.SectionItem
296 {
297 id: _componentsSection
298 // iconSource: "code-context"
299 visible: Maui.App.about.components.length > 0
300 template.isMask: true
301 template.iconSizeHint: Maui.Style.iconSize
302
303 label1.text: i18nd("mauikit", "Components")
304
305 Column
306 {
307 spacing: Maui.Style.defaultSpacing
308 Layout.fillWidth: true
309 opacity: 0.8
310 Repeater
311 {
312 model: Maui.App.about.components
313 Maui.ListItemTemplate
314 {
315 width: parent.width
316 label1.textFormat: Text.RichText
317
318 label1.text: modelData.webAddress ? formatLink(modelData.name, modelData.webAddress) : modelData.name
319
320 label2.text: modelData.description
321 label3.text: modelData.version
322
323 Connections
324 {
325 target: label1
326 function onLinkActivated(link)
327 {
328 Qt.openUrlExternally(link)
329 }
330 }
331 }
332 }
333 }
334 }
335
336 Item
337 {
338 Layout.fillWidth: true
339 implicitHeight: Maui.Style.space.big
340 }
341
342 ColumnLayout
343 {
344 id: _footerColumn
345 Layout.fillWidth: true
346 opacity: 0.7
347 spacing: Maui.Style.space.small
348
349 Maui.Icon
350 {
351 visible: Maui.App.about.copyrightStatement.indexOf("Maui") > 0
352 Layout.alignment: Qt.AlignCenter
353 source: "qrc:/assets/mauikit.svg"
354 color: Maui.Theme.textColor
355 isMask: true
356 implicitHeight: Maui.Style.iconSizes.big
357 implicitWidth: implicitHeight
358 }
359
360 Maui.ListItemTemplate
361 {
362 id: _copyRight
363 Layout.fillWidth: true
364 isMask: true
365
366 iconSizeHint: Maui.Style.iconSizes.medium
367 // headerSizeHint: iconSizeHint + Maui.Style.space.medium
368
369 spacing: Maui.Style.defaultSpacing
370 label1.text: Maui.App.about.copyrightStatement
371 label1.horizontalAlignment: Qt.AlignHCenter
372 label1.font.pointSize: Maui.Style.fontSizes.small
373 label1.font.family: "Monospace"
374 }
375 }
376
377 Item
378 {
379 id: _iconItem
380 parent: control.background
381 clip: true
382 anchors.fill: parent
383
384 Image
385 {
386 anchors.fill: parent
387 source: "qrc:/assets/subtle-dots.png"
388 fillMode: Image.Tile
389 opacity: 0.15
390 }
391 }
392
393 /**
394 * @private
395 */
396 function formatLink(text, url)
397 {
398 return String("<a href='%1' style=\"text-decoration:none;color:#fafafa\">%2</a>").arg(url).arg(text)
399 }
400}
The MauiKit Style preferences singleton object.
Definition style.h:85
int timeout
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
KDB_EXPORT KDbVersionInfo version()
QString name(StandardAction id)
qsizetype length() const const
QTaskBuilder< Task > task(Task &&task)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:56:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.