Warning, /plasma-mobile/mycroft-plasmoid-mobile/plasmoid/contents/ui/DisclaimerCardDelegate.qml is written in an unsupported language. File is not indexed.

0001 /* Copyright 2016 Aditya Mehra <aix.m@outlook.com>                            
0002 
0003     This library is free software; you can redistribute it and/or
0004     modify it under the terms of the GNU Lesser General Public
0005     License as published by the Free Software Foundation; either
0006     version 2.1 of the License, or (at your option) version 3, or any
0007     later version accepted by the membership of KDE e.V. (or its
0008     successor approved by the membership of KDE e.V.), which shall
0009     act as a proxy defined in Section 6 of version 3 of the license.
0010     
0011     This library is distributed in the hope that it will be useful,
0012     but WITHOUT ANY WARRANTY; without even the implied warranty of
0013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014     Lesser General Public License for more details.
0015     
0016     You should have received a copy of the GNU Lesser General Public
0017     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0018 */
0019 
0020 import QtQuick 2.9
0021 import QtQml.Models 2.2
0022 import QtQuick.Controls 2.2
0023 import QtQuick.Layouts 1.3
0024 import org.kde.plasma.core 2.0 as PlasmaCore
0025 import org.kde.plasma.plasmoid 2.0
0026 import org.kde.plasma.components 2.0 as PlasmaComponents
0027 import QtGraphicalEffects 1.0
0028 
0029 Rectangle {
0030         id: dashDelegateItm
0031         height: contentdlgtitem.height
0032         width: cbwidth - units.gridUnit * 0.50
0033         border.width: 1        
0034         border.color: Qt.darker(PlasmaCore.ColorScope.backgroundColor, 1.2)
0035         color: Qt.darker(PlasmaCore.ColorScope.backgroundColor, 1.2) 
0036         layer.enabled: true
0037         layer.effect: DropShadow {
0038             horizontalOffset: 0
0039             verticalOffset: 1
0040             radius: 10
0041             samples: 32
0042             spread: 0.1
0043             color: Qt.rgba(0, 0, 0, 0.3)
0044         }
0045         
0046         Item {
0047             id: contentdlgtitem
0048             width: parent.width
0049             height: dashHeader.height + dashHeaderSeprtr.height + nwsseprator.height + dashinner.height
0050             
0051             Item {
0052             id: skillTopRowLayout
0053             anchors.top: parent.top
0054             anchors.topMargin: units.gridUnit * 0.25
0055             anchors.left: parent.left
0056             anchors.right: parent.right
0057             implicitHeight: dashHeader.height
0058             
0059             Text {
0060                 id: dashHeader
0061                 anchors.left: dashHeaderSeprtr.right
0062                 anchors.leftMargin: units.gridUnit * 0.25
0063                 anchors.verticalCenter: parent.verticalCenter
0064                 wrapMode: Text.Wrap
0065                 font.bold: true
0066                 font.pointSize: theme.defaultFont.pointSize
0067                 font.letterSpacing: theme.defaultFont.letterSpacing
0068                 font.wordSpacing: theme.defaultFont.wordSpacing
0069                 font.family: theme.defaultFont.family
0070                 renderType: Text.NativeRendering 
0071                 text: i18n("Let's Continue?")
0072                 color: PlasmaCore.ColorScope.textColor
0073             }
0074             
0075             PlasmaCore.SvgItem {
0076                 id: dashHeaderSeprtr
0077                 anchors {
0078                     left: contxtnewsitemmenu.right
0079                     leftMargin: units.gridUnit * 0.25
0080                     verticalCenter: parent.verticalCenter
0081                 }
0082                 height: units.gridUnit * 1
0083                 width: dashhdrvertSvg.elementSize("vertical-line").width
0084                 z: 110
0085                 elementId: "vertical-line"
0086 
0087                 svg: PlasmaCore.Svg {
0088                     id: dashhdrvertSvg;
0089                     imagePath: "widgets/line"
0090                 }
0091             }  
0092 
0093             ToolButton {
0094                 id: contxtnewsitemmenu
0095                 anchors.verticalCenter: parent.verticalCenter
0096                 anchors.left: parent.left
0097                 width: units.gridUnit * 1
0098                 height: units.gridUnit * 1
0099                 Image {
0100                     id: innrnewitemcontxmenuimage
0101                     source: "../images/ctxmenu.png"
0102                     anchors.verticalCenter: parent.verticalCenter
0103                     anchors.horizontalCenter: parent.horizontalCenter
0104                     width: units.gridUnit * 0.60
0105                     height: units.gridUnit * 0.50
0106                 }
0107                 ColorOverlay {
0108                     anchors.fill: innrnewitemcontxmenuimage
0109                     source: innrnewitemcontxmenuimage
0110                     color: theme.textColor
0111                 }
0112                 onClicked: {
0113                     mcmenuItem.open()
0114                     }
0115                 }
0116             }
0117 
0118         Rectangle {
0119                 id: nwsseprator
0120                 width: parent.width
0121                 anchors.top: skillTopRowLayout.bottom
0122                 anchors.topMargin: units.gridUnit * 0.25
0123                 height: 2
0124                 color: theme.linkColor
0125         }
0126 
0127         Item {
0128             id: dashinner
0129             width: parent.width
0130             implicitHeight: nwsdesc.height
0131             Layout.minimumHeight: units.gridUnit * 2
0132             anchors.top: nwsseprator.bottom
0133             anchors.topMargin: 1
0134             
0135         Text {
0136             id: nwsdesc
0137             wrapMode: Text.Wrap;
0138             anchors.right: parent.right
0139             anchors.left: parent.left
0140             anchors.leftMargin: 2
0141             color: PlasmaCore.ColorScope.textColor
0142             font.pointSize: theme.defaultFont.pointSize
0143             font.letterSpacing: theme.defaultFont.letterSpacing
0144             font.wordSpacing: theme.defaultFont.wordSpacing
0145             font.family: theme.defaultFont.family
0146             text: i18n("Mycroft by default is powered by a cloud-based speech to text service. Mycroft gives you the ability to change speech to text services or use a locally configured one within their settings at home.mycroft.ai.")
0147                 }
0148             }
0149         }
0150         
0151         Drawer {
0152                 id: mcmenuItem
0153                 width: dwrpaddedwidth
0154                 height: removeCardRectbtn.height + disableCardRectbtn.height 
0155                 edge: Qt.TopEdge
0156                 dragMargin: 0
0157 
0158                 Rectangle {
0159                     id: menuRectItem
0160                     anchors.fill: parent
0161                     color: theme.backgroundColor
0162             
0163                     Column {
0164                         id: menuRectColumn
0165                         anchors.fill: parent
0166                         
0167                         Rectangle {
0168                             id: removeCardRectbtn
0169                             width: parent.width
0170                             height: units.gridUnit * 2
0171                             color: theme.backgroundColor
0172                             
0173                             Row {
0174                                spacing: 5
0175                                 PlasmaCore.IconItem {
0176                                    id: removeCardIcon
0177                                    anchors.verticalCenter: parent.verticalCenter
0178                                    source: "archive-remove"
0179                                    width: units.gridUnit * 2
0180                                    height: units.gridUnit * 2
0181                                }
0182                                Rectangle {
0183                                    id: removeCardSeperater
0184                                    width: 1
0185                                    height: parent.height
0186                                    color: theme.linkColor
0187                                }
0188                                PlasmaComponents.Label {
0189                                    id: removeCardLabel
0190                                    anchors.verticalCenter: parent.verticalCenter
0191                                    text: i18n("Remove Card")
0192                                 }
0193                             }
0194                             MouseArea {
0195                                 anchors.fill: parent
0196                                 hoverEnabled: true
0197                                     onEntered: {
0198                                         removeCardLabel.color = theme.linkColor
0199                                     }
0200                                     onExited:{
0201                                         removeCardLabel.color = theme.textColor
0202                                     }
0203                                     onClicked:{
0204                                         dashCardCollectionModel.remove(index)
0205                                         removeChildCard()
0206                                     }
0207                                 }
0208                             }
0209                             
0210                         Rectangle {
0211                             id: btnshorzSepr
0212                             width: parent.width
0213                             height: 1
0214                             color: theme.linkColor
0215                         }
0216                             
0217                         Rectangle {
0218                             id: disableCardRectbtn
0219                             width: parent.width
0220                             height: units.gridUnit * 2
0221                             color: theme.backgroundColor
0222                             
0223                             Row {
0224                                spacing: 5
0225                                 PlasmaCore.IconItem {
0226                                    id: disableCardIcon
0227                                    anchors.verticalCenter: parent.verticalCenter
0228                                    source: "document-close"
0229                                    width: units.gridUnit * 2
0230                                    height: units.gridUnit * 2
0231                                }
0232                                Rectangle {
0233                                    id: disableCardSeperater
0234                                    width: 1
0235                                    height: parent.height
0236                                    color: theme.linkColor
0237                                }
0238                                PlasmaComponents.Label {
0239                                    id: disableCardLabel
0240                                    anchors.verticalCenter: parent.verticalCenter
0241                                    text: i18n("Disable Disclaimer Card")
0242                                 }
0243                             }
0244                             MouseArea {
0245                                 anchors.fill: parent
0246                                 hoverEnabled: true
0247                                     onEntered: {
0248                                         disableCardLabel.color = theme.linkColor
0249                                     }
0250                                     onExited:{
0251                                         disableCardLabel.color = theme.textColor
0252                                     }
0253                                     onClicked:{
0254                                         disclaimercardswitch.checked = false
0255                                         dashCardCollectionModel.remove(index)
0256                                         removeChildCard()
0257                                         }
0258                                     }
0259                                 }
0260                                 
0261                         Rectangle {
0262                             id: btnshorzSeprEnd
0263                             width: parent.width
0264                             height: units.gridUnit * 0.75
0265                             color: theme.linkColor
0266                             
0267                             PlasmaCore.IconItem {
0268                                    id: closemenuDrawer
0269                                    anchors.centerIn: parent
0270                                    source: "go-up"
0271                                    width: units.gridUnit * 2
0272                                    height: units.gridUnit * 2
0273                                     }
0274                                 }
0275                             }
0276                         }
0277                     }
0278                 }