/usr/share/plasma/plasmoids/org.kde.plasma.comic/contents/ui/main.qml is in plasma-widgets-addons 4:5.12.4-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | /*
* Copyright 2012 Reza Fatahilah Shah <rshah0385@kireihana.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.1
import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0
Item {
id: mainWindow
property int implicitWidth: units.gridUnit * 40
property int implicitHeight: units.gridUnit * 15
Plasmoid.switchWidth: {
if (centerLayout.comicData.image) {
return Math.max(minimumWidth, Math.min(centerLayout.comicData.image.nativeWidth * 0.6, implicitWidth));
} else {
return units.gridUnit * 8;
}
}
Plasmoid.switchHeight: {
if (centerLayout.comicData.image) {
return Math.max(minimumHeight, Math.min(centerLayout.comicData.image.nativeHeight * 0.6, implicitHeight));
} else {
return units.gridUnit * 8;
}
}
Plasmoid.icon: "face-laughing"
width: implicitWidth
height: implicitHeight
property int minimumWidth: units.gridUnit * 8
property int minimumHeight: units.gridUnit * 8
property bool showComicAuthor: plasmoid.nativeInterface.showComicAuthor
property bool showComicTitle: plasmoid.nativeInterface.showComicTitle
property bool showErrorPicture: plasmoid.nativeInterface.showErrorPicture
property bool middleClick: plasmoid.nativeInterface.middleClick
Connections {
target: plasmoid.nativeInterface
onComicsModelChanged: {
comicTabbar.currentTab = comicTabbar.layout.children[1];
}
onTabHighlightRequest: {
for (var i = 0; i < comicTabbar.layout.children.length; ++i) {
var button = comicTabbar.layout.children[i];
if (button.key !== undefined && button.key == id) {
button.highlighted = highlight;
}
}
}
onShowNextNewStrip: {
var firstButton = undefined;
for (var i = 0; i < comicTabbar.layout.children.length; ++i) {
var button = comicTabbar.layout.children[i];
if (button.key !== undefined && button.highlighted == true) {
//key is ordered
if (button.key > comicTabbar.currentTab.key) {
comicTabbar.currentTab = button;
return;
} else if (firstButton === undefined){
firstButton = button;
}
}
}
if (firstButton !== undefined) {
comicTabbar.currentTab = firstButton;
}
}
}
PlasmaCore.Svg {
id: arrowsSvg
imagePath: "widgets/arrows"
}
PlasmaComponents.TabBar{
id: comicTabbar
anchors {
left: parent.left
right: parent.right
}
visible: plasmoid.nativeInterface.tabIdentifiers.length > 1
onCurrentTabChanged: {
console.log("onCurrentTabChanged:" + comicTabbar.currentTab.key);
plasmoid.nativeInterface.tabChanged(comicTabbar.currentTab.key);
}
Repeater {
model: plasmoid.nativeInterface.comicsModel
delegate: PlasmaComponents.TabButton {
id: tabButton
property string key: model.key
property bool highlighted: model.highlight
text: model.title
iconSource: model.icon
}
}
}
PlasmaComponents.Label {
id: topInfo
anchors {
top: comicTabbar.visible ? comicTabbar.bottom : mainWindow.top
left: mainWindow.left
right: mainWindow.right
}
visible: (topInfo.text.length > 0)
horizontalAlignment: Text.AlignHCenter
text: (showComicAuthor || showComicTitle) ? getTopInfo() : ""
function getTopInfo() {
var tempTop = "";
if ( showComicTitle ) {
tempTop = plasmoid.nativeInterface.comicData.title;
tempTop += ( ( (plasmoid.nativeInterface.comicData.stripTitle.length > 0) && (plasmoid.nativeInterface.comicData.title.length > 0) ) ? " - " : "" ) + plasmoid.nativeInterface.comicData.stripTitle;
}
if ( showComicAuthor &&
(plasmoid.nativeInterface.comicData.author != undefined || plasmoid.nativeInterface.comicData.author.length > 0) ) {
tempTop = ( tempTop.length > 0 ? plasmoid.nativeInterface.comicData.author + ": " + tempTop : plasmoid.nativeInterface.comicData.author );
}
return tempTop;
}
}
ComicCentralView {
id: centerLayout
anchors {
left: mainWindow.left
right: mainWindow.right
bottom: (bottomInfo.visible) ? bottomInfo.top : mainWindow.bottom
top: (topInfo.visible) ? topInfo.bottom : (comicTabbar.visible ? comicTabbar.bottom : mainWindow.top)
topMargin: (comicTabbar.visible) ? 3 : 0
}
visible: plasmoid.nativeInterface.tabIdentifiers.length > 0
comicData: plasmoid.nativeInterface.comicData
}
ComicBottomInfo {
id:bottomInfo
anchors {
left: mainWindow.left
right: mainWindow.right
bottom: mainWindow.bottom
}
comicData: plasmoid.nativeInterface.comicData
showUrl: plasmoid.nativeInterface.showComicUrl
showIdentifier: plasmoid.nativeInterface.showComicIdentifier
}
PlasmaComponents.Button {
anchors.centerIn: parent
text: i18n("Configure...")
visible: plasmoid.nativeInterface.tabIdentifiers.length == 0
onClicked: plasmoid.action("configure").trigger();
}
states: [
State {
name: "topInfoVisible"
when: topInfo.visible && !bottomInfo.visible
AnchorChanges {
target: centerLayout
anchors.top: topInfo.bottom
}
},
State {
name: "bottomInfoVisible"
when: bottomInfo.visible && !topInfo.visible
AnchorChanges {
target: centerLayout
anchors.bottom: bottomInfo.top
}
},
State {
name: "topBottomInfoVisible"
when: bottomInfo.visible && topInfo.visible
AnchorChanges {
target: centerLayout
anchors.top: topInfo.bottom
anchors.bottom: bottomInfo.top
}
}
]
transitions:
Transition {
AnchorAnimation {
duration: 500
easing.type: Easing.InOutQuad
}
}
}
|