Merge lp:~bregma/unity/lp-1053313 into lp:unity

Proposed by Stephen M. Webb
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 2791
Proposed branch: lp:~bregma/unity/lp-1053313
Merge into: lp:unity
Diff against target: 78 lines (+44/-2)
2 files modified
dash/DashView.cpp (+27/-2)
manual-tests/Preview.txt (+17/-0)
To merge this branch: bzr merge lp:~bregma/unity/lp-1053313
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
Review via email: mp+127824@code.launchpad.net

Commit message

Move the Dash navbar out of the way while a Preview is open (lp: #1053313).

Description of the change

Moves the Dash navbar out of the way while a Preview is open (lp: #1053313).

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Looks good and confirmed working.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dash/DashView.cpp'
2--- dash/DashView.cpp 2012-10-02 12:55:23 +0000
3+++ dash/DashView.cpp 2012-10-03 16:39:42 +0000
4@@ -500,6 +500,31 @@
5 renderer_.DrawFull(graphics_engine, content_geo_, GetAbsoluteGeometry(), GetGeometry(), true);
6 }
7
8+/**
9+ * Parametrically interpolates a value in one of two consecutive closed intervals.
10+ *
11+ * @param[in] p
12+ * @param[in] start The left (least) value of the closed interval.
13+ * @param[in] end1 The right (greatest) value of the closed interval,
14+ * if start <= end1
15+ * @param[in] end2 The right (greatest) value of the closed interval,
16+ * if start > end1
17+ *
18+ * @returns the linear interpolation at @p p of the interval [start, end] where end
19+ * is @p end1 if start <= @p end1, otherwise end is @end2.
20+ */
21+static float Interpolate2(float p, int start, int end1, int end2)
22+{
23+ float result = end2;
24+ if (start < end2)
25+ {
26+ int end = start > end1 ? end2 : end1;
27+ result = start + p * (end - start);
28+ }
29+
30+ return result;
31+}
32+
33 void DashView::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw)
34 {
35 renderer_.DrawInner(graphics_engine, content_geo_, GetAbsoluteGeometry(), GetGeometry());
36@@ -652,7 +677,7 @@
37
38 graphics_engine.QRP_TexDesaturate(
39 fade_out_value_ * layout_->GetX() + (1 - fade_out_value_) * final_x,
40- fade_out_value_ * (opening_row_y_ + opening_row_height_) + (1 - fade_out_value_) * final_y,
41+ Interpolate2(1.0f - fade_out_value_, opening_row_y_ + opening_row_height_, final_y, layout_->GetHeight()),
42 layout_->GetWidth() - filter_width,
43 layout_->GetHeight() - opening_row_y_ - opening_row_height_,
44 layout_copy_, texxform,
45@@ -735,7 +760,7 @@
46
47 graphics_engine.QRP_TexDesaturate(
48 (1.0f - fade_in_value_) * layout_->GetX() + (fade_in_value_) * final_x,
49- (1.0f - fade_in_value_) * (opening_row_y_ + opening_row_height_) + (fade_in_value_) * final_y,
50+ Interpolate2(fade_in_value_, opening_row_y_ + opening_row_height_, final_y, layout_->GetHeight()),
51 layout_->GetWidth() - filter_width,
52 layout_->GetHeight() - opening_row_y_ - opening_row_height_,
53 layout_copy_, texxform,
54
55=== modified file 'manual-tests/Preview.txt'
56--- manual-tests/Preview.txt 2012-09-27 16:34:31 +0000
57+++ manual-tests/Preview.txt 2012-10-03 16:39:42 +0000
58@@ -187,3 +187,20 @@
59 Expected Result:
60 The preview window will immediately display, and if the preview takes longer
61 than 300ms to open, it will display a spinner while waiting.
62+
63+
64+Preview Open and the Dash Navbar
65+--------------------------------
66+This tests that the Dash navigation bar does not show when a preview is
67+open (https://bugs.launchpad.net/unity/+bug/1053313).
68+
69+Setup:
70+#. Open dash.
71+#. Open Files and Folders Lens (or any lens with 3 rows).
72+
73+Actions:
74+#. Right-click a result on the third (bottommost) row.
75+
76+Expected result:
77+ The Dash navigation bar should not be seen through the preview.
78+