Warning, /maui/mauikit/src/controls.5/private/AboutDialog.qml is written in an unsupported language. File is not indexed.

0001 
0002 /*
0003  *   Copyright 2018 Camilo Higuita <milo.h@aol.com>
0004  *
0005  *   This program is free software; you can redistribute it and/or modify
0006  *   it under the terms of the GNU Library General Public License as
0007  *   published by the Free Software Foundation; either version 2, or
0008  *   (at your option) any later version.
0009  *
0010  *   This program is distributed in the hope that it will be useful,
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  *   GNU General Public License for more details
0014  *
0015  *   You should have received a copy of the GNU Library General Public
0016  *   License along with this program; if not, write to the
0017  *   Free Software Foundation, Inc.,
0018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
0019  */
0020 
0021 import QtQuick 2.15
0022 import QtQuick.Controls 2.15
0023 import QtQuick.Layouts 1.3
0024 import QtGraphicalEffects 1.12
0025 
0026 import org.mauikit.controls 1.3 as Maui
0027 
0028 Maui.PopupPage
0029 {
0030     id: control
0031 
0032     persistent: false
0033     widthHint: 0.9
0034     heightHint: 0.8
0035 
0036     maxWidth: 360
0037     maxHeight: implicitHeight
0038 
0039     Maui.Theme.inherit: false
0040     Maui.Theme.colorSet: Maui.Theme.Complementary
0041 
0042     property alias mainHeader : _header
0043 
0044     Control
0045     {
0046         id: _header
0047         Layout.fillWidth: true
0048         implicitHeight: _div1.implicitHeight + topPadding + bottomPadding
0049         padding: Maui.Style.defaultPadding
0050         background: null
0051 
0052         contentItem: Maui.ListItemTemplate
0053         {
0054             id: _div1
0055 
0056             imageSource: Maui.App.iconName
0057 
0058             fillMode: Image.PreserveAspectFit
0059 
0060             iconSizeHint: Maui.Style.iconSizes.huge
0061             imageSizeHint: iconSizeHint
0062             isMask: false
0063 
0064             spacing: Maui.Style.space.big
0065             label1.wrapMode: Text.WrapAtWordBoundaryOrAnywhere
0066             label1.text: Maui.App.about.displayName
0067             label1.font.weight: Font.Black
0068             label1.font.pointSize: Maui.Style.fontSizes.enormous
0069 
0070             label2.text: Maui.App.about.shortDescription
0071             label2.font.pointSize: Maui.Style.fontSizes.big
0072             label2.elide: Text.ElideRight
0073             label2.wrapMode: Text.WrapAtWordBoundaryOrAnywhere            
0074         }
0075     }    
0076                 Label
0077                 {
0078                     Maui.Theme.inherit: true
0079                     Layout.alignment: horizontalAlignment
0080                     // Layout.fillWidth: true
0081                     horizontalAlignment:Qt.AlignLeft
0082                     text: Maui.App.about.version + " " + Maui.App.about.otherText
0083                     font.family: "Monospace"
0084                     opacity: 0.6
0085                     font.pointSize: Maui.Style.fontSizes.tiny
0086                     color: _div1.label1.color
0087                     padding: Maui.Style.space.small
0088                     background: Rectangle
0089                     {
0090                         opacity: 0.5
0091                         color: "black"
0092                         radius: Maui.Style.radiusV                        
0093                     }                    
0094 
0095                     MouseArea
0096                     {
0097                         anchors.fill: parent
0098                         hoverEnabled: true
0099                         cursorShape: Qt.PointingHandCursor
0100                         onClicked: 
0101                         {
0102                             Maui.Handy.copyTextToClipboard(parent.text)
0103                             root.notify("dialog-information", i18n("Version ID copied to clipboard"))
0104                                                         control.close()
0105 
0106                         }
0107                         
0108                         ToolTip.delay: 1000
0109     ToolTip.timeout: 5000
0110     ToolTip.visible: containsMouse 
0111     ToolTip.text: i18n("Copy")
0112                     }
0113                 }
0114                 
0115 
0116         Column
0117         {
0118             id: _links
0119             spacing: Maui.Style.defaultSpacing
0120             Layout.fillWidth: true
0121 
0122             Button
0123             {
0124                 width: parent.width
0125                 text: i18nd("mauikit", "Reports")
0126                 onClicked: Qt.openUrlExternally(Maui.App.about.bugAddress)
0127             }
0128 
0129             Button
0130             {
0131                 width: parent.width
0132                 text: i18nd("mauikit", "Home Page")
0133                 onClicked: Qt.openUrlExternally(Maui.App.about.homepage)
0134             }
0135         }
0136     
0137     
0138     Maui.Separator 
0139     {
0140         Layout.fillWidth: true
0141     }
0142      Item{}
0143     Maui.SectionItem
0144     {
0145         id: _authorsSection
0146         label1.text: i18nd("mauikit", "Authors")
0147         visible: Maui.App.about.authors.length > 0
0148 
0149         // iconSource: "view-media-artist"
0150         template.isMask: true
0151         template.iconSizeHint: Maui.Style.iconSize
0152         columns: 1
0153 
0154         Column
0155         {
0156             spacing: Maui.Style.defaultSpacing
0157             Layout.fillWidth: true
0158             opacity: 0.8
0159 
0160             Repeater
0161             {
0162                 model: Maui.App.about.authors
0163 
0164                 Maui.ListItemTemplate
0165                 {
0166                     id: _credits
0167 
0168                     width: parent.width
0169 
0170                     label1.text: modelData.emailAddress ? String("<a href='mailto:%1' style=\"text-decoration:none;color:#fafafa\">%2</a>").arg(modelData.emailAddress).arg(modelData.name) : modelData.name
0171                     label1.textFormat: Text.RichText
0172                     label3.text: modelData.task
0173                     Connections
0174                     {
0175                         target: _credits.label1
0176                         function onLinkActivated(link)
0177                         {
0178                             Qt.openUrlExternally(link)
0179                         }
0180                     }
0181                 }
0182             }
0183         }
0184     }    
0185 
0186 
0187     Maui.SectionItem
0188     {
0189         id: _translatorsSection
0190         label1.text: i18nd("mauikit", "Translators")
0191         visible: Maui.App.about.translators.length > 0
0192         // iconSource: "folder-language"
0193         template.isMask: true
0194         template.iconSizeHint: Maui.Style.iconSize
0195         columns: 1
0196 
0197         Column
0198         {
0199             id: _translators
0200             spacing: Maui.Style.defaultSpacing
0201             Layout.fillWidth: true
0202             opacity: 0.8
0203 
0204             Repeater
0205             {
0206                 model: Maui.App.about.translators
0207 
0208                 Maui.ListItemTemplate
0209                 {
0210                     id: _tCredits
0211 
0212                     width: parent.width
0213 
0214                     label1.text: modelData.emailAddress ? String("<a href='mailto:%1' style=\"text-decoration:none;color:#fafafa\">%2</a>").arg(modelData.emailAddress).arg(modelData.name) : modelData.name
0215                     label1.textFormat: Text.RichText
0216                     label3.text: modelData.task
0217                     Connections
0218                     {
0219                         target: _tCredits.label1
0220                         function onLinkActivated(link)
0221                         {
0222                             Qt.openUrlExternally(link)
0223                         }
0224                     }
0225                 }
0226             }
0227         }
0228     }
0229 
0230     Maui.SectionItem
0231     {
0232         id: _creditsSection
0233         label1.text: i18nd("mauikit", "Credits")
0234         visible: Maui.App.about.credits.length > 0
0235         // iconSource: "love"
0236         template.isMask: true
0237         template.iconSizeHint: Maui.Style.iconSize
0238         columns: 1
0239 
0240         Column
0241         {
0242             spacing: Maui.Style.defaultSpacing
0243             Layout.fillWidth: true
0244             opacity: 0.8
0245 
0246             Repeater
0247             {
0248                 model: Maui.App.about.credits
0249 
0250                 Maui.ListItemTemplate
0251                 {
0252                     id: _tCredits
0253 
0254                     width: parent.width
0255 
0256                     label1.text: modelData.emailAddress ? String("<a href='mailto:%1' style=\"text-decoration:none;color:#fafafa\">%2</a>").arg(modelData.emailAddress).arg(modelData.name) : modelData.name
0257                     label1.textFormat: Text.RichText
0258                     label3.text: modelData.task
0259                     Connections
0260                     {
0261                         target: _tCredits.label1
0262                         function onLinkActivated(link)
0263                         {
0264                             Qt.openUrlExternally(link)
0265                         }
0266                     }
0267                 }
0268             }
0269         }
0270     }
0271 
0272     Maui.SectionItem
0273     {
0274         id: _licensesSection
0275         visible: Maui.App.about.licenses.length > 0
0276         // iconSource: "license"
0277 
0278         template.isMask: true
0279         template.iconSizeHint: Maui.Style.iconSize
0280 
0281         label1.text: i18nd("mauikit", "Licenses")
0282         columns: 1
0283 
0284         Column
0285         {
0286             id: _licenses
0287             spacing: Maui.Style.defaultSpacing
0288             Layout.fillWidth: true
0289             opacity: 0.8
0290 
0291             Repeater
0292             {
0293                 model: Maui.App.about.licenses
0294                 Maui.ListItemTemplate
0295                 {
0296                     width: parent.width
0297                     label1.text: modelData.name
0298                     label3.text: modelData.spdx
0299                 }
0300             }
0301         }
0302     }
0303 
0304     Maui.SectionItem
0305     {
0306         id: _componentsSection
0307         // iconSource: "code-context"
0308         visible: Maui.App.about.components.length > 0
0309         template.isMask: true
0310         template.iconSizeHint: Maui.Style.iconSize
0311         columns: 1
0312 
0313         label1.text: i18nd("mauikit", "Components")
0314 
0315         Column
0316         {
0317             spacing: Maui.Style.defaultSpacing
0318             Layout.fillWidth: true
0319             opacity: 0.8
0320 
0321             Repeater
0322             {
0323                 model: Maui.App.about.components
0324                 Maui.ListItemTemplate
0325                 {
0326                     width: parent.width
0327                     label1.textFormat: Text.RichText
0328                                         
0329                     label1.text: modelData.webAddress ? String("<a href='%1' style=\"text-decoration:none;color:#fafafa\">%2</a>").arg(modelData.webAddress).arg(modelData.name) : modelData.name
0330 
0331                     label2.text: modelData.description
0332                     label3.text: modelData.version
0333 
0334                     Connections
0335                     {
0336                         target: label1
0337                         function onLinkActivated(link)
0338                         {
0339                             Qt.openUrlExternally(link)
0340                         }
0341                     }
0342                 }
0343             }
0344         }
0345     }
0346 
0347     Item
0348     {
0349         Layout.fillWidth: true
0350         implicitHeight: Maui.Style.space.big
0351     }
0352 
0353     ColumnLayout
0354     {
0355         id: _footerColumn
0356         Layout.fillWidth: true
0357         opacity: 0.7
0358         spacing: Maui.Style.space.small
0359 
0360         Maui.Icon
0361         {
0362             visible: Maui.App.about.copyrightStatement.indexOf("Maui") > 0
0363             Layout.alignment: Qt.AlignCenter
0364             source: "qrc:/assets/mauikit.svg"
0365             color: Maui.Theme.textColor
0366             isMask: true
0367             implicitHeight: Maui.Style.iconSizes.big
0368             implicitWidth: implicitHeight
0369         }
0370 
0371         Maui.ListItemTemplate
0372         {
0373             id: _copyRight
0374             Layout.fillWidth: true
0375             isMask: true
0376 
0377             iconSizeHint: Maui.Style.iconSizes.medium
0378             //                     headerSizeHint: iconSizeHint + Maui.Style.space.medium
0379 
0380             spacing: Maui.Style.defaultSpacing
0381             label1.text: Maui.App.about.copyrightStatement
0382             label1.horizontalAlignment: Qt.AlignHCenter
0383             label1.font.pointSize: Maui.Style.fontSizes.tiny
0384             label1.font.family: "Monospace"
0385         }
0386     }
0387 
0388     Item
0389     {
0390         id: _iconItem
0391         parent: control.background
0392         clip: true
0393         anchors.fill: parent
0394 
0395         Image
0396         {
0397             anchors.fill: parent
0398             source: "qrc:/assets/subtle-dots.png"
0399             fillMode: Image.Tile
0400             opacity: 0.15
0401         }
0402     }
0403 }