/usr/share/kde4/apps/plasma/plasmoids/org.kde.active.welcome/contents/code/StartPage.qml is in plasma-widgets-active 2.0+git2012021101-0ubuntu4~ppa3.
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 | // -*- coding: iso-8859-1 -*-
/*
* Copyright 2011 Sebastian Kügler <sebas@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 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 Library General Public License for more details
*
* You should have received a copy of the GNU Library 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 1.0
import org.kde.qtextracomponents 0.1
import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasma.components 0.1 as PlasmaComponents
import QtMultimediaKit 1.1
Item {
width: 400
height: 400
id: startPage
state: "paused"
Column {
id: col
anchors.fill: parent
anchors.topMargin: 20
spacing: 10
PlasmaComponents.Label {
width: parent.width - 40
anchors.horizontalCenter: parent.horizontalCenter
id: title
text: i18n("<h1>Discover Plasma Active</h1>")
color: theme.textColor
//with black text raised text looks sunken and viceversa: bad api is bad ;)
style: Text.Raised
styleColor: theme.backgroundColor
}
PlasmaComponents.Label {
id: description
width: parent.width - 40
anchors.horizontalCenter: parent.horizontalCenter
wrapMode: Text.WordWrap
text: i18n("<p>Stay in control of your data and create a personalized user experience!</p><p>With Plasma Active you can browse and interact with the web, stay in contact with your friends, get the latest news, read and edit documents, enjoy your music and movies, play games and more.</p><p>While using Plasma Active, you can personalize it so that it reflects your needs and interests with the innovative Activities feature. Press the arrow to learn more about Activities.")
color: theme.textColor
styleColor: theme.backgroundColor
height: paintedHeight
}
PlasmaComponents.Label {
id: videoItem
anchors.horizontalCenter: parent.horizontalCenter
width: 266
height: 186
/*
Rectangle {
id: rect
anchors.fill: parent
//color: "#000"
}
*/
PlasmaCore.FrameSvgItem {
imagePath: "widgets/media-delegate"
prefix: "picture"
id: frameRect
width: 300
height: width/1.7
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
}
Rectangle {
color: "black"
anchors {
fill: parent
leftMargin: frameRect.margins.left
topMargin: frameRect.margins.top
rightMargin: frameRect.margins.right
bottomMargin: frameRect.margins.bottom
}
}
MouseArea {
anchors.fill: parent
onClicked: {
setPlaying()
var pos = videoDialog.popupPosition(0)
videoDialog.x = pos.x
videoDialog.y = pos.y
videoDialog.visible=true
}
}
PlasmaCore.Dialog {
id: videoDialog
windowFlags: Qt.Popup
onVisibleChanged: {
if (visible) {
setPlaying()
} else {
setPaused()
}
}
mainItem: Video {
id: video
width: 800
height: 480
source: plasmoid.file("data", "video.ogv")
onPausedChanged: {
print("Paused Changed..." + paused + playing);
if (paused) {
setPaused();
} else {
setPlaying();
}
}
MouseArea {
anchors.fill: parent
onClicked: {
setPaused()
videoDialog.visible = false
}
}
focus: true
Keys.onSpacePressed: video.paused = !video.paused
Keys.onLeftPressed: video.position -= 5000
Keys.onRightPressed: video.position += 5000
}
}
}
Column {
anchors.centerIn: parent
spacing: 60
Text {
id: videoText
text: i18n("<h2>Watch the video!</h2>")
color: "#FFF"
}
QIconItem {
id: pauseButton
width: 48
height: 48
anchors.centerIn: parent
icon: QIcon("media-playback-start")
}
}
}
} // Column
states: [
State {
name: "paused"
PropertyChanges { target: pauseButton; opacity: 1.0}
PropertyChanges { target: videoText; opacity: 1.0}
},
State {
name: "playing"
PropertyChanges { target: pauseButton; opacity: 0.0}
PropertyChanges { target: videoText; opacity: 0.0}
}
]
transitions: [
Transition {
from: "paused"; to: "playing"
NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuint; duration: 300 }
NumberAnimation { properties: "width,height"; easing.type: Easing.InOutQuint; duration: 500 }
},
Transition {
from: "playing"; to: "paused"
NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuint; duration: 300 }
NumberAnimation { properties: "width,height"; easing.type: Easing.InOutQuint; duration: 200 }
}
]
function setPlaying() {
startPage.state = "playing"
video.play()
}
function setPaused() {
startPage.state = "paused"
video.pause()
}
}
|