Merge lp:~hikiko/unity/unity.scale-application-components into lp:unity
- unity.scale-application-components
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3834 |
Proposed branch: | lp:~hikiko/unity/unity.scale-application-components |
Merge into: | lp:unity |
Prerequisite: | lp:~hikiko/unity/unity.preview-container-components |
Diff against target: |
455 lines (+162/-51) 6 files modified
dash/previews/ApplicationPreview.cpp (+106/-41) dash/previews/ApplicationPreview.h (+8/-0) dash/previews/PreviewRatingsWidget.cpp (+37/-6) dash/previews/PreviewRatingsWidget.h (+6/-0) unity-shared/RatingsButton.cpp (+2/-2) unity-shared/RatingsButton.h (+3/-2) |
To merge this branch: | bzr merge lp:~hikiko/unity/unity.scale-application-components |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Unity Team | Pending | ||
Review via email: mp+223208@code.launchpad.net |
Commit message
Scaled the ApplicationPreview and the containing widgets and components.
Description of the change
Scaled the ApplicationPreview and the containing widgets and components.
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3827
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3828
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:3829
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Marco Trevisan (Treviño) (3v1n0) : | # |
Marco Trevisan (Treviño) (3v1n0) : | # |
Eleni Maria Stea (hikiko) wrote : | # |
fixed the PreLayoutManagement
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:3830
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:3832
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Ok, problematic code has been fixed here.
Preview Diff
1 | === modified file 'dash/previews/ApplicationPreview.cpp' |
2 | --- dash/previews/ApplicationPreview.cpp 2014-06-17 18:22:57 +0000 |
3 | +++ dash/previews/ApplicationPreview.cpp 2014-06-17 18:22:57 +0000 |
4 | @@ -46,6 +46,16 @@ |
5 | { |
6 | namespace previews |
7 | { |
8 | + |
9 | +namespace |
10 | +{ |
11 | + const RawPixel ICON_SPACE_CHILDREN = 3_em; |
12 | + const RawPixel DATA_SPACE_CHILDREN = 16_em; |
13 | + const RawPixel INFO_SPACE_CHILDREN = 12_em; |
14 | + const RawPixel COPYRIGHT_SPACE_CHILDREN = 8_em; |
15 | + const RawPixel ICON_SIZE = 72_em; |
16 | +} |
17 | + |
18 | DECLARE_LOGGER(logger, "unity.dash.preview.application"); |
19 | |
20 | class DetailsScrollView : public nux::ScrollView |
21 | @@ -121,8 +131,8 @@ |
22 | |
23 | auto on_mouse_down = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_->OnMouseDown(x, y, button_flags, key_flags); }; |
24 | |
25 | - nux::HLayout* image_data_layout = new nux::HLayout(); |
26 | - image_data_layout->SetSpaceBetweenChildren(style.GetPanelSplitWidth()); |
27 | + image_data_layout_ = new nux::HLayout(); |
28 | + image_data_layout_->SetSpaceBetweenChildren(style.GetPanelSplitWidth().CP(scale)); |
29 | |
30 | ///////////////////// |
31 | // Image |
32 | @@ -134,34 +144,34 @@ |
33 | ///////////////////// |
34 | // App Data Panel |
35 | full_data_layout_ = new nux::VLayout(); |
36 | - full_data_layout_->SetPadding(style.GetDetailsTopMargin(), 0, style.GetDetailsBottomMargin(), style.GetDetailsLeftMargin()); |
37 | - full_data_layout_->SetSpaceBetweenChildren(16); |
38 | + full_data_layout_->SetPadding(style.GetDetailsTopMargin().CP(scale), 0, style.GetDetailsBottomMargin().CP(scale), style.GetDetailsLeftMargin().CP(scale)); |
39 | + full_data_layout_->SetSpaceBetweenChildren(DATA_SPACE_CHILDREN); |
40 | |
41 | ///////////////////// |
42 | // Main App Info |
43 | - nux::HLayout* main_app_info = new nux::HLayout(); |
44 | - main_app_info->SetSpaceBetweenChildren(style.GetSpaceBetweenIconAndDetails()); |
45 | + main_app_info_ = new nux::HLayout(); |
46 | + main_app_info_->SetSpaceBetweenChildren(style.GetSpaceBetweenIconAndDetails().CP(scale)); |
47 | |
48 | ///////////////////// |
49 | // Icon Layout |
50 | - nux::VLayout* icon_layout = new nux::VLayout(); |
51 | - icon_layout->SetSpaceBetweenChildren(3); |
52 | - app_icon_ = new IconTexture(app_preview_model->app_icon.Get().RawPtr() ? g_icon_to_string(app_preview_model->app_icon.Get().RawPtr()) : "", 72); |
53 | + icon_layout_ = new nux::VLayout(); |
54 | + icon_layout_->SetSpaceBetweenChildren(ICON_SPACE_CHILDREN.CP(scale)); |
55 | + app_icon_ = new IconTexture(app_preview_model->app_icon.Get().RawPtr() ? g_icon_to_string(app_preview_model->app_icon.Get().RawPtr()) : "", ICON_SIZE.CP(scale)); |
56 | AddChild(app_icon_.GetPointer()); |
57 | - app_icon_->SetMinimumSize(style.GetAppIconAreaWidth(), style.GetAppIconAreaWidth()); |
58 | - app_icon_->SetMaximumSize(style.GetAppIconAreaWidth(), style.GetAppIconAreaWidth()); |
59 | + app_icon_->SetMinimumSize(style.GetAppIconAreaWidth().CP(scale), style.GetAppIconAreaWidth().CP(scale)); |
60 | + app_icon_->SetMaximumSize(style.GetAppIconAreaWidth().CP(scale), style.GetAppIconAreaWidth().CP(scale)); |
61 | app_icon_->mouse_click.connect(on_mouse_down); |
62 | - icon_layout->AddView(app_icon_.GetPointer(), 0); |
63 | + icon_layout_->AddView(app_icon_.GetPointer(), 0); |
64 | |
65 | if (app_preview_model->rating >= 0) { |
66 | app_rating_ = new PreviewRatingsWidget(); |
67 | AddChild(app_rating_.GetPointer()); |
68 | - app_rating_->SetMaximumHeight(style.GetRatingWidgetHeight()); |
69 | - app_rating_->SetMinimumHeight(style.GetRatingWidgetHeight()); |
70 | + app_rating_->SetMaximumHeight(style.GetRatingWidgetHeight().CP(scale)); |
71 | + app_rating_->SetMinimumHeight(style.GetRatingWidgetHeight().CP(scale)); |
72 | app_rating_->SetRating(app_preview_model->rating); |
73 | app_rating_->SetReviews(app_preview_model->num_ratings); |
74 | app_rating_->request_close().connect([this]() { preview_container_->request_close.emit(); }); |
75 | - icon_layout->AddView(app_rating_.GetPointer(), 0); |
76 | + icon_layout_->AddView(app_rating_.GetPointer(), 0); |
77 | } |
78 | |
79 | ///////////////////// |
80 | @@ -169,11 +179,11 @@ |
81 | ///////////////////// |
82 | // Data |
83 | |
84 | - nux::VLayout* app_data_layout = new nux::VLayout(); |
85 | - app_data_layout->SetSpaceBetweenChildren(16); |
86 | + app_data_layout_ = new nux::VLayout(); |
87 | + app_data_layout_->SetSpaceBetweenChildren(DATA_SPACE_CHILDREN.CP(scale)); |
88 | |
89 | title_subtitle_layout_ = new nux::VLayout(); |
90 | - title_subtitle_layout_->SetSpaceBetweenChildren(style.GetSpaceBetweenTitleAndSubtitle()); |
91 | + title_subtitle_layout_->SetSpaceBetweenChildren(style.GetSpaceBetweenTitleAndSubtitle().CP(scale)); |
92 | |
93 | title_ = new StaticCairoText(preview_model_->title, true, NUX_TRACKER_LOCATION); |
94 | AddChild(title_.GetPointer()); |
95 | @@ -192,8 +202,8 @@ |
96 | title_subtitle_layout_->AddView(subtitle_.GetPointer(), 1); |
97 | } |
98 | |
99 | - nux::VLayout* app_updated_copywrite_layout = new nux::VLayout(); |
100 | - app_updated_copywrite_layout->SetSpaceBetweenChildren(8); |
101 | + app_updated_copywrite_layout_ = new nux::VLayout(); |
102 | + app_updated_copywrite_layout_->SetSpaceBetweenChildren(COPYRIGHT_SPACE_CHILDREN.CP(scale)); |
103 | |
104 | if (!app_preview_model->license.Get().empty()) |
105 | { |
106 | @@ -202,7 +212,7 @@ |
107 | license_->SetFont(style.app_license_font().c_str()); |
108 | license_->SetLines(-1); |
109 | license_->mouse_click.connect(on_mouse_down); |
110 | - app_updated_copywrite_layout->AddView(license_.GetPointer(), 1); |
111 | + app_updated_copywrite_layout_->AddView(license_.GetPointer(), 1); |
112 | } |
113 | |
114 | if (!app_preview_model->last_update.Get().empty()) |
115 | @@ -214,7 +224,7 @@ |
116 | AddChild(last_update_.GetPointer()); |
117 | last_update_->SetFont(style.app_last_update_font().c_str()); |
118 | last_update_->mouse_click.connect(on_mouse_down); |
119 | - app_updated_copywrite_layout->AddView(last_update_.GetPointer(), 1); |
120 | + app_updated_copywrite_layout_->AddView(last_update_.GetPointer(), 1); |
121 | } |
122 | |
123 | if (!app_preview_model->copyright.Get().empty()) |
124 | @@ -224,17 +234,17 @@ |
125 | copywrite_->SetFont(style.app_copywrite_font().c_str()); |
126 | copywrite_->SetLines(-1); |
127 | copywrite_->mouse_click.connect(on_mouse_down); |
128 | - app_updated_copywrite_layout->AddView(copywrite_.GetPointer(), 1); |
129 | + app_updated_copywrite_layout_->AddView(copywrite_.GetPointer(), 1); |
130 | } |
131 | |
132 | - app_data_layout->AddLayout(title_subtitle_layout_); |
133 | - app_data_layout->AddLayout(app_updated_copywrite_layout); |
134 | + app_data_layout_->AddLayout(title_subtitle_layout_); |
135 | + app_data_layout_->AddLayout(app_updated_copywrite_layout_); |
136 | |
137 | // buffer space |
138 | ///////////////////// |
139 | |
140 | - main_app_info->AddLayout(icon_layout, 0); |
141 | - main_app_info->AddLayout(app_data_layout, 1); |
142 | + main_app_info_->AddLayout(icon_layout_, 0); |
143 | + main_app_info_->AddLayout(app_data_layout_, 1); |
144 | ///////////////////// |
145 | |
146 | ///////////////////// |
147 | @@ -243,9 +253,9 @@ |
148 | app_info->EnableHorizontalScrollBar(false); |
149 | app_info->mouse_click.connect(on_mouse_down); |
150 | |
151 | - nux::VLayout* app_info_layout = new nux::VLayout(); |
152 | - app_info_layout->SetSpaceBetweenChildren(12); |
153 | - app_info->SetLayout(app_info_layout); |
154 | + app_info_layout_ = new nux::VLayout(); |
155 | + app_info_layout_->SetSpaceBetweenChildren(INFO_SPACE_CHILDREN); |
156 | + app_info->SetLayout(app_info_layout_); |
157 | |
158 | if (!preview_model_->description.Get().empty()) |
159 | { |
160 | @@ -256,7 +266,7 @@ |
161 | description_->SetLines(-style.GetDescriptionLineCount()); |
162 | description_->SetLineSpacing(style.GetDescriptionLineSpacing()); |
163 | description_->mouse_click.connect(on_mouse_down); |
164 | - app_info_layout->AddView(description_.GetPointer()); |
165 | + app_info_layout_->AddView(description_.GetPointer()); |
166 | } |
167 | |
168 | if (!preview_model_->GetInfoHints().empty()) |
169 | @@ -264,7 +274,7 @@ |
170 | preview_info_hints_ = new PreviewInfoHintWidget(preview_model_, style.GetInfoHintIconSizeWidth()); |
171 | AddChild(preview_info_hints_.GetPointer()); |
172 | preview_info_hints_->request_close().connect([this]() { preview_container_->request_close.emit(); }); |
173 | - app_info_layout->AddView(preview_info_hints_.GetPointer()); |
174 | + app_info_layout_->AddView(preview_info_hints_.GetPointer()); |
175 | } |
176 | ///////////////////// |
177 | |
178 | @@ -275,17 +285,17 @@ |
179 | actions_layout->SetLeftAndRightPadding(0, style.GetDetailsRightMargin()); |
180 | /////////////////// |
181 | |
182 | - full_data_layout_->AddLayout(main_app_info, 0); |
183 | + full_data_layout_->AddLayout(main_app_info_, 0); |
184 | full_data_layout_->AddView(app_info, 1); |
185 | full_data_layout_->AddLayout(actions_layout, 0); |
186 | ///////////////////// |
187 | |
188 | - image_data_layout->AddView(image_.GetPointer(), 0); |
189 | - image_data_layout->AddLayout(full_data_layout_, 1); |
190 | + image_data_layout_->AddView(image_.GetPointer(), 0); |
191 | + image_data_layout_->AddLayout(full_data_layout_, 1); |
192 | |
193 | mouse_click.connect(on_mouse_down); |
194 | |
195 | - SetLayout(image_data_layout); |
196 | + SetLayout(image_data_layout_); |
197 | } |
198 | |
199 | void ApplicationPreview::PreLayoutManagement() |
200 | @@ -296,12 +306,14 @@ |
201 | |
202 | nux::Geometry geo_art(geo.x, geo.y, style.GetAppImageAspectRatio() * geo.height, geo.height); |
203 | |
204 | - if (geo.width - geo_art.width - style.GetPanelSplitWidth() - style.GetDetailsLeftMargin() - style.GetDetailsRightMargin() < style.GetDetailsPanelMinimumWidth()) |
205 | - geo_art.width = MAX(0, geo.width - style.GetPanelSplitWidth() - style.GetDetailsLeftMargin() - style.GetDetailsRightMargin() - style.GetDetailsPanelMinimumWidth()); |
206 | + int content_width = geo.width - style.GetPanelSplitWidth().CP(scale) - style.GetDetailsLeftMargin().CP(scale) - style.GetDetailsRightMargin().CP(scale); |
207 | + if (content_width - geo_art.width < style.GetDetailsPanelMinimumWidth().CP(scale)) |
208 | + geo_art.width = std::max(0, content_width - style.GetDetailsPanelMinimumWidth().CP(scale)); |
209 | + |
210 | image_->SetMinMaxSize(geo_art.width, geo_art.height); |
211 | |
212 | - int details_width = MAX(0, geo.width - geo_art.width - style.GetPanelSplitWidth() - style.GetDetailsLeftMargin() - style.GetDetailsRightMargin()); |
213 | - int top_app_info_max_width = MAX(0, details_width - style.GetAppIconAreaWidth() - style.GetSpaceBetweenIconAndDetails()); |
214 | + int details_width = std::max(0, content_width - geo_art.width); |
215 | + int top_app_info_max_width = std::max(0, details_width - style.GetAppIconAreaWidth().CP(scale) - style.GetSpaceBetweenIconAndDetails().CP(scale)); |
216 | |
217 | if (title_) { title_->SetMaximumWidth(top_app_info_max_width); } |
218 | if (subtitle_) { subtitle_->SetMaximumWidth(top_app_info_max_width); } |
219 | @@ -312,12 +324,65 @@ |
220 | |
221 | for (nux::AbstractButton* button : action_buttons_) |
222 | { |
223 | - button->SetMinMaxSize(CLAMP(RawPixel((details_width - style.GetSpaceBetweenActions()) / 2), 0_em, style.GetActionButtonMaximumWidth()), style.GetActionButtonHeight()); |
224 | + button->SetMinMaxSize(CLAMP((details_width - style.GetSpaceBetweenActions().CP(scale)) / 2, 0, style.GetActionButtonMaximumWidth().CP(scale)), style.GetActionButtonHeight().CP(scale)); |
225 | } |
226 | |
227 | Preview::PreLayoutManagement(); |
228 | } |
229 | |
230 | +void ApplicationPreview::UpdateScale(double scale) |
231 | +{ |
232 | + previews::Style& style = dash::previews::Style::Instance(); |
233 | + |
234 | + if (app_icon_) |
235 | + { |
236 | + app_icon_->SetSize(ICON_SIZE.CP(scale)); |
237 | + app_icon_->SetMinimumSize(style.GetAppIconAreaWidth().CP(scale), style.GetAppIconAreaWidth().CP(scale)); |
238 | + app_icon_->SetMaximumSize(style.GetAppIconAreaWidth().CP(scale), style.GetAppIconAreaWidth().CP(scale)); |
239 | + app_icon_->ReLoadIcon(); |
240 | + } |
241 | + |
242 | + if (license_) |
243 | + license_->SetScale(scale); |
244 | + if (last_update_) |
245 | + last_update_->SetScale(scale); |
246 | + if (copywrite_) |
247 | + copywrite_->SetScale(scale); |
248 | + |
249 | + if (app_rating_) |
250 | + { |
251 | + app_rating_->scale = scale; |
252 | + app_rating_->SetMaximumHeight(style.GetRatingWidgetHeight().CP(scale)); |
253 | + app_rating_->SetMinimumHeight(style.GetRatingWidgetHeight().CP(scale)); |
254 | + } |
255 | + |
256 | + if (image_data_layout_) |
257 | + image_data_layout_->SetSpaceBetweenChildren(style.GetPanelSplitWidth().CP(scale)); |
258 | + |
259 | + if (full_data_layout_) |
260 | + { |
261 | + full_data_layout_->SetPadding(style.GetDetailsTopMargin().CP(scale), 0, style.GetDetailsBottomMargin().CP(scale), style.GetDetailsLeftMargin().CP(scale)); |
262 | + full_data_layout_->SetSpaceBetweenChildren(DATA_SPACE_CHILDREN.CP(scale)); |
263 | + } |
264 | + |
265 | + if (main_app_info_) |
266 | + main_app_info_->SetSpaceBetweenChildren(style.GetSpaceBetweenIconAndDetails().CP(scale)); |
267 | + |
268 | + if (icon_layout_) |
269 | + icon_layout_->SetSpaceBetweenChildren(ICON_SPACE_CHILDREN.CP(scale)); |
270 | + |
271 | + if (app_data_layout_) |
272 | + app_data_layout_->SetSpaceBetweenChildren(DATA_SPACE_CHILDREN.CP(scale)); |
273 | + |
274 | + if (app_info_layout_) |
275 | + app_info_layout_->SetSpaceBetweenChildren(INFO_SPACE_CHILDREN.CP(scale)); |
276 | + |
277 | + if (app_updated_copywrite_layout_) |
278 | + app_updated_copywrite_layout_->SetSpaceBetweenChildren(COPYRIGHT_SPACE_CHILDREN.CP(scale)); |
279 | + |
280 | + Preview::UpdateScale(scale); |
281 | +} |
282 | + |
283 | } // namespace previews |
284 | } // namespace dash |
285 | } // namepsace unity |
286 | |
287 | === modified file 'dash/previews/ApplicationPreview.h' |
288 | --- dash/previews/ApplicationPreview.h 2013-09-19 16:44:03 +0000 |
289 | +++ dash/previews/ApplicationPreview.h 2014-06-17 18:22:57 +0000 |
290 | @@ -54,9 +54,17 @@ |
291 | virtual void PreLayoutManagement(); |
292 | |
293 | virtual void SetupViews(); |
294 | + void UpdateScale(double scale) override; |
295 | |
296 | protected: |
297 | nux::VLayout* title_subtitle_layout_; |
298 | + nux::HLayout* image_data_layout_; |
299 | + nux::HLayout* main_app_info_; |
300 | + nux::VLayout* icon_layout_; |
301 | + nux::VLayout* app_data_layout_; |
302 | + nux::VLayout* app_updated_copywrite_layout_; |
303 | + nux::VLayout* app_info_layout_; |
304 | + nux::Layout* actions_layout_; |
305 | |
306 | nux::ObjectPtr<IconTexture> app_icon_; |
307 | nux::ObjectPtr<PreviewRatingsWidget> app_rating_; |
308 | |
309 | === modified file 'dash/previews/PreviewRatingsWidget.cpp' |
310 | --- dash/previews/PreviewRatingsWidget.cpp 2013-11-19 18:48:35 +0000 |
311 | +++ dash/previews/PreviewRatingsWidget.cpp 2014-06-17 18:22:57 +0000 |
312 | @@ -38,31 +38,42 @@ |
313 | namespace previews |
314 | { |
315 | |
316 | +namespace |
317 | +{ |
318 | + const RawPixel CHILDREN_SPACE = 3_em; |
319 | + const RawPixel RATINGS_SIZE = 18_em; |
320 | + const RawPixel RATINGS_GAP = 2_em; |
321 | +} |
322 | + |
323 | NUX_IMPLEMENT_OBJECT_TYPE(PreviewRatingsWidget); |
324 | |
325 | PreviewRatingsWidget::PreviewRatingsWidget(NUX_FILE_LINE_DECL) |
326 | : View(NUX_FILE_LINE_PARAM) |
327 | + , scale(1.0) |
328 | { |
329 | - nux::VLayout* layout = new nux::VLayout(); |
330 | - layout->SetSpaceBetweenChildren(3); |
331 | + layout_ = new nux::VLayout(); |
332 | + layout_->SetSpaceBetweenChildren(CHILDREN_SPACE.CP(scale)); |
333 | |
334 | previews::Style& style = previews::Style::Instance(); |
335 | |
336 | auto on_mouse_down = [this](int x, int y, unsigned long button_flags, unsigned long key_flags) { this->preview_container_.OnMouseDown(x, y, button_flags, key_flags); }; |
337 | |
338 | - ratings_ = new RatingsButton(18,2); |
339 | + ratings_ = new RatingsButton(RATINGS_SIZE.CP(scale), RATINGS_GAP.CP(scale)); |
340 | ratings_->SetEditable(false); |
341 | ratings_->mouse_click.connect(on_mouse_down); |
342 | - layout->AddView(ratings_); |
343 | + layout_->AddView(ratings_); |
344 | |
345 | reviews_ = new StaticCairoText("", NUX_TRACKER_LOCATION); |
346 | reviews_->SetFont(style.user_rating_font()); |
347 | + reviews_->SetScale(scale); |
348 | reviews_->mouse_click.connect(on_mouse_down); |
349 | - layout->AddView(reviews_); |
350 | + layout_->AddView(reviews_); |
351 | |
352 | mouse_click.connect(on_mouse_down); |
353 | |
354 | - SetLayout(layout); |
355 | + SetLayout(layout_); |
356 | + |
357 | + scale.changed.connect(sigc::mem_fun(this, &PreviewRatingsWidget::UpdateScale)); |
358 | } |
359 | |
360 | PreviewRatingsWidget::~PreviewRatingsWidget() |
361 | @@ -114,6 +125,26 @@ |
362 | .add(GetAbsoluteGeometry()); |
363 | } |
364 | |
365 | +void PreviewRatingsWidget::UpdateScale(double scale) |
366 | +{ |
367 | + if (reviews_) |
368 | + reviews_->SetScale(scale); |
369 | + |
370 | + if (ratings_) |
371 | + { |
372 | + ratings_->star_gap_ = RATINGS_SIZE.CP(scale); |
373 | + ratings_->star_gap_ = RATINGS_GAP.CP(scale); |
374 | + } |
375 | + |
376 | + preview_container_.scale = scale; |
377 | + |
378 | + if (layout_) |
379 | + layout_->SetSpaceBetweenChildren(CHILDREN_SPACE.CP(scale)); |
380 | + |
381 | + QueueRelayout(); |
382 | + QueueDraw(); |
383 | +} |
384 | + |
385 | } // namespace previews |
386 | } // namespace dash |
387 | } // namespace unity |
388 | |
389 | === modified file 'dash/previews/PreviewRatingsWidget.h' |
390 | --- dash/previews/PreviewRatingsWidget.h 2013-09-19 16:44:03 +0000 |
391 | +++ dash/previews/PreviewRatingsWidget.h 2014-06-17 18:22:57 +0000 |
392 | @@ -52,6 +52,8 @@ |
393 | |
394 | void SetReviews(int count); |
395 | |
396 | + nux::Property<double> scale; |
397 | + |
398 | sigc::signal<void> request_close() const { return preview_container_.request_close; } |
399 | |
400 | protected: |
401 | @@ -65,9 +67,13 @@ |
402 | void AddProperties(debug::IntrospectionData&); |
403 | |
404 | private: |
405 | + void UpdateScale(double scale); |
406 | + |
407 | RatingsButton* ratings_; |
408 | StaticCairoText* reviews_; |
409 | |
410 | + nux::VLayout* layout_; |
411 | + |
412 | PreviewContainer preview_container_; |
413 | }; |
414 | |
415 | |
416 | === modified file 'unity-shared/RatingsButton.cpp' |
417 | --- unity-shared/RatingsButton.cpp 2013-11-19 18:48:35 +0000 |
418 | +++ unity-shared/RatingsButton.cpp 2014-06-17 18:22:57 +0000 |
419 | @@ -36,11 +36,11 @@ |
420 | { |
421 | RatingsButton::RatingsButton(int star_size, int star_gap, NUX_FILE_LINE_DECL) |
422 | : nux::ToggleButton(NUX_FILE_LINE_PARAM) |
423 | + , star_size_(star_size) |
424 | + , star_gap_(star_gap) |
425 | , editable_(true) |
426 | , rating_(0.0) |
427 | , focused_star_(-1) |
428 | - , star_size_(star_size) |
429 | - , star_gap_(star_gap) |
430 | { |
431 | SetAcceptKeyNavFocusOnMouseDown(false); |
432 | SetAcceptKeyNavFocusOnMouseEnter(true); |
433 | |
434 | === modified file 'unity-shared/RatingsButton.h' |
435 | --- unity-shared/RatingsButton.h 2013-09-19 16:44:03 +0000 |
436 | +++ unity-shared/RatingsButton.h 2014-06-17 18:22:57 +0000 |
437 | @@ -41,6 +41,9 @@ |
438 | virtual void SetRating(float rating); |
439 | virtual float GetRating() const; |
440 | |
441 | + int star_size_; |
442 | + int star_gap_; |
443 | + |
444 | protected: |
445 | virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw); |
446 | |
447 | @@ -67,8 +70,6 @@ |
448 | bool editable_; |
449 | float rating_; |
450 | int focused_star_; |
451 | - int star_size_; |
452 | - int star_gap_; |
453 | }; |
454 | |
455 | } // namespace unity |
FAILED: Continuous integration, rev:3826 jenkins. qa.ubuntu. com/job/ unity-ci/ 951/ jenkins. qa.ubuntu. com/job/ unity-utopic- amd64-ci/ 38/console jenkins. qa.ubuntu. com/job/ unity-utopic- armhf-ci/ 38/console jenkins. qa.ubuntu. com/job/ unity-utopic- i386-ci/ 38/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- ci/951/ rebuild
http://