/usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/mediacenter/elements/imageviewer/ImageViewer.qml is in plasma-mediacenter 5.7.3-1.
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 | /***************************************************************************
* Copyright 2011 Marco Martin <mart@kde.org> *
* Copyright 2012 Sinny Kumari <ksinny@gmail.com> *
* Copyright 2012 Prashansha Bharti <prashansa007@gmail.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, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
FocusScope {
id: imageRect
property alias source: mainImage.source
property alias stripModel: mediaPictureStrip.model
property alias stripVisible: mediaPictureStrip.visible
property alias stripState: mediaPictureStrip.state
property alias stripCurrentIndex: mediaPictureStrip.currentIndex
signal slideshowStarted
signal clicked
width: parent.width
height: parent.height
Rectangle {
border.color: theme.textColor; radius: 5; width: parent.width/2; height: 24
color: theme.backgroundColor; anchors.centerIn: parent
visible: mainImage.status == Image.Loading
PlasmaComponents.ProgressBar {
anchors { fill: parent; margins: 4 }
minimumValue: 0.0
maximumValue: 1.0
value: mainImage.progress
}
}
Item {
anchors.fill: parent
Image {
id: mainImage
anchors.fill: parent
fillMode: Image.PreserveAspectFit
sourceSize.width: width
}
MouseArea {
anchors.fill: parent
onClicked: {
mediaPictureStrip.state = mediaPictureStrip.state == "hidden" ? "" : "hidden"
imageRect.clicked();
}
onDoubleClicked : (mainImage.fillMode == Image.PreserveAspectFit) ? (mainImage.fillMode = Image.PreserveAspectCrop) : (mainImage.fillMode = Image.PreserveAspectFit)
}
}
PictureStrip {
id: mediaPictureStrip
anchors {
top: parent.top
bottom: undefined
left: parent.left
right: parent.right
topMargin: units.largeSpacing
}
height: units.iconSizes.enormous
slideshowPaused: mainImage.status == Image.Loading
onImageClicked: mainImage.source = url
onSlideShowStarted: {imageRect.slideshowStarted(); mediaPictureStrip.state = "hidden"}
states: [
State {
name: "hidden"
AnchorChanges { target: mediaPictureStrip; anchors.top: undefined; anchors.bottom: parent.top }
PropertyChanges { target: mediaPictureStrip; clip: true }
}
]
transitions: [ Transition { AnchorAnimation { duration: 100 } } ]
}
function nextImage() { mediaPictureStrip.nextImage(); }
function previousImage() { mediaPictureStrip.previousImage(); }
Keys.onLeftPressed: previousImage()
Keys.onRightPressed: nextImage()
}
|