Warning, /plasma-mobile/mycroft-plasmoid-mobile/plasmoid/contents/ui/DashCryptoDelegate.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: units.gridUnit * 2.5
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: parent.height
0050             
0051             Item {
0052             id: skillTopRowLayout
0053             anchors.top: parent.top
0054             anchors.left: parent.left
0055             anchors.right: parent.right
0056             implicitHeight: dashHeader.height
0057             
0058             Text {
0059                 id: dashHeader
0060                 anchors.left: dashHeaderSeprtr.right
0061                 anchors.leftMargin: units.gridUnit * 0.25
0062                 anchors.verticalCenter: parent.verticalCenter
0063                 wrapMode: Text.Wrap
0064                 font.bold: true
0065                 font.pointSize: theme.defaultFont.pointSize
0066                 font.letterSpacing: theme.defaultFont.letterSpacing
0067                 font.wordSpacing: theme.defaultFont.wordSpacing
0068                 font.family: theme.defaultFont.family
0069                 renderType: Text.NativeRendering 
0070                 color: PlasmaCore.ColorScope.textColor
0071                 text: i18n("Currency: %1", model.contents.cryptoType)
0072             }
0073             
0074             PlasmaCore.SvgItem {
0075                 id: dashHeaderSeprtr
0076                 anchors {
0077                     left: contxtnewsitemmenu.right
0078                     leftMargin: units.gridUnit * 0.25
0079                     verticalCenter: parent.verticalCenter
0080                 }
0081                 height: units.gridUnit * 1
0082                 width: dashhdrvertSvg.elementSize("vertical-line").width
0083                 z: 110
0084                 elementId: "vertical-line"
0085 
0086                 svg: PlasmaCore.Svg {
0087                     id: dashhdrvertSvg;
0088                     imagePath: "widgets/line"
0089                 }
0090             }  
0091 
0092             ToolButton {
0093                 id: contxtnewsitemmenu
0094                 anchors.verticalCenter: parent.verticalCenter
0095                 anchors.left: parent.left
0096                 width: units.gridUnit * 1
0097                 height: units.gridUnit * 1
0098                 Image {
0099                     id: innrnewitemcontxmenuimage
0100                     source: "../images/ctxmenu.png"
0101                     anchors.verticalCenter: parent.verticalCenter
0102                     anchors.horizontalCenter: parent.horizontalCenter
0103                     width: units.gridUnit * 0.60
0104                     height: units.gridUnit * 0.50
0105                 }
0106                 ColorOverlay {
0107                     anchors.fill: innrnewitemcontxmenuimage
0108                     source: innrnewitemcontxmenuimage
0109                     color: theme.textColor
0110                 }
0111                 onClicked: {
0112                     mcmenuItem.open()
0113                     }
0114                 }
0115             }
0116 
0117         Rectangle {
0118                 id: nwsseprator
0119                 width: parent.width
0120                 anchors.top: skillTopRowLayout.bottom
0121                 anchors.topMargin: 1
0122                 height: 2
0123                 color: theme.linkColor
0124         }
0125 
0126         Item {
0127             id: dashinner
0128             width: parent.width
0129             implicitHeight: nwsdesc.height
0130             Layout.minimumHeight: units.gridUnit * 2
0131             anchors.top: nwsseprator.bottom
0132             anchors.topMargin: 1
0133         
0134         Text {
0135             id: nwsdesc
0136             wrapMode: Text.Wrap;
0137             anchors.left: parent.left
0138             width: parent.width / 3
0139             font.pointSize: theme.defaultFont.pointSize
0140             font.letterSpacing: theme.defaultFont.letterSpacing
0141             font.wordSpacing: theme.defaultFont.wordSpacing
0142             font.family: theme.defaultFont.family
0143             renderType: Text.NativeRendering 
0144             color: PlasmaCore.ColorScope.textColor
0145             text: i18nc("%1 is the currency symbol, %2 is the current rate", "%1: %2", model.contents.cryptoSymbol1, model.contents.cryptoCurRate1)
0146             }
0147         
0148         Text {
0149             id: nwsdesc2
0150             wrapMode: Text.Wrap;
0151             anchors.left: nwsdesc.right
0152             width: parent.width / 3
0153             font.pointSize: theme.defaultFont.pointSize
0154             font.letterSpacing: theme.defaultFont.letterSpacing
0155             font.wordSpacing: theme.defaultFont.wordSpacing
0156             font.family: theme.defaultFont.family
0157             renderType: Text.NativeRendering 
0158             color: PlasmaCore.ColorScope.textColor
0159             text: i18nc("%1 is the currency symbol, %2 is the current rate", "%1: %2", model.contents.cryptoSymbol2, model.contents.cryptoCurRate2)
0160             }
0161         
0162         Text {
0163             id: nwsdesc3
0164             wrapMode: Text.Wrap;
0165             anchors.left: nwsdesc2.right
0166             width: parent.width / 3
0167             font.pointSize: theme.defaultFont.pointSize
0168             font.letterSpacing: theme.defaultFont.letterSpacing
0169             font.wordSpacing: theme.defaultFont.wordSpacing
0170             font.family: theme.defaultFont.family
0171             renderType: Text.NativeRendering 
0172             color: PlasmaCore.ColorScope.textColor
0173             text: i18nc("%1 is the currency symbol, %2 is the current rate", "%1: %2", model.contents.cryptoSymbol3, model.contents.cryptoCurRate3)
0174             }
0175         
0176         
0177             }
0178         }
0179         
0180         Drawer {
0181                 id: mcmenuItem
0182                 width: dwrpaddedwidth
0183                 height: removeCardRectbtn.height + disableCardRectbtn.height 
0184                 edge: Qt.TopEdge
0185                 dragMargin: 0
0186 
0187                 Rectangle {
0188                     id: menuRectItem
0189                     anchors.fill: parent
0190                     color: theme.backgroundColor
0191             
0192                     Column {
0193                         id: menuRectColumn
0194                         anchors.fill: parent
0195                         
0196                         Rectangle {
0197                             id: removeCardRectbtn
0198                             width: parent.width
0199                             height: units.gridUnit * 2
0200                             color: theme.backgroundColor
0201                             
0202                             Row {
0203                                spacing: 5
0204                                 PlasmaCore.IconItem {
0205                                    id: removeCardIcon
0206                                    anchors.verticalCenter: parent.verticalCenter
0207                                    source: "archive-remove"
0208                                    width: units.gridUnit * 2
0209                                    height: units.gridUnit * 2
0210                                }
0211                                Rectangle {
0212                                    id: removeCardSeperater
0213                                    width: 1
0214                                    height: parent.height
0215                                    color: theme.linkColor
0216                                }
0217                                PlasmaComponents.Label {
0218                                    id: removeCardLabel
0219                                    anchors.verticalCenter: parent.verticalCenter
0220                                    text: i18n("Remove Card")
0221                                 }
0222                             }
0223                             MouseArea {
0224                                 anchors.fill: parent
0225                                 hoverEnabled: true
0226                                     onEntered: {
0227                                         removeCardLabel.color = theme.linkColor
0228                                     }
0229                                     onExited:{
0230                                         removeCardLabel.color = theme.textColor
0231                                     }
0232                                     onClicked:{
0233                                         dashCardCollectionModel.remove(index)
0234                                         removeChildCard()
0235                                     }
0236                                 }
0237                             }
0238                             
0239                         Rectangle {
0240                             id: btnshorzSepr
0241                             width: parent.width
0242                             height: 1
0243                             color: theme.linkColor
0244                         }
0245                             
0246                         Rectangle {
0247                             id: disableCardRectbtn
0248                             width: parent.width
0249                             height: units.gridUnit * 2
0250                             color: theme.backgroundColor
0251                             
0252                             Row {
0253                                spacing: 5
0254                                 PlasmaCore.IconItem {
0255                                    id: disableCardIcon
0256                                    anchors.verticalCenter: parent.verticalCenter
0257                                    source: "document-close"
0258                                    width: units.gridUnit * 2
0259                                    height: units.gridUnit * 2
0260                                }
0261                                Rectangle {
0262                                    id: disableCardSeperater
0263                                    width: 1
0264                                    height: parent.height
0265                                    color: theme.linkColor
0266                                }
0267                                PlasmaComponents.Label {
0268                                    id: disableCardLabel
0269                                    anchors.verticalCenter: parent.verticalCenter
0270                                    text: i18n("Disable Cryptocurrency Card")
0271                                 }
0272                             }
0273                             MouseArea {
0274                                 anchors.fill: parent
0275                                 hoverEnabled: true
0276                                     onEntered: {
0277                                         disableCardLabel.color = theme.linkColor
0278                                     }
0279                                     onExited:{
0280                                         disableCardLabel.color = theme.textColor
0281                                     }
0282                                     onClicked:{
0283                                         cryptocardswitch.checked = false
0284                                         dashCardCollectionModel.remove(index)
0285                                         removeChildCard()
0286                                         }
0287                                     }
0288                                 }
0289                                 
0290                         Rectangle {
0291                             id: btnshorzSeprEnd
0292                             width: parent.width
0293                             height: units.gridUnit * 0.75
0294                             color: theme.linkColor
0295                             
0296                             PlasmaCore.IconItem {
0297                                    id: closemenuDrawer
0298                                    anchors.centerIn: parent
0299                                    source: "go-up"
0300                                    width: units.gridUnit * 2
0301                                    height: units.gridUnit * 2
0302                                     }
0303                                 }
0304                             }
0305                         }
0306                     }
0307                 }