on 656b044 help sign in
unity8/Dash/Video/VideoTileStyle.qml
87 lines 2.5 kB history raw
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17import QtQuick 2.0
18import Ubuntu.Components 0.1
20Item {
21 id: tile
23 anchors.fill: parent
25 Image {
26 id: icon
27 anchors {
28 top: parent.top
29 horizontalCenter: parent.horizontalCenter
30 }
31 width: styledItem.imageWidth
32 height: styledItem.imageHeight
33 source: "graphics/movie_icon_holder.png"
35 Image {
36 id: image
37 objectName: "image"
38 anchors {
39 fill: parent;
40 topMargin: units.gu(2);
41 bottomMargin: units.gu(2)
42 }
43 sourceSize { width: icon.width; height: icon.height }
44 asynchronous: true
45 cache: false
46 source: styledItem.source
47 fillMode: styledItem.fillMode
48 horizontalAlignment: Image.AlignHCenter
49 verticalAlignment: Image.AlignVCenter
50 }
51 }
53 UbuntuShape {
54 id: borderPressed
55 objectName: "borderPressed"
57 anchors.fill: icon
58 radius: "medium"
59 borderSource: "radius_pressed.sci"
60 opacity: styledItem.pressed ? 1.0 : 0.0
61 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
62 }
64 Label {
65 id: label
66 objectName: "label"
67 anchors {
68 baseline: icon.bottom
69 baselineOffset: units.gu(2)
70 left: icon.left
71 right: parent.right
72 rightMargin: units.gu(1)
73 leftMargin: units.dp(2)
74 }
76 color: Theme.palette.selected.backgroundText
77 opacity: 0.9
78 style: Text.Raised
79 styleColor: "black"
80 fontSize: "small"
81 elide: Text.ElideRight
82 horizontalAlignment: styledItem.horizontalAlignment
83 text: styledItem.text
84 wrapMode: Text.Wrap
85 maximumLineCount: styledItem.maximumLineCount
86 }