Merge lp:~fboucault/unity-2d/dash_horizontal_renderer into lp:unity-2d/3.0

Proposed by Florian Boucault
Status: Merged
Approved by: Florian Boucault
Approved revision: no longer in the source branch.
Merged at revision: 613
Proposed branch: lp:~fboucault/unity-2d/dash_horizontal_renderer
Merge into: lp:unity-2d/3.0
Diff against target: 137 lines (+133/-0)
1 file modified
places/UnityHorizontalTileRenderer.qml (+133/-0)
To merge this branch: bzr merge lp:~fboucault/unity-2d/dash_horizontal_renderer
Reviewer Review Type Date Requested Status
Joe Simpson (community) Approve
Review via email: mp+65488@code.launchpad.net

This proposal supersedes a proposal from 2011-06-15.

Commit message

[dash] Added a UnityHorizontalTileRenderer that is required by many community lenses (Gwibber lens, books lens, music lens, etc.)

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.
Revision history for this message
Florian Boucault (fboucault) wrote :

Thanks for the work Joe. I made a few modifications to the renderer you submitted. Can you please test them and see if everything is in order?
Thanks!

584. By Florian Boucault

Merged lp:unity-2d

Revision history for this message
Joe Simpson (headbangerkenny) wrote :

> Thanks for the work Joe. I made a few modifications to the renderer you
> submitted. Can you please test them and see if everything is in order?
> Thanks!

I did the merge command it tells me to do at the top of the page (I'm new to Bazzar and Launchpad!) and if that's the right thing to do, everything is in order!

Joe :)

Revision history for this message
Florian Boucault (fboucault) wrote :

Thanks a lot!

Revision history for this message
Joe Simpson (headbangerkenny) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'places/UnityHorizontalTileRenderer.qml'
--- places/UnityHorizontalTileRenderer.qml 1970-01-01 00:00:00 +0000
+++ places/UnityHorizontalTileRenderer.qml 2011-06-22 12:52:01 +0000
@@ -0,0 +1,133 @@
1/*
2 * This file is part of unity-2d
3 *
4 * Copyright 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
19import Qt 4.7
20import Unity2d 1.0 /* required for drag’n’drop handling */
21
22RendererGrid {
23 cellWidth: 280
24 cellHeight: 75
25 horizontalSpacing: 10
26 verticalSpacing: 10
27
28 cellRenderer: Component {
29 Button {
30 id: button
31
32 property string uri
33 property string iconHint
34 property string mimetype
35 property string displayName
36 property string comment
37
38 onClicked: {
39 dashView.active = false
40 placeEntryModel.place.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 /* Heuristic: if iconHint does not contain a '/' then it is an icon name */
75 source: iconHint != "" && iconHint.indexOf("/") == -1 ? "image://icons/" + iconHint : iconHint
76 width: 48
77 height: 48
78 anchors.verticalCenter: parent.verticalCenter
79 anchors.left: parent.left
80 anchors.leftMargin: 3
81 fillMode: Image.PreserveAspectFit
82 sourceSize.width: width
83 sourceSize.height: height
84
85 asynchronous: true
86 opacity: status == Image.Ready ? 1 : 0
87 Behavior on opacity {NumberAnimation {duration: 200; easing.type: Easing.InOutQuad}}
88 }
89
90 Item {
91 id: labels
92
93 anchors.top: parent.top
94 anchors.topMargin: 3
95 anchors.bottom: parent.bottom
96 anchors.bottomMargin: 3
97 anchors.left: icon.right
98 anchors.leftMargin: 15
99 anchors.right: parent.right
100 anchors.rightMargin: 3
101
102 TextCustom {
103 id: firstLine
104
105 text: displayName
106 color: button.state == "pressed" ? "#5e5e5e" : "#ffffff"
107 elide: Text.ElideMiddle
108
109 anchors.left: parent.left
110 anchors.right: parent.right
111 anchors.top: parent.top
112 height: paintedHeight
113 }
114
115 TextCustom {
116 id: secondLine
117
118 text: comment
119 color: button.state == "pressed" ? "#888888" : "#cccccc"
120
121 anchors.left: parent.left
122 anchors.right: parent.right
123 anchors.top: firstLine.bottom
124 anchors.bottom: parent.bottom
125
126 clip: true
127 wrapMode: Text.Wrap
128 verticalAlignment: Text.AlignTop
129 }
130 }
131 }
132 }
133}

Subscribers

People subscribed via source and target branches