[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [plasma-mediacenter] /: Hide toolbars etc when you start a slideshow
From: Shantanu Tushar <shaan7in () gmail ! com>
Date: 2012-07-28 19:58:09
Message-ID: 20120728195809.B016BA6094 () git ! kde ! org
[Download RAW message or body]
Git commit e2c4c5afed7958f13b3fd9cfb732bf32b6490e08 by Shantanu Tushar.
Committed on 28/07/2012 at 21:57.
Pushed by shantanu into branch 'master'.
Hide toolbars etc when you start a slideshow
CCMAIL: ksinny@gmail.com
M +3 -0 components/imageviewer/ImageViewer.qml
M +7 -4 components/imageviewer/PictureStrip.qml
M +11 -2 components/imageviewer/PictureStripDelegate.qml
M +2 -2 components/mediabrowser/MediaItemDelegate.qml
M +1 -1 components/mediabrowser/MediaItemDelegateLogic.js
M +0 -1 components/mediawelcome/FilteredBackendsList.qml
M +9 -5 shells/newshell/package/contents/ui/mediacenter.qml
http://commits.kde.org/plasma-mediacenter/e2c4c5afed7958f13b3fd9cfb732bf32b6490e08
diff --git a/components/imageviewer/ImageViewer.qml b/components/imageviewer/ImageViewer.qml
index 6da0834..497a43b 100644
--- a/components/imageviewer/ImageViewer.qml
+++ b/components/imageviewer/ImageViewer.qml
@@ -31,6 +31,8 @@ Rectangle {
property alias stripState: mediaPictureStrip.state
property alias stripCurrentIndex: mediaPictureStrip.currentIndex
+ signal slideshowStarted
+
width: parent.width
height: parent.height
color: "black"
@@ -65,6 +67,7 @@ Rectangle {
onImageClicked: {
mediaImageViewer.source = url
}
+ onSlideShowStarted: imageRect.slideshowStarted()
states: [
State {
name: "hidden"
diff --git a/components/imageviewer/PictureStrip.qml b/components/imageviewer/PictureStrip.qml
index 6a9f7ff..d2db9b6 100644
--- a/components/imageviewer/PictureStrip.qml
+++ b/components/imageviewer/PictureStrip.qml
@@ -25,6 +25,7 @@ Item {
property alias model: imageList.model
property alias currentIndex: imageList.currentIndex
signal imageClicked(string url)
+ signal slideShowStarted
PlasmaComponents.ToolButton {
id: button1
@@ -43,12 +44,12 @@ Item {
height: parent.height
checkable: true
width: height
- iconSource: checkable ? "media-playback-start" : "media-playback-pause"
- flat: true
- onClicked: checkable = !checkable
+ iconSource: checked ? "media-playback-pause" : "media-playback-start"
+
+ onCheckedChanged: if (checked) rootItem.slideShowStarted()
Timer {
id: slideshowTimer
- interval: 4000; running: !slideshow.checkable ; repeat: true
+ interval: 4000; running: slideshow.checked ; repeat: true
onTriggered: {
var i = imageList.currentIndex;
if (i<imageList.count-1) { imageList.currentIndex = i + 1; emitClicked() }
@@ -71,6 +72,8 @@ Item {
onImageClicked: rootItem.imageClicked(url)
}
focus: true
+ snapMode: ListView.SnapToItem
+ clip: true
}
PlasmaComponents.ToolButton {
diff --git a/components/imageviewer/PictureStripDelegate.qml b/components/imageviewer/PictureStripDelegate.qml
index 1e3d5c8..b2853d8 100644
--- a/components/imageviewer/PictureStripDelegate.qml
+++ b/components/imageviewer/PictureStripDelegate.qml
@@ -21,18 +21,27 @@ import QtQuick 1.1
Item {
id: pictureStripDelegate
- scale: (ListView.isCurrentItem ? 1.5 : 1)
z: ListView.isCurrentItem ? 1 : 0
signal imageClicked(string url)
ListView.onIsCurrentItemChanged: {pictureStripDelegate.imageClicked(mediaUrl)}
Image {
- anchors.fill: parent
+ anchors { fill: parent; rightMargin: 1; topMargin: 10 }
+ anchors { leftMargin: rightMargin; bottomMargin: topMargin }
sourceSize.width: width
sourceSize.height: 0
source: mediaUrl
asynchronous: true
+ scale: (pictureStripDelegate.ListView.isCurrentItem ? 1.5 : 1)
+
+ Behavior on scale {
+ NumberAnimation {
+ duration: 500
+ easing.type: Easing.OutExpo
+ }
+ }
}
+
MouseArea {
id: pictureStripMouseArea
anchors.fill: parent
diff --git a/components/mediabrowser/MediaItemDelegate.qml b/components/mediabrowser/MediaItemDelegate.qml
index c41f207..bd181ab 100644
--- a/components/mediabrowser/MediaItemDelegate.qml
+++ b/components/mediabrowser/MediaItemDelegate.qml
@@ -85,7 +85,7 @@ Item {
id: delegateItemImage
anchors.horizontalCenter: parent.horizontalCenter
fillMode: Image.PreserveAspectCrop
- sourceSize.width: width * mediaItemDelegateItem.scale
+ sourceSize.width: width * 2
sourceSize.height: 0
asynchronous: true
source: rootColumn.source
@@ -115,7 +115,7 @@ Item {
visible: !hideLabel
font.pointSize: 14
color: "white"
- elide: Text.ElideMiddle
+ elide: mediaItemDelegateItem.GridView.isCurrentItem ? Text.ElideNone : Text.ElideMiddle
width: parent.width
wrapMode: mediaItemDelegateItem.GridView.isCurrentItem ? Text.Wrap : Text.NoWrap
diff --git a/components/mediabrowser/MediaItemDelegateLogic.js b/components/mediabrowser/MediaItemDelegateLogic.js
index 7e209d6..1ce8024 100644
--- a/components/mediabrowser/MediaItemDelegateLogic.js
+++ b/components/mediabrowser/MediaItemDelegateLogic.js
@@ -20,7 +20,7 @@
function checkAndLoad(loader)
{
if (typeof(decoration) == "string") {
- if (decoration.search('/') == 0) {
+ if (decoration.search(/.*\/.*/) == 0) {
loadImage(loader);
} else {
loadIcon(loader);
diff --git a/components/mediawelcome/FilteredBackendsList.qml b/components/mediawelcome/FilteredBackendsList.qml
index 7474bac..8bab8cf 100644
--- a/components/mediawelcome/FilteredBackendsList.qml
+++ b/components/mediawelcome/FilteredBackendsList.qml
@@ -40,7 +40,6 @@ Item {
delegate: BackendsListDelegate { width: listView.width; finalHeight: 64 }
highlight: Rectangle {
radius: 10
- height: parent.height
color: "white"
opacity: 0.5
}
diff --git a/shells/newshell/package/contents/ui/mediacenter.qml b/shells/newshell/package/contents/ui/mediacenter.qml
index bb0ebbb..cf80594 100644
--- a/shells/newshell/package/contents/ui/mediacenter.qml
+++ b/shells/newshell/package/contents/ui/mediacenter.qml
@@ -55,11 +55,7 @@ Rectangle {
stopped: runtimeData.stopped
volume: runtimeData.volume
- onClicked: {
- mediaController.state = mediaController.state ? "" : "hidden"
- mediaImageViewer.stripState = mediaImageViewer.stripState ? "" : "hidden"
- mediaBrowser.visible =false
- }
+ onClicked: hideToolbars()
onEscapePressed: mediaBrowser.visible = true
onCurrentTimeChanged: {
@@ -111,12 +107,20 @@ Rectangle {
]
transitions: [ Transition { AnchorAnimation { duration: 200 } } ]
+
+ function hideToolbars()
+ {
+ mediaController.state = mediaController.state ? "" : "hidden"
+ mediaImageViewer.stripState = mediaImageViewer.stripState ? "" : "hidden"
+ mediaBrowser.visible = false
+ }
}
MediaCenterComponents.ImageViewer {
id: mediaImageViewer
visible: false
stripVisible: visible && !mediaBrowser.visible && !mediaWelcome.visible
+ onSlideshowStarted: mediaPlayer.hideToolbars()
}
MediaCenterComponents.MediaController {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic