~josephjamesmills/u2t/dailybuilds

« back to all changes in this revision

Viewing changes to shell/dash/previews/FilesPreview.qml

  • Committer: Joseph Mills
  • Date: 2013-02-02 18:12:29 UTC
  • Revision ID: josephjamesmills@ubuntu.com-20130202181229-lh3dptm5dhdcy7j6
adding more previews

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
2
 
import QtQuick 1.1
3
 
 
4
 
Rectangle {
5
 
    width: 100
6
 
    height: 62
 
1
import QtQuick 1.0
 
2
import Unity2d 1.0
 
3
import "../../common"
 
4
import "../../common/units.js" as Units
 
5
import "../../common/utils.js" as Utils
 
6
import "../../common/jsonpath.js" as JSONParser
 
7
import "../../dash/"
 
8
VideoPreview {
 
9
    id: preview
 
10
    buttons: buttons
 
11
    Rectangle{
 
12
        id: root
 
13
        width: parent.width
 
14
        height: parent.height
 
15
        color:"transparent"
 
16
 
 
17
        Rectangle {
 
18
            id: mainBackground
 
19
            width: if (unity2dConfiguration.formFactor === "tv" )
 
20
                       parent.width / 1.38
 
21
                   else
 
22
                       parent.width / 1.2
 
23
            height: parent.height / 1.2
 
24
            border.color: "#55FFFFFF"
 
25
            border.width: 1
 
26
            gradient: Gradient {
 
27
                GradientStop { position: 0; color: "#42FFFFFF"}
 
28
                GradientStop { position: 0.5; color: "#66808080"}
 
29
                GradientStop { position: 1; color: "#42FFFFFF"}
 
30
 
 
31
            }
 
32
            anchors{
 
33
                horizontalCenter: parent.horizontalCenter
 
34
                verticalCenter: parent.verticalCenter
 
35
            }
 
36
            Row{
 
37
                id:mainRow
 
38
                width: parent.width / 1.20
 
39
                height:  parent.height
 
40
                spacing: parent.width / 15
 
41
                anchors{
 
42
                    left: parent.left
 
43
                    leftMargin: recLeft.width / 20
 
44
                    top: parent.top
 
45
                    topMargin: parent.height / 20
 
46
                }
 
47
                Rectangle{
 
48
                    id: recLeft
 
49
                    width: mainBackground.width / 2.3
 
50
                    height: mainBackground.height / 1.1
 
51
                    opacity: .77
 
52
                    border.color: "#55FFFFFF"
 
53
                    border.width: 1
 
54
                    gradient: Gradient {
 
55
                        GradientStop { position: 0; color: "#42FFFFFF"}
 
56
                        GradientStop { position: 0.5; color: "#66808080"}
 
57
                        GradientStop { position: 1; color: "#42FFFFFF"}
 
58
 
 
59
                    }
 
60
                    Image {
 
61
                        id: desktopScreenshot
 
62
                        width: recLeft.width
 
63
                        height: recLeft.height / 1.4
 
64
                        smooth: true
 
65
                        source: uri.substring(uri.lastIndexOf("file://")+7)
 
66
                        scale: if (status === Image.Ready)
 
67
                                   1
 
68
                               else
 
69
                                   0
 
70
                        Behavior on scale{NumberAnimation{from: 0;to: 1;duration: 1200;easing.type:Easing.OutQuint }}
 
71
                        anchors{
 
72
                            verticalCenter: parent.verticalCenter
 
73
                        }
 
74
                    }
 
75
                }
 
76
 
 
77
                Rectangle{
 
78
                    id: recRight
 
79
                    width: mainBackground.width / 2.3
 
80
                    height: mainBackground.height / 1.1
 
81
                    opacity: .77
 
82
                    border.color: "#55FFFFFF"
 
83
                    border.width: 1
 
84
                    gradient: Gradient {
 
85
                        GradientStop { position: 0; color: "#42FFFFFF"}
 
86
                        GradientStop { position: 0.5; color: "#66808080"}
 
87
                        GradientStop { position: 1; color: "#42FFFFFF"}
 
88
 
 
89
                    }
 
90
                    Text{
 
91
                        id:mainName
 
92
                        font.pixelSize: parent.width / 12
 
93
                        color: "white"
 
94
                        text: Utils.removeExt(name)
 
95
                        width: parent.width
 
96
                        wrapMode: Text.WordWrap
 
97
                    }Text{
 
98
                        text: "<b>Format:</b> \t" + mimeType.substring(mimeType.lastIndexOf("/")+1)
 
99
                        color: "white"
 
100
                        anchors{
 
101
                        top: mainName.bottom
 
102
 
 
103
                        }
 
104
                    }
 
105
                }
 
106
            }
 
107
        }
 
108
    }
7
109
}