~ubuntu-branches/ubuntu/precise/unity-2d/precise-updates

« back to all changes in this revision

Viewing changes to places/UnityDefaultRenderer.qml

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-08-25 18:16:57 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20110825181657-opb29rqsxae3i98f
Tags: 4.2.0-0ubuntu1
* New upstream release:
  - [panel] application menus do not appear on first hover after dismissal
    (lp: #825262)
  - [dash] Lens icons badly scaled (lp: #825368)
  - [panel] indicators are shifted offscreen to the right (lp: #827673)
  - [panel] scrubbing from system indicators to menubar should be possible
    (lp: #706903)
  - [launcher] Closed applications don't get their launcher counts cleared
    (lp: #767367)
  - [dash] selected item should not be underlined but use the same 
    treatment as unity (lp: #817456)
  - [dash] categories should be collapsed by default (lp: #827214)
  - [dash] Ratings filter (lp: #831855)
  - [dash] Multirange filter (lp: #831856)
  - [dash] ToggleButton filter (lp: #831857)
  - [dash] Icon size must be bigger to match the mockups (lp: #831858)
  - [dash] "Refine search" right margin should be 15 pixels (lp: #832058)
  - [dash] "Refine search" should be "Filter results" (lp: #832060)
  - [dash] Font sizes should match new design (lp: #832114)
  - [panel] Glitch: application menu appearing when pressing the BFB 
    (lp: #825060)
  - [panel] Glitch: application menus are quickly opened after a drag gesture
    (lp: #825267)
  - [dash] File thumbnails aspect ratio is not respected (lp: #832204)
* debian/control: require current the current versions of nux and unity

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 Unity2d 1.0 /* required for drag’n’drop handling */
21
 
 
22
 
RendererGrid {
23
 
    cellWidth: 136
24
 
    cellHeight: 108
25
 
    horizontalSpacing: 10
26
 
    verticalSpacing: 10
27
 
 
28
 
    cellRenderer: Component {
29
 
        Button {
30
 
            property string uri
31
 
            property string iconHint
32
 
            property string mimetype
33
 
            property string displayName
34
 
            property string comment
35
 
 
36
 
            Accessible.name: displayName
37
 
 
38
 
            onClicked: {
39
 
                dashView.active = false
40
 
                lens.activate(decodeURIComponent(uri))
41
 
            }
42
 
 
43
 
            DragItemWithUrl {
44
 
                anchors.fill: parent
45
 
                url: decodeURIComponent(uri)
46
 
                defaultAction: {
47
 
                    if (!url.indexOf("application://")) return Qt.CopyAction
48
 
                    else if (!url.indexOf("unity-install://")) return Qt.IgnoreAction
49
 
                    else return Qt.LinkAction
50
 
                }
51
 
                supportedActions: defaultAction
52
 
                delegate: Component {
53
 
                    Image {
54
 
                        source: icon.source
55
 
                        width: icon.width
56
 
                        height: icon.height
57
 
                        fillMode: icon.fillMode
58
 
                        sourceSize.width: width
59
 
                        sourceSize.height: height
60
 
                        asynchronous: true
61
 
                    }
62
 
                }
63
 
                onPressed: parent.pressed = true
64
 
                onReleased: {
65
 
                    parent.pressed = false
66
 
                    parent.clicked()
67
 
                }
68
 
                onDrop: parent.pressed = false
69
 
            }
70
 
 
71
 
            Image {
72
 
                id: icon
73
 
 
74
 
                source: iconHint != "" ? "image://icons/"+iconHint : ""
75
 
                width: 48
76
 
                height: 48
77
 
                anchors.horizontalCenter: parent.horizontalCenter
78
 
                anchors.top: parent.top
79
 
                anchors.topMargin: 10
80
 
                fillMode: Image.PreserveAspectFit
81
 
                sourceSize.width: width
82
 
                sourceSize.height: height
83
 
 
84
 
                asynchronous: true
85
 
                opacity: status == Image.Ready ? 1 : 0
86
 
                Behavior on opacity {NumberAnimation {duration: 200; easing.type: Easing.InOutQuad}}
87
 
            }
88
 
 
89
 
            TextMultiLine {
90
 
                id: label
91
 
 
92
 
                text: displayName
93
 
                color: parent.state == "pressed" ? "#5e5e5e" : "#ffffff"
94
 
                state: ( parent.state == "selected" || parent.state == "hovered" ) ? "expanded" : ""
95
 
                horizontalAlignment: Text.AlignHCenter
96
 
                anchors.top: icon.bottom
97
 
                anchors.bottom: parent.bottom
98
 
                anchors.right: parent.right
99
 
                anchors.left: parent.left
100
 
                anchors.topMargin: 10
101
 
                anchors.bottomMargin: 5
102
 
                anchors.rightMargin: 3
103
 
                anchors.leftMargin: 3
104
 
                font.underline: parent.activeFocus
105
 
            }
106
 
        }
107
 
    }
108
 
}