Merge lp:~headbangerkenny/unity-2d/fix-for-bug-790319 into lp:unity-2d/3.0

Proposed by Joe Simpson
Status: Superseded
Proposed branch: lp:~headbangerkenny/unity-2d/fix-for-bug-790319
Merge into: lp:unity-2d/3.0
Diff against target: 112 lines (+108/-0)
1 file modified
places/UnityHorizontalTileRenderer.qml (+108/-0)
To merge this branch: bzr merge lp:~headbangerkenny/unity-2d/fix-for-bug-790319
Reviewer Review Type Date Requested Status
Florian Boucault Pending
Review via email: mp+64724@code.launchpad.net

This proposal has been superseded by a proposal from 2011-06-22.

Commit message

Description of the change

I fixed a bug which is here:
https://bugs.launchpad.net/unity-2d/+bug/790319

Basically I made the renderer thing

To post a comment you must log in.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'places/UnityHorizontalTileRenderer.qml'
2--- places/UnityHorizontalTileRenderer.qml 1970-01-01 00:00:00 +0000
3+++ places/UnityHorizontalTileRenderer.qml 2011-06-15 17:44:36 +0000
4@@ -0,0 +1,108 @@
5+/*
6+ * This file is part of unity-2d
7+ *
8+ * Copyright 2010-2011 Canonical Ltd.
9+ *
10+ * This program is free software; you can redistribute it and/or modify
11+ * it under the terms of the GNU General Public License as published by
12+ * the Free Software Foundation; version 3.
13+ *
14+ * This program is distributed in the hope that it will be useful,
15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+ * GNU General Public License for more details.
18+ *
19+ * You should have received a copy of the GNU General Public License
20+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21+ */
22+
23+import Qt 4.7
24+import Unity2d 1.0 /* required for drag’n’drop handling */
25+
26+RendererGrid {
27+ cellWidth: 250
28+ cellHeight: 70
29+ horizontalSpacing: 10
30+ verticalSpacing: 10
31+
32+ cellRenderer: Component {
33+ Button {
34+ property string uri
35+ property string iconHint
36+ property string mimetype
37+ property string displayName
38+ property string comment
39+
40+ onClicked: {
41+ dashView.active = false
42+ placeEntryModel.place.activate(decodeURIComponent(uri))
43+ }
44+
45+ DragItemWithUrl {
46+ anchors.fill: parent
47+ url: decodeURIComponent(uri)
48+ defaultAction: {
49+ if (!url.indexOf("application://")) return Qt.CopyAction
50+ else if (!url.indexOf("unity-install://")) return Qt.IgnoreAction
51+ else return Qt.LinkAction
52+ }
53+ supportedActions: defaultAction
54+ delegate: Component {
55+ Image {
56+ source: icon.source
57+ width: icon.width
58+ height: icon.height
59+ fillMode: icon.fillMode
60+ sourceSize.width: width
61+ sourceSize.height: height
62+ asynchronous: true
63+ }
64+ }
65+ onPressed: parent.pressed = true
66+ onReleased: {
67+ parent.pressed = false
68+ parent.clicked()
69+ }
70+ onDrop: parent.pressed = false
71+ }
72+
73+ Image {
74+ id: icon
75+
76+ source: iconHint != "" ? "image://icons/"+iconHint : ""
77+ width: 48
78+ height: 48
79+ /* anchors.horizontalCenter: parent.horizontalCenter */
80+ anchors.top: parent.top
81+ anchors.left: parent.left
82+ anchors.topMargin: 10
83+ anchors.leftMargin: 10
84+ fillMode: Image.PreserveAspectFit
85+ sourceSize.width: width
86+ sourceSize.height: height
87+
88+ asynchronous: true
89+ opacity: status == Image.Ready ? 1 : 0
90+ Behavior on opacity {NumberAnimation {duration: 200; easing.type: Easing.InOutQuad}}
91+ }
92+
93+ TextMultiLine {
94+ id: label
95+
96+ text: displayName
97+ color: parent.state == "pressed" ? "#5e5e5e" : "#ffffff"
98+ state: parent.state == "selected" ? "expanded" : ""
99+ horizontalAlignment: Text.AlignHLeft
100+ anchors.left: icon.right
101+ anchors.right: parent.right
102+ anchors.bottom: parent.bottom
103+ anchors.top: parent.top
104+ anchors.topMargin: 10
105+ anchors.bottomMargin: 5
106+ anchors.rightMargin: 3
107+ anchors.leftMargin: 3
108+ font.underline: parent.activeFocus
109+ }
110+ }
111+ }
112+}

Subscribers

People subscribed via source and target branches