Warning, /pim/kube/framework/qml/AttachmentDelegate.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 * Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
0003 *
0004 * This program is free software; you can redistribute it and/or modify
0005 * it under the terms of the GNU General Public License as published by
0006 * the Free Software Foundation; either version 2 of the License, or
0007 * (at your option) any later version.
0008 *
0009 * This program is distributed in the hope that it will be useful,
0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0012 * GNU General Public License for more details.
0013 *
0014 * You should have received a copy of the GNU General Public License along
0015 * with this program; if not, write to the Free Software Foundation, Inc.,
0016 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0017 */
0018
0019 import QtQuick 2.7
0020 import org.kube.framework 1.0 as Kube
0021
0022 Item {
0023 id: root
0024
0025 property string name
0026 property string type
0027 property string icon
0028 property alias actionIcon: actionButton.iconName
0029 property alias actionTooltip: actionButton.tooltip
0030 signal clicked;
0031 signal execute;
0032 signal publicKeyImport;
0033
0034 width: content.width + Kube.Units.smallSpacing * 1.5
0035 height: content.height + Kube.Units.smallSpacing
0036
0037 Rectangle {
0038 anchors.fill: parent
0039
0040 id: background
0041 color: Kube.Colors.disabledTextColor
0042 }
0043
0044 MouseArea {
0045 anchors.fill: parent
0046
0047 onClicked: root.clicked()
0048 }
0049
0050 Row {
0051 id: content
0052 anchors {
0053 left: parent.left
0054 leftMargin: Kube.Units.smallSpacing
0055 verticalCenter: parent.verticalCenter
0056 }
0057 spacing: Kube.Units.smallSpacing
0058
0059 Rectangle {
0060 color: Kube.Colors.backgroundColor
0061 height: Kube.Units.gridUnit
0062 width: Kube.Units.gridUnit
0063 Kube.Icon {
0064 anchors.verticalCenter: parent.verticalCenter
0065 height: Kube.Units.gridUnit
0066 width: Kube.Units.gridUnit
0067 iconName: root.icon
0068 }
0069 }
0070 Label {
0071 anchors.verticalCenter: parent.verticalCenter
0072 text: root.name
0073 color: Kube.Colors.backgroundColor
0074 }
0075 Kube.IconButton {
0076 visible: root.type == "application/pgp-keys"
0077 iconName: Kube.Icons.key_import_inverted
0078 height: Kube.Units.gridUnit
0079 width: height
0080 onClicked: root.publicKeyImport()
0081 padding: 0
0082 tooltip: qsTr("Import key")
0083 }
0084 Kube.IconButton {
0085 id: actionButton
0086 height: Kube.Units.gridUnit
0087 width: height
0088 onClicked: root.execute()
0089 padding: 0
0090 }
0091 }
0092 }