~fboucault/unity-2d/dash_lens_bar_robust_icon

« back to all changes in this revision

Viewing changes to places/Star.qml

  • Committer: Florian Boucault
  • Date: 2011-08-25 14:25:43 UTC
  • mfrom: (653.2.41 backend_filters)
  • Revision ID: florian@boucault.net-20110825142543-z60gvz5unwgw1fjv
[dash] New filters pane on the right hand side of the search results.

Implemented filters:
- multirange
- checkoption
- ratings

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of unity-2d
 
3
 *
 
4
 * Copyright 2010-2011 Canonical Ltd.
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; version 3.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
import QtQuick 1.0
 
20
import Effects 1.0
 
21
 
 
22
Item {
 
23
    /* Fill is between 0 and 1 */
 
24
    property real fill: 0
 
25
    property int iconSize: 32
 
26
    property bool selected: false
 
27
 
 
28
    width: childrenRect.width
 
29
    height: childrenRect.height
 
30
 
 
31
    effect: DropShadow {
 
32
         blurRadius: 8
 
33
         color: "white"
 
34
         offset.x: 0
 
35
         offset.y: 0
 
36
    }
 
37
 
 
38
    Image {
 
39
        width: sourceSize.width
 
40
        height: sourceSize.height
 
41
 
 
42
        source: ("artwork/star_empty-%1.png").arg(iconSize)
 
43
        opacity: ( selected ) ? 0.8 : 0.3
 
44
        asynchronous: true
 
45
    }
 
46
 
 
47
    Image {
 
48
        width: Math.ceil(sourceSize.width * fill)
 
49
        height: sourceSize.height
 
50
 
 
51
        source: ("artwork/star_full-%1.png").arg(iconSize)
 
52
        fillMode: Image.TileHorizontally
 
53
        asynchronous: true
 
54
        opacity: ( selected ) ? 1 : 0.8
 
55
        clip: true
 
56
    }
 
57
}
 
58
 
 
59