/usr/share/kde4/apps/plasma/packages/org.kde.comic/contents/ui/main.qml is in plasma-widgets-addons 4:4.13.0-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 | /*
* 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 1.1
import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.qtextracomponents 0.1
Item {
id: mainWindow
width: minimumWidth
height: minimumHeight
property int minimumWidth: theme.defaultFont.mSize.width * 35
property int minimumHeight: theme.defaultFont.mSize.height * 12
property bool showComicAuthor: comicApplet.showComicAuthor
property bool showComicTitle: comicApplet.showComicTitle
property bool showErrorPicture: comicApplet.showErrorPicture
property bool middleClick: comicApplet.middleClick
Connections {
target: comicApplet
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.Theme {
id: theme
}
PlasmaCore.Svg {
id: arrowsSvg
imagePath: "widgets/arrows"
}
PlasmaComponents.TabBar{
id: comicTabbar
anchors {
left: parent.left
right: parent.right
}
visible: (comicApplet.comicsModel.count > 1)
onCurrentTabChanged: {
console.log("onCurrentTabChanged:" + comicTabbar.currentTab.key);
comicApplet.tabChanged(comicTabbar.currentTab.key);
}
Repeater {
model: comicApplet.comicsModel
delegate: PlasmaComponents.TabButton {
id: tabButton
property string key: model.key
property bool highlighted: model.highlight
text: model.title
iconSource: model.icon
Rectangle {
id: highlightMask
anchors {
bottom: parent.bottom
left: parent.left
}
width: Math.max(theme.smallIconSize, tabButton.height)
height: Math.max(theme.smallIconSize, tabButton.height)
color: "white"
opacity: model.highlight ? 0 : 0.5
}
}
}
}
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 = comicApplet.comicData.title;
tempTop += ( ( (comicApplet.comicData.stripTitle.length > 0) && (comicApplet.comicData.title.length > 0) ) ? " - " : "" ) + comicApplet.comicData.stripTitle;
}
if ( showComicAuthor &&
(comicApplet.comicData.author != undefined || comicApplet.comicData.author.length > 0) ) {
tempTop = ( tempTop.length > 0 ? comicApplet.comicData.author + ": " + tempTop : comicApplet.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
}
comicData: comicApplet.comicData
}
ComicBottomInfo {
id:bottomInfo
anchors {
left: mainWindow.left
right: mainWindow.right
bottom: mainWindow.bottom
}
comicData: comicApplet.comicData
showUrl: comicApplet.showComicUrl
showIdentifier: comicApplet.showComicIdentifier
}
PlasmaComponents.BusyIndicator {
id: busyIndicator
anchors.centerIn: parent
running: visible
visible: false
}
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
}
}
}
|