Warning, /plasma/kdeplasma-addons/applets/comic/package/contents/ui/ComicBottomInfo.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2012 Reza Fatahilah Shah <rshah0385@kireihana.com>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.1
0008 import org.kde.plasma.core as PlasmaCore
0009 import org.kde.kirigami 2.20 as Kirigami
0010 import org.kde.plasma.components 3.0 as PlasmaComponents3
0011 import org.kde.kquickcontrolsaddons 2.0
0012 import org.kde.plasma.plasmoid
0013 
0014 Item {
0015     id: root
0016 
0017     implicitWidth: 10
0018     implicitHeight: comicIdentifier.height
0019 
0020     property bool showUrl: false
0021     property bool showIdentifier: false
0022     property variant comicData
0023 
0024     visible: (comicIdentifier.text.length > 0 || comicUrl.text.length > 0)
0025 
0026     PlasmaComponents3.Label {
0027         id: comicIdentifier
0028 
0029         anchors {
0030             left: root.left
0031             top: root.top
0032             bottom: root.bottom
0033             right: comicUrl.left
0034             leftMargin: 2
0035         }
0036 
0037         color: Kirigami.Theme.textColor
0038         visible: (showIdentifier && comicIdentifier.text.length > 0)
0039         text: (showIdentifier && comicData.currentReadable != undefined) ? comicData.currentReadable : ""
0040         textFormat: Text.PlainText
0041 
0042         MouseArea {
0043             id: idLabelArea
0044 
0045             anchors.fill: parent
0046 
0047             hoverEnabled: true
0048 
0049             onEntered: {
0050                 parent.color = Kirigami.Theme.highlightColor;
0051             }
0052 
0053             onExited: {
0054                 parent.color = Kirigami.Theme.textColor;
0055             }
0056 
0057             onClicked: {
0058                 Plasmoid.goJump();
0059             }
0060 
0061             PlasmaCore.ToolTipArea {
0062                 anchors.fill: idLabelArea
0063                 mainText: i18nc("@info:tooltip", "Jump to strip…")
0064             }
0065         }
0066     }
0067 
0068     PlasmaComponents3.Label {
0069         id:comicUrl
0070 
0071         anchors {
0072             top: root.top
0073             bottom: root.bottom
0074             right: root.right
0075             rightMargin: 2
0076         }
0077 
0078         color: Kirigami.Theme.textColor
0079         visible: (showUrl && comicUrl.text.length > 0)
0080         text: (showUrl && comicData.websiteHost.length > 0) ? comicData.websiteHost : ""
0081         textFormat: Text.PlainText
0082 
0083         MouseArea {
0084             id: idUrlLabelArea
0085 
0086             anchors.fill: parent
0087 
0088             hoverEnabled: true
0089 
0090             onEntered: {
0091                 parent.color = Kirigami.Theme.highlightColor;
0092             }
0093 
0094             onExited: {
0095                 parent.color = Kirigami.Theme.textColor;
0096             }
0097 
0098             onClicked: {
0099                 Plasmoid.shop();
0100             }
0101 
0102             PlasmaCore.ToolTipArea {
0103                 anchors.fill: idUrlLabelArea
0104                 mainText: i18nc("@info:tooltip", "Visit the comic website")
0105             }
0106         }
0107     }
0108 }