Warning, /plasma-mobile/mycroft-plasmoid-mobile/plasmoid/contents/ui/RecipeType.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 
0028 Rectangle {
0029     id: partclc
0030     height: cbheight
0031     width: cbwidth
0032     color: theme.backgroundColor
0033     property alias recipeReadLVModel: recipeReadListView.model
0034     
0035     Connections {
0036         target: main2
0037         ignoreUnknownSignals: true
0038         
0039         onRecipeMethod: {
0040             var getRecipeTitle = msgRecipeMethod
0041             for (var i = 0; i < recipeLmodel.count; i++) {
0042                 var recipemodelLables = recipeLmodel.get(i).recipeLabel.toLowerCase();
0043                 recipemodelLables.replace(/\W/g, '');
0044                 if (recipemodelLables == getRecipeTitle) {
0045                     recipesmodelview.contentItem.children[i].viewbtnClickItem.clicked()
0046                 }
0047             }
0048         }
0049     }
0050 
0051 ListView {
0052      id: recipesmodelview
0053      anchors.fill: parent
0054      model: recipeLmodel
0055      spacing: 4
0056      focus: false
0057      interactive: true
0058      clip: true;
0059      delegate: RecipeDelegate{}
0060      ScrollBar.vertical: ScrollBar {
0061         active: true
0062         policy: ScrollBar.AlwaysOn
0063         snapMode : ScrollBar.SnapAlways
0064       }
0065    }
0066 
0067 Drawer {
0068     id: recipeReadDrawer
0069     width: parent.width
0070     height: cbdrawercontentheight
0071     edge: Qt.RightEdge
0072     dragMargin: 0
0073     property alias recipeReadDrawerHeader: recipeReadDrwHeaderLabel.text
0074 
0075     Rectangle {
0076             id: recipeReadParentRect
0077             width: parent.width
0078             height: parent.height
0079             color: theme.backgroundColor
0080             
0081             Rectangle {
0082                 id: recipeReadDrwHeaderSrc
0083                 anchors.top: parent.top
0084                 anchors.left: parent.left
0085                 anchors.right: parent.right
0086                 color: theme.linkColor
0087                 height: units.gridUnit * 2
0088                 
0089             Text {
0090                 id: recipeReadDrwHeaderLabel
0091                 color: theme.textColor;
0092                 anchors.left: parent.left
0093                 anchors.leftMargin: units.gridUnit * 0.25
0094                 anchors.verticalCenter: parent.verticalCenter
0095                 }
0096             
0097             PlasmaCore.IconItem {
0098                 id: recipeReadDrwHeaderSpeakIcon  
0099                 anchors.right: parent.right
0100                 anchors.rightMargin: units.gridUnit * 0.25
0101                 anchors.verticalCenter: parent.verticalCenter
0102                 source: "minuet-scales"
0103                 width: units.gridUnit * 1.25
0104                 height: units.gridUnit * 1.25
0105                 }
0106             }        
0107             
0108         ListView {
0109             id: recipeReadListView
0110             anchors.top: recipeReadDrwHeaderSrc.bottom
0111             anchors.left: parent.left
0112             anchors.right: parent.right
0113             anchors.bottom: recipeReadDrwFooterSrc.top
0114             model: recipeReadLmodel
0115             spacing: 3
0116             focus: false
0117             interactive: true
0118             clip: true;
0119             delegate: RecipeReadDelegate{}
0120             ScrollBar.vertical: ScrollBar {
0121                active: true
0122                policy: ScrollBar.AlwaysOn
0123                snapMode : ScrollBar.SnapAlways
0124            }
0125          }
0126          
0127         Rectangle {
0128                 id: recipeReadDrwFooterSrc
0129                 anchors.bottom: parent.bottom
0130                 anchors.left: parent.left
0131                 anchors.right: parent.right
0132                 color: theme.linkColor
0133                 height: units.gridUnit * 1
0134                 
0135             PlasmaCore.IconItem {
0136                 id: recipeReadDrwFooterCloseIcon  
0137                 anchors.right: recipeReadDrwCloseLbl.left
0138                 anchors.leftMargin: units.gridUnit * 0.25
0139                 anchors.verticalCenter: parent.verticalCenter
0140                 source: "window-close"
0141                 width: units.gridUnit * 1
0142                 height: units.gridUnit * 1
0143             }    
0144                 
0145             Text {
0146                 id: recipeReadDrwCloseLbl
0147                 color: theme.textColor;
0148                 text: i18n("Close Ingredients List")
0149                 anchors.horizontalCenter: parent.horizontalCenter
0150                 anchors.verticalCenter: parent.verticalCenter
0151                 }
0152                 
0153                 MouseArea{
0154                     anchors.fill: parent
0155                     onClicked: {
0156                         recipeReadDrawer.close()
0157                     }
0158                 }
0159             }
0160         }
0161     }
0162 }
0163