Warning, /plasma/plasma-desktop/desktoppackage/contents/explorer/Tooltip.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2011 Marco Martin <mart@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 import QtQuick 2.1
0008 import QtQuick.Layouts 1.0 as Layouts
0009 import org.kde.plasma.components 3.0 as PlasmaComponents
0010 import org.kde.kirigami 2.20 as Kirigami
0011 
0012 MouseArea {
0013     id: main
0014 
0015     hoverEnabled: true
0016     onEntered: toolTipHideTimer.running = false
0017     onExited: toolTipHideTimer.running = true
0018 
0019     width: Kirigami.Units.iconSizes.sizeForLabels * 35
0020     height: Kirigami.Units.iconSizes.sizeForLabels * 16
0021 
0022     property variant icon
0023     property string title
0024     property string description
0025     property string author
0026     property string email
0027     property string license
0028     property string pluginName
0029     property bool local
0030 
0031     onClicked: tooltipDialog.visible = false
0032     Connections {
0033         target: tooltipDialog
0034         function onAppletDelegateChanged() {
0035             if (!tooltipDialog.appletDelegate) {
0036                 return
0037             }
0038             icon = tooltipDialog.appletDelegate.icon
0039             title = tooltipDialog.appletDelegate.title
0040             description = tooltipDialog.appletDelegate.description
0041             author = tooltipDialog.appletDelegate.author
0042             email = tooltipDialog.appletDelegate.email
0043             license = tooltipDialog.appletDelegate.license
0044             pluginName = tooltipDialog.appletDelegate.pluginName
0045             local = tooltipDialog.appletDelegate.local
0046         }
0047     }
0048     Kirigami.Icon {
0049         id: tooltipIconWidget
0050         anchors {
0051             left: parent.left
0052             top: parent.top
0053             margins: 8
0054         }
0055         width: Kirigami.Units.iconSizes.huge
0056         height: width
0057         source: main.icon
0058     }
0059     Column {
0060         id: nameColumn
0061         spacing: 8
0062         anchors {
0063             left: tooltipIconWidget.right
0064             margins: 8
0065             top: parent.top
0066             right: parent.right
0067         }
0068 
0069         Kirigami.Heading {
0070             text: title
0071             level: 2
0072             anchors.left: parent.left
0073             anchors.right: parent.right
0074             height: paintedHeight
0075             textFormat: Text.PlainText
0076             wrapMode: Text.Wrap
0077         }
0078         PlasmaComponents.Label {
0079             text: description
0080             textFormat: Text.PlainText
0081             anchors.left: parent.left
0082             anchors.right: parent.right
0083             wrapMode: Text.Wrap
0084         }
0085     }
0086     Layouts.GridLayout {
0087         columns: 2
0088         anchors {
0089             top: (nameColumn.height > tooltipIconWidget.height) ? nameColumn.bottom : tooltipIconWidget.bottom
0090             topMargin: 16
0091             horizontalCenter: parent.horizontalCenter
0092         }
0093         PlasmaComponents.Label {
0094             text: i18nd("plasma_shell_org.kde.plasma.desktop", "License:")
0095             textFormat: Text.PlainText
0096             Layouts.Layout.alignment: Qt.AlignVCenter|Qt.AlignRight
0097         }
0098         PlasmaComponents.Label {
0099             id: licenseText
0100             text: license
0101             textFormat: Text.PlainText
0102             wrapMode: Text.Wrap
0103         }
0104         PlasmaComponents.Label {
0105             text: i18nd("plasma_shell_org.kde.plasma.desktop", "Author:")
0106             textFormat: Text.PlainText
0107             Layouts.Layout.alignment: Qt.AlignVCenter|Qt.AlignRight
0108         }
0109         PlasmaComponents.Label {
0110             text: author
0111             textFormat: Text.PlainText
0112             wrapMode: Text.Wrap
0113         }
0114         PlasmaComponents.Label {
0115             text: i18nd("plasma_shell_org.kde.plasma.desktop", "Email:")
0116             textFormat: Text.PlainText
0117             Layouts.Layout.alignment: Qt.AlignVCenter|Qt.AlignRight
0118         }
0119         PlasmaComponents.Label {
0120             text: email
0121             textFormat: Text.PlainText
0122         }
0123     }
0124 
0125     PlasmaComponents.Button {
0126         id: uninstallButton
0127         anchors {
0128             horizontalCenter: parent.horizontalCenter
0129             bottom: parent.bottom
0130         }
0131         opacity: local ? 1 : 0
0132         Behavior on opacity {
0133             NumberAnimation { duration: Kirigami.Units.longDuration }
0134         }
0135         iconSource: "application-exit"
0136         text: i18nd("plasma_shell_org.kde.plasma.desktop", "Uninstall")
0137         onClicked: {
0138             widgetExplorer.uninstall(pluginName)
0139             tooltipDialog.visible = false
0140         }
0141     }
0142 }