on xenial help sign in
GenericPreview and Video fixed
commit8e12b3691b05968d509100ed4944bea9d782fc3c authorDiego Sarmentero <diego.sarmentero@gmail.com> dateThu 18 Jul 2013, 18:04 (13 years ago) parentb943b84
4 files changed+30−8
Dash/Apps/AppPreview.qml−2 Dash/DashPreview.qml+3−1 Dash/Generic/GenericPreview.qml+24−2 Dash/Video/VideoPreview.qml+3−3
Dash/Apps/AppPreview.qml−2
@@ -23,8 +23,6 @@ import "../../Components"
2323DashPreview {
2424 id: root
2525
26− property var previewData
27−
2826 signal download
2927 signal open
3028 signal sendUserReview(string review)
Dash/DashPreview.qml+3−1
@@ -19,8 +19,10 @@ import Ubuntu.Components 0.1
1919
2020Rectangle {
2121 id: root
22+
23+ property var previewData
24+
2225 property string title: ""
23− property url url: ""
2426 property real previewWidthRatio: 0.5
2527
2628 property Component header
Dash/Generic/GenericPreview.qml+24−2
@@ -23,12 +23,34 @@ import ".."
2323
2424DashPreview {
2525 id: genericPreview
26− property var previewData
2726
2827 title: previewData.title
29− url: IconUtil.from_gicon(previewData.image)
3028 previewWidthRatio: 0.6
3129
30+ property url url: IconUtil.from_gicon(previewData.image)
31+
32+ // TODO: replace this UbuntuShape with the Video component once that lands
33+ // with the player.
34+ header: UbuntuShape {
35+ id: urlLoader
36+ anchors.left: parent.left
37+ anchors.right: parent.right
38+ height: width * previewImage.sourceSize.height / previewImage.sourceSize.width
39+ radius: "medium"
40+ image: Image {
41+ id: previewImage
42+ asynchronous: true
43+ source: genericPreview.url
44+ fillMode: Image.PreserveAspectCrop
45+ }
46+
47+ MouseArea {
48+ id: previewImageMouseArea
49+ anchors.fill: parent
50+ onClicked: genericPreview.previewImageClicked()
51+ }
52+ }
53+
3254 buttons: GridView {
3355 id: buttons
3456 model: genericPreview.previewData.actions
Dash/Video/VideoPreview.qml+3−3
@@ -25,7 +25,9 @@ DashPreview {
2525 property var item
2626 property alias ready: nfo.ready
2727 property bool playable: false
28+ property string filePath: fileUri != ""
2829 readonly property url fileUri: item ? item.fileUri : ""
30+ property url url: item ? item.nfoUri.replace(/\.nfo$/, "-fanart.jpg") : ""
2931
3032 VideoInfo {
3133 id: nfo
@@ -33,9 +35,7 @@ DashPreview {
3335 }
3436
3537 title: nfo.ready ? nfo.video.title : ""
36− url: item ? item.nfoUri.replace(/\.nfo$/, "-fanart.jpg") : ""
3738 previewWidthRatio: 0.6
38− playable: fileUri != ""
3939
4040 onPreviewImageClicked: {
4141 if (playable) {
@@ -64,7 +64,7 @@ DashPreview {
6464 readonly property bool bigButton: parent.width > units.gu(40)
6565 width: bigButton ? units.gu(8) : units.gu(4.5)
6666 height: width
67− source: "graphics/play_button%1%2.png".arg(previewImageMouseArea.pressed ? "_active" : "").arg(bigButton ? "_big" : "")
67+ source: "../graphics/play_button%1%2.png".arg(previewImageMouseArea.pressed ? "_active" : "").arg(bigButton ? "_big" : "")
6868 }
6969
7070 MouseArea {