Merge lp:~nick-dedekind/unity/preview-content-background-shadows into lp:unity

Proposed by Nick Dedekind
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 2695
Proposed branch: lp:~nick-dedekind/unity/preview-content-background-shadows
Merge into: lp:unity
Diff against target: 226 lines (+41/-17)
7 files modified
dash/previews/ApplicationPreview.cpp (+7/-4)
dash/previews/GenericPreview.cpp (+7/-3)
dash/previews/MoviePreview.cpp (+7/-3)
dash/previews/MusicPreview.cpp (+7/-3)
unity-shared/CoverArt.cpp (+7/-3)
unity-shared/PreviewStyle.cpp (+4/-1)
unity-shared/PreviewStyle.h (+2/-0)
To merge this branch: bzr merge lp:~nick-dedekind/unity/preview-content-background-shadows
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
Review via email: mp+124055@code.launchpad.net

Commit message

Removed dash preview background shadow.

Description of the change

Removed dash preview background shadow.

To post a comment you must log in.
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

Removal of shadow is behind an programatic option by request from design.

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dash/previews/ApplicationPreview.cpp'
2--- dash/previews/ApplicationPreview.cpp 2012-08-30 16:02:55 +0000
3+++ dash/previews/ApplicationPreview.cpp 2012-09-12 20:40:25 +0000
4@@ -50,7 +50,6 @@
5 namespace
6 {
7 nux::logging::Logger logger("unity.dash.previews.applicationpreview");
8-
9 }
10
11 class DetailsScrollView : public nux::ScrollView
12@@ -82,10 +81,12 @@
13 {
14 nux::Geometry const& base = GetGeometry();
15
16+ bool enable_bg_shadows = dash::previews::Style::Instance().GetShadowBackgroundEnabled();
17+
18 gfx_engine.PushClippingRectangle(base);
19 nux::GetPainter().PaintBackground(gfx_engine, base);
20
21- if (full_data_layout_)
22+ if (enable_bg_shadows && full_data_layout_)
23 {
24 unsigned int alpha, src, dest = 0;
25 gfx_engine.GetRenderStates().GetBlend(alpha, src, dest);
26@@ -105,7 +106,9 @@
27 nux::Geometry const& base = GetGeometry();
28 gfx_engine.PushClippingRectangle(base);
29
30- if (!IsFullRedraw())
31+ bool enable_bg_shadows = dash::previews::Style::Instance().GetShadowBackgroundEnabled();
32+
33+ if (enable_bg_shadows && !IsFullRedraw())
34 nux::GetPainter().PushLayer(gfx_engine, details_bg_layer_->GetGeometry(), details_bg_layer_.get());
35
36 unsigned int alpha, src, dest = 0;
37@@ -117,7 +120,7 @@
38
39 gfx_engine.GetRenderStates().SetBlend(alpha, src, dest);
40
41- if (!IsFullRedraw())
42+ if (enable_bg_shadows && !IsFullRedraw())
43 nux::GetPainter().PopBackground();
44
45 gfx_engine.PopClippingRectangle();
46
47=== modified file 'dash/previews/GenericPreview.cpp'
48--- dash/previews/GenericPreview.cpp 2012-08-28 10:15:19 +0000
49+++ dash/previews/GenericPreview.cpp 2012-09-12 20:40:25 +0000
50@@ -77,10 +77,12 @@
51 {
52 nux::Geometry const& base = GetGeometry();
53
54+ bool enable_bg_shadows = dash::previews::Style::Instance().GetShadowBackgroundEnabled();
55+
56 gfx_engine.PushClippingRectangle(base);
57 nux::GetPainter().PaintBackground(gfx_engine, base);
58
59- if (full_data_layout_)
60+ if (enable_bg_shadows && full_data_layout_)
61 {
62 unsigned int alpha, src, dest = 0;
63 gfx_engine.GetRenderStates().GetBlend(alpha, src, dest);
64@@ -100,7 +102,9 @@
65 nux::Geometry const& base = GetGeometry();
66 gfx_engine.PushClippingRectangle(base);
67
68- if (!IsFullRedraw())
69+ bool enable_bg_shadows = dash::previews::Style::Instance().GetShadowBackgroundEnabled();
70+
71+ if (enable_bg_shadows && !IsFullRedraw())
72 nux::GetPainter().PushLayer(gfx_engine, details_bg_layer_->GetGeometry(), details_bg_layer_.get());
73
74 unsigned int alpha, src, dest = 0;
75@@ -112,7 +116,7 @@
76
77 gfx_engine.GetRenderStates().SetBlend(alpha, src, dest);
78
79- if (!IsFullRedraw())
80+ if (enable_bg_shadows && !IsFullRedraw())
81 nux::GetPainter().PopBackground();
82
83 gfx_engine.PopClippingRectangle();
84
85=== modified file 'dash/previews/MoviePreview.cpp'
86--- dash/previews/MoviePreview.cpp 2012-08-28 10:15:19 +0000
87+++ dash/previews/MoviePreview.cpp 2012-09-12 20:40:25 +0000
88@@ -88,10 +88,12 @@
89 {
90 nux::Geometry const& base = GetGeometry();
91
92+ bool enable_bg_shadows = dash::previews::Style::Instance().GetShadowBackgroundEnabled();
93+
94 gfx_engine.PushClippingRectangle(base);
95 nux::GetPainter().PaintBackground(gfx_engine, base);
96
97- if (full_data_layout_)
98+ if (enable_bg_shadows && full_data_layout_)
99 {
100 unsigned int alpha, src, dest = 0;
101 gfx_engine.GetRenderStates().GetBlend(alpha, src, dest);
102@@ -111,7 +113,9 @@
103 nux::Geometry const& base = GetGeometry();
104 gfx_engine.PushClippingRectangle(base);
105
106- if (!IsFullRedraw())
107+ bool enable_bg_shadows = dash::previews::Style::Instance().GetShadowBackgroundEnabled();
108+
109+ if (enable_bg_shadows && !IsFullRedraw())
110 nux::GetPainter().PushLayer(gfx_engine, details_bg_layer_->GetGeometry(), details_bg_layer_.get());
111
112 unsigned int alpha, src, dest = 0;
113@@ -123,7 +127,7 @@
114
115 gfx_engine.GetRenderStates().SetBlend(alpha, src, dest);
116
117- if (!IsFullRedraw())
118+ if (enable_bg_shadows && !IsFullRedraw())
119 nux::GetPainter().PopBackground();
120
121 gfx_engine.PopClippingRectangle();
122
123=== modified file 'dash/previews/MusicPreview.cpp'
124--- dash/previews/MusicPreview.cpp 2012-08-28 10:15:19 +0000
125+++ dash/previews/MusicPreview.cpp 2012-09-12 20:40:25 +0000
126@@ -69,10 +69,12 @@
127 {
128 nux::Geometry const& base = GetGeometry();
129
130+ bool enable_bg_shadows = dash::previews::Style::Instance().GetShadowBackgroundEnabled();
131+
132 gfx_engine.PushClippingRectangle(base);
133 nux::GetPainter().PaintBackground(gfx_engine, base);
134
135- if (full_data_layout_)
136+ if (enable_bg_shadows && full_data_layout_)
137 {
138 unsigned int alpha, src, dest = 0;
139 gfx_engine.GetRenderStates().GetBlend(alpha, src, dest);
140@@ -92,7 +94,9 @@
141 nux::Geometry const& base = GetGeometry();
142 gfx_engine.PushClippingRectangle(base);
143
144- if (!IsFullRedraw())
145+ bool enable_bg_shadows = dash::previews::Style::Instance().GetShadowBackgroundEnabled();
146+
147+ if (enable_bg_shadows && !IsFullRedraw())
148 nux::GetPainter().PushLayer(gfx_engine, details_bg_layer_->GetGeometry(), details_bg_layer_.get());
149
150 unsigned int alpha, src, dest = 0;
151@@ -104,7 +108,7 @@
152
153 gfx_engine.GetRenderStates().SetBlend(alpha, src, dest);
154
155- if (!IsFullRedraw())
156+ if (enable_bg_shadows && !IsFullRedraw())
157 nux::GetPainter().PopBackground();
158
159 gfx_engine.PopClippingRectangle();
160
161=== modified file 'unity-shared/CoverArt.cpp'
162--- unity-shared/CoverArt.cpp 2012-09-03 22:45:44 +0000
163+++ unity-shared/CoverArt.cpp 2012-09-12 20:40:25 +0000
164@@ -293,10 +293,12 @@
165 {
166 nux::Geometry const& base = GetGeometry();
167
168+ bool enable_bg_shadows = dash::previews::Style::Instance().GetShadowBackgroundEnabled();
169+
170 gfx_engine.PushClippingRectangle(base);
171 nux::GetPainter().PaintBackground(gfx_engine, base);
172
173- if (bg_layer_)
174+ if (enable_bg_shadows && bg_layer_)
175 {
176 unsigned int alpha, src, dest = 0;
177 gfx_engine.GetRenderStates().GetBlend(alpha, src, dest);
178@@ -317,7 +319,9 @@
179 nux::Geometry const& base = GetGeometry();
180 gfx_engine.PushClippingRectangle(base);
181
182- if (!IsFullRedraw())
183+ bool enable_bg_shadows = dash::previews::Style::Instance().GetShadowBackgroundEnabled();
184+
185+ if (enable_bg_shadows && !IsFullRedraw())
186 nux::GetPainter().PushLayer(gfx_engine, bg_layer_->GetGeometry(), bg_layer_.get());
187
188 unsigned int alpha, src, dest = 0;
189@@ -416,7 +420,7 @@
190 if (GetLayout())
191 GetLayout()->ProcessDraw(gfx_engine, force_draw);
192
193- if (!IsFullRedraw())
194+ if (enable_bg_shadows && !IsFullRedraw())
195 nux::GetPainter().PopBackground();
196
197 gfx_engine.PopClippingRectangle();
198
199=== modified file 'unity-shared/PreviewStyle.cpp'
200--- unity-shared/PreviewStyle.cpp 2012-09-10 15:43:52 +0000
201+++ unity-shared/PreviewStyle.cpp 2012-09-12 20:40:25 +0000
202@@ -347,7 +347,10 @@
203 return "Ubuntu Light 10";
204 }
205
206-
207+bool Style::GetShadowBackgroundEnabled() const
208+{
209+ return false;
210+}
211
212 nux::BaseTexture* Style::GetNavLeftIcon()
213 {
214
215=== modified file 'unity-shared/PreviewStyle.h'
216--- unity-shared/PreviewStyle.h 2012-09-04 10:45:31 +0000
217+++ unity-shared/PreviewStyle.h 2012-09-12 20:40:25 +0000
218@@ -86,6 +86,8 @@
219
220 int GetRatingWidgetHeight() const;
221
222+ bool GetShadowBackgroundEnabled() const;
223+
224 std::string title_font() const;
225 std::string subtitle_size_font() const;
226 std::string description_font() const;