Merge lp:~unity-team/unity/unity.coverflow into lp:unity

Proposed by Jason Smith
Status: Rejected
Rejected by: Tim Penhey
Proposed branch: lp:~unity-team/unity/unity.coverflow
Merge into: lp:unity
Diff against target: 850 lines (+482/-27)
12 files modified
plugins/unityshell/src/CoverflowResultView.cpp (+207/-0)
plugins/unityshell/src/CoverflowResultView.h (+56/-0)
plugins/unityshell/src/DashStyle.cpp (+15/-0)
plugins/unityshell/src/DashStyle.h (+3/-0)
plugins/unityshell/src/IconTexture.cpp (+36/-1)
plugins/unityshell/src/IconTexture.h (+3/-0)
plugins/unityshell/src/LensView.cpp (+6/-11)
plugins/unityshell/src/PlacesGroup.cpp (+127/-6)
plugins/unityshell/src/PlacesGroup.h (+13/-3)
plugins/unityshell/src/ResultView.cpp (+10/-2)
plugins/unityshell/src/ResultView.h (+4/-4)
standalone-clients/CMakeLists.txt (+2/-0)
To merge this branch: bzr merge lp:~unity-team/unity/unity.coverflow
Reviewer Review Type Date Requested Status
John Lea (community) design Needs Information
Francis Ginther Abstain
jenkins (community) continuous-integration Disapprove
Marco Trevisan (Treviño) Needs Fixing
Eduard Gotwig (community) Approve
David Barth (community) Disapprove
Tim Penhey (community) Disapprove
Robert Carr (community) Approve
Jason Smith (community) Approve
Review via email: mp+92690@code.launchpad.net

Description of the change

Implements coverflow in dash

starting position: http://i.imgur.com/lDPpH.png
middle position: http://i.imgur.com/sXjfS.png

To post a comment you must log in.
Revision history for this message
Robert Carr (robertcarr) wrote :

Updated screenshot: http://i.imgur.com/Qe4N2.png

Revision history for this message
John Lea (johnlea) wrote :

Hi Jason, awesome work! ;-) Conditionally approved, on the understanding that the items listed below will all be fixed/implemented before user interface freeze. These changes are listed in priority order:

- The distance between the bottom of the category header and the top of the icons should be the same for both the grid view and the flow view

- In the music lens and the video lens, increase the size of the grid icons so that they match the size of the flow icons. Ideally switching between a collapsed grid and a flow should not change the vertical size, the vertical size of both should be identical.

- In the other lenses, decrease the size of the flow icons so that they match the size of the grid icons. Ideally switching between a collapsed grid and a flow should not change the vertical size, the vertical size of both should be identical.

- Change test from "See XX more results >" to "XX results"

- A very fast crossfade should be used to blend switching between the grid and flow views

- Add visual indication of keyboard focus

- draging a icon upwards should de-couple the icon so that it can be dragged and dropped on either the Launcher or outside of the Dash

- Blend hard edge where flow items enter and leave the screen with a alpha mask to make the transition less abrupt.

- Clicking the 'grid to flow' button should move the dash upwards so that all of the flow is shown on the screen *if required*.

- adjust the text underneath the icons in the flow view so that it more closely matches the text in the grid view

- add the 'blurred background' effect (used on the grid view to give a sense of depth to the dash glass) to the flow view

- Add overlay scrollbar with no thumb that only appears when dragging (iOS style). It fades very quickly out when there is no movement.

- when kenetic scrolling reaches the end of a list, it should 'bounce' instead of doing a hard stop.

- the kenetic scrolling needs to be slowed down a little bit

- any click during a fast kenetic scroll should stop the kenetic scroll and not launch the item that was clicked on. However this should not apply to clicks during *very* slow kenetic scrolls

review: Approve (design)
Revision history for this message
Jason Smith (jassmith) wrote :

Tim gave me a +1 on irc and went to bed

review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/274/console reported an error when processing this lp:~unity-team/unity/unity.coverflow branch.
Not merging it.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

there was a glitch in the precise archives, reapproving.

Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/275/console reported an error when processing this lp:~unity-team/unity/unity.coverflow branch.
Not merging it.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

the amd64 archives are still screwed, wait a little bit before reapproving a branch please (should be sorted shortly).

Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/276/console reported an error when processing this lp:~unity-team/unity/unity.coverflow branch.
Not merging it.

Revision history for this message
Robert Carr (robertcarr) wrote :

+1

review: Approve
Revision history for this message
Tim Penhey (thumper) wrote :

I'm going to have to stop this landing in 5.4.

Talk to me.

review: Disapprove
Revision history for this message
Alan Bell (alanbell) wrote :

has this been tested with orca?

lp:~unity-team/unity/unity.coverflow updated
1931. By Jason Smith

merge trunk

Revision history for this message
David Barth (dbarth) wrote :

Jason, I appreciate this is a nice feature and was done on your spare time. Nonetheless, this cannot land, the reasons being:

- there are no tests; no exceptions...

- this is a feature for which performance *is* a quality requirement: the dash can't become slow because that code is not performant; the same way there were performance issues last cycle with other views, I want facts to prove that this widget / view will perform well: how does it work with 100 entries? what's the startup time impact? is icon loading performed on the fly, or in one batch at the start?
See https://wiki.canonical.com/ProductStrategyTeam/Checklist/WhatNeedsTesting for a reference.

- the list of required design changes is quite long: which means that the costs of accepting that feature is significant: impact on design, on platform, on unity-2d: i'd rather not add more to the feature development overhead and instead focus on getting higher quality for the LTS

- the feature was unplanned, not tracked anywhere: remember that we're targeting an LTS with this version of Unity

review: Disapprove
Revision history for this message
Sebastien Bacher (seb128) wrote :

David, isn't unity-2d having that feature already included for some time?

For what is worth the feature was in the staging ppa yesterday so I got it on my box (noticed this morning), what I can stay is that it:
- didn't have visible performances issues
- didn't have a visible impact on startup time
- worked quite nicely

the testing probably needs to be done but that seems worth aimed at a ffe for since the code seems mostly working before ffe and would be a great addition to unity, would be a shame to drop good work now that it's done

Revision history for this message
Jesse Wayde Brandao (jessewb) wrote :

Caught this in the staging ppa and I must say, it was a delightful surprise to find, it still needs some work, but I'm certain it could still make it in to the 12.04 LTS.
At least on my hardware it worked nicely, it'd be a shame to not have this land in the next release.

Revision history for this message
Tim Penhey (thumper) wrote :

On 15/02/12 03:44, David Barth wrote:
> Review: Disapprove
>
> Jason, I appreciate this is a nice feature and was done on your spare time. Nonetheless, this cannot land, the reasons being:
>
> - there are no tests; no exceptions...

This is the prime blocker at this stage.

> - this is a feature for which performance *is* a quality requirement: the dash can't become slow because that code is not performant; the same way there were performance issues last cycle with other views, I want facts to prove that this widget / view will perform well: how does it work with 100 entries? what's the startup time impact? is icon loading performed on the fly, or in one batch at the start?
> See https://wiki.canonical.com/ProductStrategyTeam/Checklist/WhatNeedsTesting for a reference.

This isn't an issue as it is using all the same loading code as the grid.

>
> - the list of required design changes is quite long: which means that the costs of accepting that feature is significant: impact on design, on platform, on unity-2d: i'd rather not add more to the feature development overhead and instead focus on getting higher quality for the LTS

Obviously there are some that are needed prior to landing, and others
that are "ideal". It is up to design to work out what is what there.

> - the feature was unplanned, not tracked anywhere: remember that we're targeting an LTS with this version of Unity

I don't think that this is a valid reason at all.

A key part of open source is being able to scratch your own itch.
Obviously for a group of talented hackers, coverflow was certainly an
itch that they wanted to scratch.

Since this was done during their own time, and design did reviews in
their own time, as long as the work meets the quality needs, I see
absolutely no reason why the feature couldn't land just because it
wasn't on the "planned deliverables for the shell team".

So, things blocking this landing are:
  - sufficient testing
  - design sign-off

Ideally we'd like to land this in a feature complete mode, not one where
we need to do a lot of extra work. I'm very excited to see this work
and I'd like to see it land, but I also want to make sure the quality of
what we ship stays high.

Thanks,
Tim

Revision history for this message
Viktor Reseleshki (vikktor91) wrote :

+1

Revision history for this message
nick rundy (nrundy) wrote :

This is an LTS. So shouldn't you guys be SOLELY concerned with refining and bug fixing what already exists? Like being able to use PageUp & PageDown in the Dash. Or being able to use the keyboard shortcuts (e.g., Alt+F10) when in the Dash. Or being able to set the time & date format so that it is universally shown the same way throughout the OS. Or being able to use the up/down keys to navigate to the launcher apps that are represented in Spread Mode.

There are so many "small" things. Bugs are a big problem in Ubuntu. Honestly, if you guys want to add "new features", DELAY the release of Precise and add them. You guys choose to stick to a six month release. So come LTS time, stay disciplined and give users a highly refined product. That is, spend all your time refining and bug fixing.

Cover Flow is pretty cool. I'm not knocking it. But bug fixing and refinement is more important to users, especially for an LTS. And especially considering that many of the same bugs that plagued 10.04 still exist. There are more than a dozen bugs that might be deemed "minor" but that really detract from a positive user-experience on Ubuntu. I would really like to see these bugs fixed for the LTS. If adding this Cover Flow takes any time away from bug fixing "minor" stuff, I say do NOT do it.

Revision history for this message
Eduard Gotwig (gotwig) wrote :

I realy like this idea, if this works for all lenses / scopes it would be realy good. even if this would be optional, I would definitly love it !

Revision history for this message
Eduard Gotwig (gotwig) wrote :

+1

review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

82 + icon_texture_->texture_updated.connect([&] (nux::BaseTexture *texture)
83 + {
84 + if (parent_)
85 + parent_->NeedRedraw();
86 + });

Please, disconnect this on destroy (with a sigc::connection or using sigc::mem_fun) ;)

review: Needs Fixing
lp:~unity-team/unity/unity.coverflow updated
1932. By Jason Smith

merge el trunko

Revision history for this message
Eduard Gotwig (gotwig) wrote :

so is this going to go into unity 5.4 or not by default ?

lp:~unity-team/unity/unity.coverflow updated
1933. By Jason Smith

merge trunk

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

It doesn't look like there are any hooks for lenses to request the coverflow view directly? Ie. by setting the renderer_name property like what we have for "tile-horizontal". I think lens authors would expect this.

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

When compiling this branch I get some errors about a missing LensDirectoryReader from test_filesystem_lenses.cpp in the test_gtest_dbus target.

When running the branch (by hacking CMakeLists.txt) - holy moly that is one responsive ui :-D maybe a tad too responsive as noted by John. But I feel like my laptop is turbo charged, so that's nice though :-)

Interaction wise it took me quite some time to grok how to scroll the flow (dragging only occured to me as an option after reading John's comments here). I think I was expecting it to scroll when the mouse neared the left/right edges of the row. This would also match the scrolling behaviour of the launcher.

I was also puzzled why the list was offset to the middle of the dash initially, so the leftmost 50% was empty.

Regarding John's comments about special behaviour in different lenses we need to put some hooks in libunity to let the lenses themselves control this and then update the lenses themselves to use these hooks. I am thinking two new renderer names "tile-flow" (which uses icon size similar to the current "tile-*" renderers) and a "cover-flow" renderer that uses bigger cover like icons.

Revision history for this message
Eduard Gotwig (gotwig) wrote :

ok, that thing wont go into 12.04

Revision history for this message
Muhammad Nabil (ghogaru) wrote :

I think you might want to consider to change the name "coverflow" to something like "stackflow", "airflow" or whatever as the naming of "coverflow" is identical to Apple Inc.

Revision history for this message
jenkins (martin-mrazik+qa) wrote :

FAILED: Continuous integration, rev:1933
http://s-jenkins:8080/job/unity-ci/17/

review: Disapprove (continuous-integration)
Revision history for this message
MC Return (mc-return) wrote :

Jason Smith, are you still working on that ?
From the screenshots it looks awesome, would be nice to see this in action ;)

Revision history for this message
Francis Ginther (fginther) wrote :

Review was claimed by accident, please ignore.

review: Abstain
Revision history for this message
John Lea (johnlea) wrote :

Need to see working before approving.

review: Needs Information (design)
Revision history for this message
Tim Penhey (thumper) wrote :

this is the old proposal,

most of the comments here no longer apply

Rejecting this one.

Unmerged revisions

1933. By Jason Smith

merge trunk

1932. By Jason Smith

merge el trunko

1931. By Jason Smith

merge trunk

1930. By Jason Smith

merge el trunko

1929. By Jason Smith

tighten up padding further

1928. By Jason Smith

Shorten cover reflection

1927. By Jason Smith

reduce reflection strength

1926. By Jason Smith

change settings to look closer to design

1925. By Jason Smith

Respect new upstream coverflow changes

1924. By Robert Carr

Merge lp:~unity-team/unity/unity.coverflow

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'plugins/unityshell/src/CoverflowResultView.cpp'
--- plugins/unityshell/src/CoverflowResultView.cpp 1970-01-01 00:00:00 +0000
+++ plugins/unityshell/src/CoverflowResultView.cpp 2012-02-24 17:53:50 +0000
@@ -0,0 +1,207 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*
3 * Copyright (C) 2012 Canonical Ltd
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authored by: Jason Smith <jason.smith@canonical.com>
18 */
19
20#include "CoverflowResultView.h"
21#include "IconLoader.h"
22#include "IconTexture.h"
23#include <Nux/Nux.h>
24#include <Nux/View.h>
25#include <Nux/Coverflow.h>
26#include <Nux/CoverflowModel.h>
27#include <Nux/CoverflowItem.h>
28#include <Nux/HLayout.h>
29
30
31namespace unity
32{
33namespace dash
34{
35
36NUX_IMPLEMENT_OBJECT_TYPE(CoverflowResultView);
37
38class CoverflowResultItem : public nux::CoverflowItem
39{
40public:
41 CoverflowResultItem(Result& result, CoverflowResultView *parent);
42 ~CoverflowResultItem();
43
44 nux::ObjectPtr<nux::BaseTexture> GetTexture() const;
45 void Activate();
46
47 Result result_;
48 CoverflowResultView* parent_;
49 IconTexture *icon_texture_;
50};
51
52class CoverflowResultView::Impl : public sigc::trackable
53{
54public:
55 Impl(CoverflowResultView *parent);
56 ~Impl();
57
58 void ComputeFlatIcons();
59
60 CoverflowResultView *parent_;
61 nux::Coverflow *coverflow_;
62 nux::HLayout* layout_;
63};
64
65CoverflowResultItem::CoverflowResultItem(Result& result, CoverflowResultView *parent)
66 : CoverflowItem(result.name())
67 , result_(result)
68 , parent_(parent)
69{
70 std::string const& icon_hint = result.icon_hint;
71 std::string icon_name = !icon_hint.empty() ? icon_hint : ". GThemedIcon text-x-preview";
72 static const int element_size = 128;
73
74 icon_texture_ = new IconTexture(icon_name.c_str(), element_size, true);
75 icon_texture_->add_border = true;
76 icon_texture_->LoadIcon();
77
78 icon_texture_->texture_updated.connect([&] (nux::BaseTexture *texture)
79 {
80 if (parent_)
81 parent_->NeedRedraw();
82 });
83}
84
85CoverflowResultItem::~CoverflowResultItem()
86{
87
88}
89
90nux::ObjectPtr<nux::BaseTexture> CoverflowResultItem::GetTexture() const
91{
92 return nux::ObjectPtr<nux::BaseTexture>(icon_texture_->texture());
93}
94
95void CoverflowResultItem::Activate()
96{
97 parent_->UriActivated.emit(result_.uri);
98}
99
100CoverflowResultView::Impl::Impl(CoverflowResultView *parent)
101 : parent_(parent)
102 , coverflow_(new nux::Coverflow)
103 , layout_(new nux::HLayout())
104{
105 layout_->AddView(coverflow_, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
106 parent_->SetLayout(layout_);
107
108 coverflow_->SetCameraDistance(1.44);
109 coverflow_->fov = 60;
110 coverflow_->folding_angle = 45;
111 coverflow_->true_perspective = false;
112 coverflow_->camera_motion_drift_enabled = false;
113 coverflow_->show_reflection = true;
114 coverflow_->folding_depth = .25;
115 coverflow_->reflection_strength = .2f;
116 //coverflow_->folding_rate = 3.5;
117 coverflow_->kinetic_scroll_rate = 0.05f;
118 coverflow_->mouse_drag_rate = 1.5f;
119 coverflow_->pinching = 0.2f;
120 coverflow_->y_offset = 0.15f;
121 coverflow_->reflection_size = .5f;
122}
123
124CoverflowResultView::Impl::~Impl()
125{
126
127}
128
129CoverflowResultView::CoverflowResultView(NUX_FILE_LINE_DECL)
130 : ResultView(NUX_FILE_LINE_PARAM)
131 , pimpl(new CoverflowResultView::Impl(this))
132{
133 SetMinimumHeight(180);
134}
135
136CoverflowResultView::~CoverflowResultView()
137{
138
139}
140
141void CoverflowResultView::SetModelRenderer(ResultRenderer* renderer)
142{
143 return; // abstracting breaks down here. Needs to be reworked.
144}
145
146void CoverflowResultView::AddResult(Result& result)
147{
148 results_.push_back (result);
149
150 nux::CoverflowItem::Ptr result_item(new CoverflowResultItem(result, this));
151 pimpl->coverflow_->model()->AddItem(result_item);
152}
153
154void CoverflowResultView::RemoveResult(Result& result)
155{
156 ResultView::RemoveResult(result);
157 // Ineffecient, API needs to be improved in Coverflow?
158 for (nux::CoverflowItem::Ptr item : pimpl->coverflow_->model()->Items())
159 {
160 CoverflowResultItem *result_item = static_cast<CoverflowResultItem*>(item.GetPointer());
161
162 if (result_item->result_.uri == result.uri) // maybe?
163 {
164 pimpl->coverflow_->model()->RemoveItem(item);
165 break;
166 }
167 }
168}
169
170void CoverflowResultView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
171{
172 // do nothing here
173}
174
175void CoverflowResultView::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw)
176{
177 nux::Geometry base = GetGeometry();
178 GfxContext.PushClippingRectangle(base);
179
180 if (GetCompositionLayout())
181 {
182 nux::Geometry geo = GetCompositionLayout()->GetGeometry();
183 GetCompositionLayout()->ProcessDraw(GfxContext, force_draw);
184 }
185
186 GfxContext.PopClippingRectangle();
187}
188
189void CoverflowResultView::Impl::ComputeFlatIcons()
190{
191 float width = coverflow_->ViewportWidthAtDepth(0);
192 width /= coverflow_->space_between_icons();
193
194 int flat_icons = static_cast<int>(std::floor((width - 2.0f) / 2.0f));
195 coverflow_->flat_icons = flat_icons;
196}
197
198long CoverflowResultView::ComputeContentSize()
199{
200 pimpl->ComputeFlatIcons();
201 long ret = ResultView::ComputeContentSize();
202 return ret;
203}
204
205
206}
207}
0208
=== added file 'plugins/unityshell/src/CoverflowResultView.h'
--- plugins/unityshell/src/CoverflowResultView.h 1970-01-01 00:00:00 +0000
+++ plugins/unityshell/src/CoverflowResultView.h 2012-02-24 17:53:50 +0000
@@ -0,0 +1,56 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*
3 * Copyright (C) 2012 Canonical Ltd
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authored by: Jason Smith <jason.smith@canonical.com>
18 */
19
20#ifndef UNITY_COVERFLOWRESULTVIEW_H
21#define UNITY_COVERFLOWRESULTVIEW_H
22
23#include "ResultView.h"
24
25namespace unity
26{
27namespace dash
28{
29
30class CoverflowResultView : public ResultView
31{
32 NUX_DECLARE_OBJECT_TYPE(CoverflowResultView, ResultView);
33
34public:
35 CoverflowResultView(NUX_FILE_LINE_DECL);
36 ~CoverflowResultView();
37
38 virtual void SetModelRenderer(ResultRenderer* renderer);
39
40 virtual void AddResult(Result& result);
41 virtual void RemoveResult(Result& result);
42
43protected:
44 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
45 virtual void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
46 virtual long ComputeContentSize();
47
48private:
49 struct Impl;
50 Impl* pimpl;
51};
52
53}
54}
55
56#endif
0\ No newline at end of file57\ No newline at end of file
158
=== modified file 'plugins/unityshell/src/DashStyle.cpp'
--- plugins/unityshell/src/DashStyle.cpp 2012-02-20 11:59:12 +0000
+++ plugins/unityshell/src/DashStyle.cpp 2012-02-24 17:53:50 +0000
@@ -212,6 +212,9 @@
212212
213 LazyLoadTexture group_unexpand_texture_;213 LazyLoadTexture group_unexpand_texture_;
214 LazyLoadTexture group_expand_texture_;214 LazyLoadTexture group_expand_texture_;
215
216 LazyLoadTexture group_grid_texture_;
217 LazyLoadTexture group_coverflow_texture_;
215218
216 LazyLoadTexture star_deselected_texture_;219 LazyLoadTexture star_deselected_texture_;
217 LazyLoadTexture star_selected_texture_;220 LazyLoadTexture star_selected_texture_;
@@ -248,6 +251,8 @@
248 , search_spin_glow_texture_("/search_spin_glow.png")251 , search_spin_glow_texture_("/search_spin_glow.png")
249 , group_unexpand_texture_("/dash_group_unexpand.png")252 , group_unexpand_texture_("/dash_group_unexpand.png")
250 , group_expand_texture_("/dash_group_expand.png")253 , group_expand_texture_("/dash_group_expand.png")
254 , group_grid_texture_("/grid-view.svg")
255 , group_coverflow_texture_ ("/flow-view.svg")
251 , star_deselected_texture_("/star_deselected.png")256 , star_deselected_texture_("/star_deselected.png")
252 , star_selected_texture_("/star_selected.png")257 , star_selected_texture_("/star_selected.png")
253 , star_highlight_texture_("/star_highlight.png")258 , star_highlight_texture_("/star_highlight.png")
@@ -2139,6 +2144,16 @@
2139 return pimpl->group_expand_texture_.texture();2144 return pimpl->group_expand_texture_.texture();
2140}2145}
21412146
2147nux::BaseTexture* Style::GetGroupGridIcon()
2148{
2149 return pimpl->group_grid_texture_.texture();
2150}
2151
2152nux::BaseTexture* Style::GetGroupCoverflowIcon()
2153{
2154 return pimpl->group_coverflow_texture_.texture();
2155}
2156
2142nux::BaseTexture* Style::GetStarDeselectedIcon()2157nux::BaseTexture* Style::GetStarDeselectedIcon()
2143{2158{
2144 return pimpl->star_deselected_texture_.texture();2159 return pimpl->star_deselected_texture_.texture();
21452160
=== modified file 'plugins/unityshell/src/DashStyle.h'
--- plugins/unityshell/src/DashStyle.h 2012-02-20 11:59:12 +0000
+++ plugins/unityshell/src/DashStyle.h 2012-02-24 17:53:50 +0000
@@ -185,6 +185,9 @@
185185
186 nux::BaseTexture* GetGroupUnexpandIcon();186 nux::BaseTexture* GetGroupUnexpandIcon();
187 nux::BaseTexture* GetGroupExpandIcon();187 nux::BaseTexture* GetGroupExpandIcon();
188
189 nux::BaseTexture* GetGroupGridIcon();
190 nux::BaseTexture* GetGroupCoverflowIcon();
188191
189 nux::BaseTexture* GetStarDeselectedIcon();192 nux::BaseTexture* GetStarDeselectedIcon();
190 nux::BaseTexture* GetStarSelectedIcon();193 nux::BaseTexture* GetStarSelectedIcon();
191194
=== modified file 'plugins/unityshell/src/IconTexture.cpp'
--- plugins/unityshell/src/IconTexture.cpp 2012-02-07 22:04:45 +0000
+++ plugins/unityshell/src/IconTexture.cpp 2012-02-24 17:53:50 +0000
@@ -46,6 +46,7 @@
46IconTexture::IconTexture(nux::BaseTexture* texture, guint width, guint height)46IconTexture::IconTexture(nux::BaseTexture* texture, guint width, guint height)
47 : TextureArea(NUX_TRACKER_LOCATION),47 : TextureArea(NUX_TRACKER_LOCATION),
48 _accept_key_nav_focus(false),48 _accept_key_nav_focus(false),
49 _pixbuf_cached(NULL),
49 _icon_name(NULL),50 _icon_name(NULL),
50 _size(height),51 _size(height),
51 _texture_cached(texture),52 _texture_cached(texture),
@@ -60,6 +61,7 @@
60IconTexture::IconTexture(const char* icon_name, unsigned int size, bool defer_icon_loading)61IconTexture::IconTexture(const char* icon_name, unsigned int size, bool defer_icon_loading)
61 : TextureArea(NUX_TRACKER_LOCATION),62 : TextureArea(NUX_TRACKER_LOCATION),
62 _accept_key_nav_focus(false),63 _accept_key_nav_focus(false),
64 _pixbuf_cached(NULL),
63 _icon_name(NULL),65 _icon_name(NULL),
64 _size(size),66 _size(size),
65 _texture_width(0),67 _texture_width(0),
@@ -76,6 +78,8 @@
76IconTexture::~IconTexture()78IconTexture::~IconTexture()
77{79{
78 g_free(_icon_name);80 g_free(_icon_name);
81 if (_pixbuf_cached)
82 g_object_unref(_pixbuf_cached);
79}83}
8084
81void IconTexture::SetByIconName(const char* icon_name, unsigned int size)85void IconTexture::SetByIconName(const char* icon_name, unsigned int size)
@@ -134,7 +138,12 @@
134138
135void IconTexture::Refresh(GdkPixbuf* pixbuf)139void IconTexture::Refresh(GdkPixbuf* pixbuf)
136{140{
141 if (pixbuf == _pixbuf_cached)
142 return;
143
137 TextureCache& cache = TextureCache::GetDefault();144 TextureCache& cache = TextureCache::GetDefault();
145 if (_pixbuf_cached)
146 g_object_unref(_pixbuf_cached);
138 _pixbuf_cached = pixbuf;147 _pixbuf_cached = pixbuf;
139148
140 // Cache the pixbuf dimensions so we scale correctly149 // Cache the pixbuf dimensions so we scale correctly
@@ -152,12 +161,38 @@
152 _loading = false;161 _loading = false;
153}162}
154163
164GdkPixbuf* IconTexture::AddBorderToPixbuf(GdkPixbuf* pixbuf)
165{
166 int width = gdk_pixbuf_get_width(pixbuf);
167 int height = gdk_pixbuf_get_height(pixbuf);
168 GdkPixbuf* result = gdk_pixbuf_new(gdk_pixbuf_get_colorspace(pixbuf),
169 TRUE,
170 gdk_pixbuf_get_bits_per_sample(pixbuf),
171 width + 2, height + 2);
172
173 guchar* pixels = gdk_pixbuf_get_pixels(result);
174 memset(pixels, 0, gdk_pixbuf_get_byte_length(result));
175
176 gdk_pixbuf_copy_area(pixbuf, 0, 0, width, height, result, 1, 1);
177 return result;
178}
179
155void IconTexture::IconLoaded(std::string const& icon_name, unsigned size,180void IconTexture::IconLoaded(std::string const& icon_name, unsigned size,
156 GdkPixbuf* pixbuf)181 GdkPixbuf* pixbuf)
157{182{
158 if (GDK_IS_PIXBUF(pixbuf))183 if (GDK_IS_PIXBUF(pixbuf))
159 {184 {
160 Refresh(pixbuf);185 if (add_border)
186 {
187 // Dont ref this, we already own a ref
188 GdkPixbuf* result = AddBorderToPixbuf(pixbuf);
189 Refresh(result);
190 }
191 else
192 {
193 g_object_ref(pixbuf);
194 Refresh(pixbuf);
195 }
161 }196 }
162 else197 else
163 {198 {
164199
=== modified file 'plugins/unityshell/src/IconTexture.h'
--- plugins/unityshell/src/IconTexture.h 2012-02-07 07:42:12 +0000
+++ plugins/unityshell/src/IconTexture.h 2012-02-24 17:53:50 +0000
@@ -40,6 +40,8 @@
40 IconTexture(const char* icon_name, unsigned int size, bool defer_icon_loading = false);40 IconTexture(const char* icon_name, unsigned int size, bool defer_icon_loading = false);
41 ~IconTexture();41 ~IconTexture();
4242
43 nux::Property<bool> add_border;
44
43 void SetByIconName(const char* icon_name, unsigned int size);45 void SetByIconName(const char* icon_name, unsigned int size);
44 void SetByFilePath(const char* file_path, unsigned int size);46 void SetByFilePath(const char* file_path, unsigned int size);
45 void GetTextureSize(int* width, int* height);47 void GetTextureSize(int* width, int* height);
@@ -72,6 +74,7 @@
72 nux::BaseTexture* CreateTextureCallback(std::string const& texid, int width, int height);74 nux::BaseTexture* CreateTextureCallback(std::string const& texid, int width, int height);
73 void Refresh(GdkPixbuf* pixbuf);75 void Refresh(GdkPixbuf* pixbuf);
74 void IconLoaded(std::string const& icon_name, unsigned size, GdkPixbuf* pixbuf);76 void IconLoaded(std::string const& icon_name, unsigned size, GdkPixbuf* pixbuf);
77 GdkPixbuf* AddBorderToPixbuf(GdkPixbuf* pixbuf);
7578
76 // FIXME: make _icon_name a std::string.79 // FIXME: make _icon_name a std::string.
77 char* _icon_name;80 char* _icon_name;
7881
=== modified file 'plugins/unityshell/src/LensView.cpp'
--- plugins/unityshell/src/LensView.cpp 2012-02-21 20:10:05 +0000
+++ plugins/unityshell/src/LensView.cpp 2012-02-24 17:53:50 +0000
@@ -24,6 +24,7 @@
24#include <NuxCore/Logger.h>24#include <NuxCore/Logger.h>
2525
26#include "DashStyle.h"26#include "DashStyle.h"
27#include "CoverflowResultView.h"
27#include "ResultRendererTile.h"28#include "ResultRendererTile.h"
28#include "ResultRendererHorizontalTile.h"29#include "ResultRendererHorizontalTile.h"
29#include "UBusMessages.h"30#include "UBusMessages.h"
@@ -268,15 +269,9 @@
268 /* Reset result count */269 /* Reset result count */
269 counts_[group] = 0;270 counts_[group] = 0;
270271
271 ResultViewGrid* grid = new ResultViewGrid(NUX_TRACKER_LOCATION);
272 grid->expanded = false;
273 if (renderer_name == "tile-horizontal")
274 grid->SetModelRenderer(new ResultRendererHorizontalTile(NUX_TRACKER_LOCATION));
275 else
276 grid->SetModelRenderer(new ResultRendererTile(NUX_TRACKER_LOCATION));
277272
278 grid->UriActivated.connect([&] (std::string const& uri) { uri_activated.emit(uri); lens_->Activate(uri); });273 group->SetRendererName(renderer_name.c_str());
279 group->SetChildView(grid);274 group->UriActivated.connect([&] (std::string const& uri) { uri_activated.emit(uri); lens_->Activate(uri); });
280275
281 /* We need the full range of method args so we can specify the offset276 /* We need the full range of method args so we can specify the offset
282 * of the group into the layout */277 * of the group into the layout */
@@ -289,7 +284,7 @@
289{284{
290 try {285 try {
291 PlacesGroup* group = categories_.at(result.category_index);286 PlacesGroup* group = categories_.at(result.category_index);
292 ResultViewGrid* grid = static_cast<ResultViewGrid*>(group->GetChildView());287 ResultView* grid = static_cast<ResultView*>(group->GetChildView());
293288
294 std::string uri = result.uri;289 std::string uri = result.uri;
295 LOG_TRACE(logger) << "Result added: " << uri;290 LOG_TRACE(logger) << "Result added: " << uri;
@@ -308,7 +303,7 @@
308{303{
309 try {304 try {
310 PlacesGroup* group = categories_.at(result.category_index);305 PlacesGroup* group = categories_.at(result.category_index);
311 ResultViewGrid* grid = static_cast<ResultViewGrid*>(group->GetChildView());306 ResultView* grid = static_cast<ResultView*>(group->GetChildView());
312307
313 std::string uri = result.uri;308 std::string uri = result.uri;
314 LOG_TRACE(logger) << "Result removed: " << uri;309 LOG_TRACE(logger) << "Result removed: " << uri;
@@ -364,7 +359,7 @@
364359
365void LensView::OnGroupExpanded(PlacesGroup* group)360void LensView::OnGroupExpanded(PlacesGroup* group)
366{361{
367 ResultViewGrid* grid = static_cast<ResultViewGrid*>(group->GetChildView());362 ResultView* grid = static_cast<ResultView*>(group->GetChildView());
368 grid->expanded = group->GetExpanded();363 grid->expanded = group->GetExpanded();
369 ubus_manager_.SendMessage(UBUS_PLACE_VIEW_QUEUE_DRAW);364 ubus_manager_.SendMessage(UBUS_PLACE_VIEW_QUEUE_DRAW);
370}365}
371366
=== modified file 'plugins/unityshell/src/PlacesGroup.cpp'
--- plugins/unityshell/src/PlacesGroup.cpp 2012-02-21 20:10:05 +0000
+++ plugins/unityshell/src/PlacesGroup.cpp 2012-02-24 17:53:50 +0000
@@ -44,6 +44,14 @@
44#include "ubus-server.h"44#include "ubus-server.h"
45#include "UBusMessages.h"45#include "UBusMessages.h"
4646
47#include "ResultView.h"
48#include "ResultViewGrid.h"
49#include "ResultRendererTile.h"
50#include "ResultRendererHorizontalTile.h"
51#include "CoverflowResultView.h"
52#include "FilterBasicButton.h"
53
54
47namespace unity55namespace unity
48{56{
49namespace57namespace
@@ -112,7 +120,9 @@
112 _is_expanded(true),120 _is_expanded(true),
113 _n_visible_items_in_unexpand_mode(0),121 _n_visible_items_in_unexpand_mode(0),
114 _n_total_items(0),122 _n_total_items(0),
115 _draw_sep(true)123 _draw_sep(true),
124 _coverflow_enabled(false),
125 _coverflow_button(nullptr)
116{126{
117 SetAcceptKeyNavFocusOnMouseDown(false);127 SetAcceptKeyNavFocusOnMouseDown(false);
118 SetAcceptKeyNavFocusOnMouseEnter(false);128 SetAcceptKeyNavFocusOnMouseEnter(false);
@@ -127,7 +137,7 @@
127 _group_layout->AddLayout(new nux::SpaceLayout(15,15,15,15), 0);137 _group_layout->AddLayout(new nux::SpaceLayout(15,15,15,15), 0);
128138
129 _header_view = new HeaderView(NUX_TRACKER_LOCATION);139 _header_view = new HeaderView(NUX_TRACKER_LOCATION);
130 _group_layout->AddView(_header_view, 0, nux::MINOR_POSITION_TOP, nux::MINOR_SIZE_FIX);140 _group_layout->AddView(_header_view, 0, nux::MINOR_POSITION_TOP, nux::MINOR_SIZE_FULL);
131141
132 _header_layout = new nux::HLayout(NUX_TRACKER_LOCATION);142 _header_layout = new nux::HLayout(NUX_TRACKER_LOCATION);
133 _header_layout->SetHorizontalInternalMargin(10);143 _header_layout->SetHorizontalInternalMargin(10);
@@ -166,14 +176,40 @@
166 SetLayout(_group_layout);176 SetLayout(_group_layout);
167177
168 // don't need to disconnect these signals as they are disconnected when this object destroys the contents178 // don't need to disconnect these signals as they are disconnected when this object destroys the contents
179 _header_view->mouse_enter.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseEnter));
180 _header_view->mouse_leave.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseLeave));
169 _header_view->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseClick));181 _header_view->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseClick));
170 _header_view->key_nav_focus_change.connect(sigc::mem_fun(this, &PlacesGroup::OnLabelFocusChanged));182 _header_view->key_nav_focus_change.connect(sigc::mem_fun(this, &PlacesGroup::OnLabelFocusChanged));
171 _header_view->key_nav_focus_activate.connect(sigc::mem_fun(this, &PlacesGroup::OnLabelActivated));183 _header_view->key_nav_focus_activate.connect(sigc::mem_fun(this, &PlacesGroup::OnLabelActivated));
172 _icon->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseClick));184 _icon->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseClick));
185 _icon->mouse_enter.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseEnter));
186 _icon->mouse_leave.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseLeave));
187 _icon->key_nav_focus_change.connect(sigc::mem_fun(this, &PlacesGroup::OnLabelFocusChanged));
173 _name->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseClick));188 _name->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseClick));
189 _name->mouse_enter.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseEnter));
190 _name->mouse_leave.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseLeave));
191 _name->key_nav_focus_change.connect(sigc::mem_fun(this, &PlacesGroup::OnLabelFocusChanged));
174 _expand_label->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseClick));192 _expand_label->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseClick));
193 _expand_label->mouse_enter.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseEnter));
194 _expand_label->mouse_leave.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseLeave));
195 _expand_label->key_nav_focus_activate.connect(sigc::mem_fun(this, &PlacesGroup::OnLabelActivated));
196 _expand_label->key_nav_focus_change.connect(sigc::mem_fun(this, &PlacesGroup::OnLabelFocusChanged));
175 _expand_icon->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseClick));197 _expand_icon->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseClick));
198 _expand_icon->mouse_enter.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseEnter));
199 _expand_icon->mouse_leave.connect(sigc::mem_fun(this, &PlacesGroup::RecvMouseLeave));
200 _expand_icon->key_nav_focus_change.connect(sigc::mem_fun(this, &PlacesGroup::OnLabelFocusChanged));
201
202 dash::ResultView *grid = new dash::CoverflowResultView(NUX_TRACKER_LOCATION);
203 grid->expanded = false;
176204
205 grid->SetModelRenderer(new dash::ResultRendererTile(NUX_TRACKER_LOCATION));
206
207 SetChildView(grid);
208
209 nux::BaseTexture *grid_texture = dash::Style::Instance().GetGroupCoverflowIcon();
210 _coverflow_button = new IconTexture(grid_texture, 32, 32);
211
212 _coverflow_button->mouse_click.connect(sigc::mem_fun(this, &PlacesGroup::CoverflowButtonClicked));
177 key_nav_focus_change.connect([&](nux::Area* area, bool has_focus, nux::KeyNavDirection direction)213 key_nav_focus_change.connect([&](nux::Area* area, bool has_focus, nux::KeyNavDirection direction)
178 {214 {
179 if (!has_focus)215 if (!has_focus)
@@ -184,6 +220,15 @@
184 else220 else
185 nux::GetWindowCompositor().SetKeyFocusArea(GetHeaderFocusableView(), direction);221 nux::GetWindowCompositor().SetKeyFocusArea(GetHeaderFocusableView(), direction);
186 });222 });
223 nux::HLayout *toggle_layout = new nux::HLayout();
224 toggle_layout->SetHorizontalInternalMargin(8);
225 toggle_layout->SetHorizontalExternalMargin(6);
226 nux::Layout *toggle_space = new nux::SpaceLayout(1, 10000, 0, 1);
227 toggle_layout->AddLayout(toggle_space, 1);
228 toggle_layout->AddView(_coverflow_button, 0, nux::MINOR_POSITION_CENTER);
229
230 _header_layout->AddLayout(toggle_layout, 1);
231
187}232}
188233
189PlacesGroup::~PlacesGroup()234PlacesGroup::~PlacesGroup()
@@ -216,6 +261,48 @@
216}261}
217262
218void263void
264PlacesGroup::CoverflowButtonClicked(int x, int y, unsigned long button_flags, unsigned long key_flags)
265{
266 dash::ResultView *new_view, *old_view;
267
268 old_view = _child_view;
269
270 if (_coverflow_enabled == false)
271 {
272 new_view = new dash::CoverflowResultView(NUX_TRACKER_LOCATION);
273 _coverflow_enabled = true;
274
275 _coverflow_button->SetTexture(dash::Style::Instance().GetGroupGridIcon());
276 }
277 else
278 {
279 new_view = new dash::ResultViewGrid (NUX_TRACKER_LOCATION);
280 _coverflow_enabled = false;
281
282 _coverflow_button->SetTexture(dash::Style::Instance().GetGroupCoverflowIcon());
283
284 if (_renderer_name == "tile-horizontal")
285 new_view->SetModelRenderer(new dash::ResultRendererHorizontalTile(NUX_TRACKER_LOCATION));
286 else
287 new_view->SetModelRenderer(new dash::ResultRendererTile(NUX_TRACKER_LOCATION));
288
289
290 }
291
292 for (dash::Result result: old_view->GetResultList())
293 {
294 new_view->AddResult(result);
295 }
296
297 new_view->expanded = (bool)(old_view)->expanded;
298
299 SetChildView (new_view);
300
301 SetExpanded (new_view->expanded);
302 QueueRelayout();
303}
304
305void
219PlacesGroup::SetName(const char* name)306PlacesGroup::SetName(const char* name)
220{307{
221 gchar* final = NULL;308 gchar* final = NULL;
@@ -234,6 +321,17 @@
234 g_free(final);321 g_free(final);
235}322}
236323
324void
325PlacesGroup::SetRendererName(const char *renderer_name)
326{
327 _renderer_name = renderer_name;
328
329 if (g_strcmp0(renderer_name, "tile-horizontal") == 0)
330 _child_view->SetModelRenderer(new dash::ResultRendererHorizontalTile(NUX_TRACKER_LOCATION));
331 else
332 _child_view->SetModelRenderer(new dash::ResultRendererTile(NUX_TRACKER_LOCATION));
333}
334
237nux::StaticCairoText*335nux::StaticCairoText*
238PlacesGroup::GetLabel()336PlacesGroup::GetLabel()
239{337{
@@ -253,14 +351,23 @@
253}351}
254352
255void353void
256PlacesGroup::SetChildView(nux::View* view)354PlacesGroup::SetChildView(dash::ResultView *view)
257{355{
356 if (_child_view != NULL)
357 {
358 _group_layout->RemoveChildObject(_child_view);
359 }
258 _child_view = view;360 _child_view = view;
259 _group_layout->AddView(_child_view, 1);361 _group_layout->AddView(_child_view, 1);
260 QueueDraw();362 QueueDraw();
363
364 view->UriActivated.connect([&] (std::string const& uri)
365 {
366 UriActivated.emit(uri);
367 });
261}368}
262369
263nux::View*370dash::ResultView *
264PlacesGroup::GetChildView()371PlacesGroup::GetChildView()
265{372{
266 return _child_view;373 return _child_view;
@@ -307,6 +414,20 @@
307 _expand_label->SetText(final);414 _expand_label->SetText(final);
308 _expand_label->SetVisible(_n_visible_items_in_unexpand_mode < _n_total_items);415 _expand_label->SetVisible(_n_visible_items_in_unexpand_mode < _n_total_items);
309416
417 _icon->SetAcceptKeyNavFocus(false);
418 _name->SetAcceptKeyNavFocus(false);
419 _expand_label->SetAcceptKeyNavFocus(false);
420 _expand_icon->SetAcceptKeyNavFocus(false);
421
422 if (_expand_label->IsVisible())
423 _expand_label->SetAcceptKeyNavFocus(true);
424 else if (_expand_icon->IsVisible())
425 _expand_icon->SetAcceptKeyNavFocus(true);
426 else if (_name->IsVisible())
427 _name->SetAcceptKeyNavFocus(true);
428 else if (_icon->IsVisible())
429 _icon->SetAcceptKeyNavFocus(true);
430
310 QueueDraw();431 QueueDraw();
311432
312 g_free((result_string));433 g_free((result_string));
@@ -441,11 +562,11 @@
441void562void
442PlacesGroup::SetExpanded(bool is_expanded)563PlacesGroup::SetExpanded(bool is_expanded)
443{564{
444 if (_is_expanded == is_expanded)565 /* if (_is_expanded == is_expanded)
445 return;566 return;
446567
447 if (is_expanded && _n_total_items <= _n_visible_items_in_unexpand_mode)568 if (is_expanded && _n_total_items <= _n_visible_items_in_unexpand_mode)
448 return;569 return;*/
449570
450 _is_expanded = is_expanded;571 _is_expanded = is_expanded;
451572
452573
=== modified file 'plugins/unityshell/src/PlacesGroup.h'
--- plugins/unityshell/src/PlacesGroup.h 2012-02-13 17:09:05 +0000
+++ plugins/unityshell/src/PlacesGroup.h 2012-02-24 17:53:50 +0000
@@ -31,6 +31,7 @@
31#include "Introspectable.h"31#include "Introspectable.h"
32#include "StaticCairoText.h"32#include "StaticCairoText.h"
33#include "UBusWrapper.h"33#include "UBusWrapper.h"
34#include "ResultView.h"
3435
35namespace nux36namespace nux
36{37{
@@ -50,12 +51,13 @@
5051
51 void SetIcon(const char* icon);52 void SetIcon(const char* icon);
52 void SetName(const char* name);53 void SetName(const char* name);
54 void SetRendererName(const char *renderer_name);
5355
54 nux::StaticCairoText* GetLabel();56 nux::StaticCairoText* GetLabel();
55 nux::StaticCairoText* GetExpandLabel();57 nux::StaticCairoText* GetExpandLabel();
5658
57 void SetChildView(nux::View* view);59 void SetChildView(dash::ResultView* view);
58 nux::View* GetChildView();60 dash::ResultView* GetChildView();
5961
60 void SetChildLayout(nux::Layout* layout);62 void SetChildLayout(nux::Layout* layout);
6163
@@ -73,6 +75,7 @@
73 void SetDrawSeparator(bool draw_it);75 void SetDrawSeparator(bool draw_it);
7476
75 sigc::signal<void, PlacesGroup*> expanded;77 sigc::signal<void, PlacesGroup*> expanded;
78 sigc::signal<void, std::string const&> UriActivated;
7679
77protected:80protected:
78 long ComputeContentSize();81 long ComputeContentSize();
@@ -100,6 +103,8 @@
100 void OnLabelActivated(nux::Area* label);103 void OnLabelActivated(nux::Area* label);
101 void OnLabelFocusChanged(nux::Area* label, bool has_focus, nux::KeyNavDirection direction);104 void OnLabelFocusChanged(nux::Area* label, bool has_focus, nux::KeyNavDirection direction);
102 void RefreshLabel();105 void RefreshLabel();
106
107 void CoverflowButtonClicked(int x, int y, unsigned long button_flags, unsigned long key_flags);
103108
104private:109private:
105 nux::VLayout* _group_layout;110 nux::VLayout* _group_layout;
@@ -107,7 +112,7 @@
107 nux::HLayout* _header_layout;112 nux::HLayout* _header_layout;
108 nux::HLayout* _text_layout;113 nux::HLayout* _text_layout;
109 nux::HLayout* _expand_layout;114 nux::HLayout* _expand_layout;
110 nux::View* _child_view;115 dash::ResultView *_child_view;
111 nux::AbstractPaintLayer* _focus_layer;116 nux::AbstractPaintLayer* _focus_layer;
112117
113 IconTexture* _icon;118 IconTexture* _icon;
@@ -123,6 +128,11 @@
123 char* _cached_name;128 char* _cached_name;
124 bool _draw_sep;129 bool _draw_sep;
125 nux::Geometry _cached_geometry;130 nux::Geometry _cached_geometry;
131
132 std::string _renderer_name;
133 bool _coverflow_enabled;
134
135 IconTexture *_coverflow_button;
126136
127 UBusManager _ubus;137 UBusManager _ubus;
128};138};
129139
=== modified file 'plugins/unityshell/src/ResultView.cpp'
--- plugins/unityshell/src/ResultView.cpp 2012-02-21 23:19:50 +0000
+++ plugins/unityshell/src/ResultView.cpp 2012-02-24 17:53:50 +0000
@@ -68,6 +68,10 @@
6868
69ResultView::~ResultView()69ResultView::~ResultView()
70{70{
71 if (renderer_ == NULL)
72 {
73 return;
74 }
71 ClearIntrospectableWrappers();75 ClearIntrospectableWrappers();
7276
73 for (auto result : results_)77 for (auto result : results_)
@@ -100,7 +104,9 @@
100void ResultView::AddResult(Result& result)104void ResultView::AddResult(Result& result)
101{105{
102 results_.push_back(result);106 results_.push_back(result);
103 renderer_->Preload(result);107
108 if (renderer_ != NULL)
109 renderer_->Preload(result);
104110
105 NeedRedraw();111 NeedRedraw();
106}112}
@@ -118,7 +124,9 @@
118 break;124 break;
119 }125 }
120 }126 }
121 renderer_->Unload(result);127
128 if (renderer_ != NULL)
129 renderer_->Unload(result);
122}130}
123131
124ResultView::ResultList ResultView::GetResultList()132ResultView::ResultList ResultView::GetResultList()
125133
=== modified file 'plugins/unityshell/src/ResultView.h'
--- plugins/unityshell/src/ResultView.h 2012-02-21 23:19:50 +0000
+++ plugins/unityshell/src/ResultView.h 2012-02-24 17:53:50 +0000
@@ -48,14 +48,14 @@
48 ResultView(NUX_FILE_LINE_DECL);48 ResultView(NUX_FILE_LINE_DECL);
49 virtual ~ResultView();49 virtual ~ResultView();
5050
51 void SetModelRenderer(ResultRenderer* renderer);51 virtual void SetModelRenderer(ResultRenderer* renderer);
5252
53 void AddResult(Result& result);53 virtual void AddResult(Result& result);
54 void RemoveResult(Result& result);54 virtual void RemoveResult(Result& result);
5555
56 ResultList GetResultList ();56 ResultList GetResultList ();
5757
58 void SetPreview(PreviewBase* preview, Result& related_result);58 virtual void SetPreview(PreviewBase* preview, Result& related_result);
5959
60 nux::Property<bool> expanded;60 nux::Property<bool> expanded;
61 sigc::signal<void, std::string const&> UriActivated;61 sigc::signal<void, std::string const&> UriActivated;
6262
=== modified file 'standalone-clients/CMakeLists.txt'
--- standalone-clients/CMakeLists.txt 2012-02-21 00:11:20 +0000
+++ standalone-clients/CMakeLists.txt 2012-02-24 17:53:50 +0000
@@ -47,6 +47,8 @@
47 ${UNITY_SRC}/BackgroundEffectHelper.h47 ${UNITY_SRC}/BackgroundEffectHelper.h
48 ${UNITY_SRC}/BGHash.cpp48 ${UNITY_SRC}/BGHash.cpp
49 ${UNITY_SRC}/BGHash.h49 ${UNITY_SRC}/BGHash.h
50 ${UNITY_SRC}/CoverflowResultView.cpp
51 ${UNITY_SRC}/CoverflowResultView.h
50 ${UNITY_SRC}/SearchBar.cpp52 ${UNITY_SRC}/SearchBar.cpp
51 ${UNITY_SRC}/SearchBar.h53 ${UNITY_SRC}/SearchBar.h
52 ${UNITY_SRC}/SearchBarSpinner.cpp54 ${UNITY_SRC}/SearchBarSpinner.cpp