Merge lp:~azzar1/unity/fix-1097184 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: no longer in the source branch.
Merged at revision: 3018
Proposed branch: lp:~azzar1/unity/fix-1097184
Merge into: lp:unity
Diff against target: 82 lines (+26/-6)
4 files modified
launcher/LauncherController.cpp (+4/-0)
launcher/LauncherController.h (+2/-0)
plugins/unityshell/src/unityshell.cpp (+8/-6)
tests/autopilot/unity/tests/test_dash.py (+12/-0)
To merge this branch: bzr merge lp:~azzar1/unity/fix-1097184
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+142295@code.launchpad.net

Commit message

Remove the empty space between launcher and dash in non-default launcher size.

Description of the change

== Probelem ==
empty space between launcher and dash in non default launcher size

== Test ==
Ap test added.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

approving the change, working fine and code looks good with tests. Note however that there is still this little "jump" when we don't have the default size launcher icon when unity is loading.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/LauncherController.cpp'
2--- launcher/LauncherController.cpp 2012-12-07 04:21:35 +0000
3+++ launcher/LauncherController.cpp 2013-01-08 11:53:25 +0000
4@@ -319,6 +319,10 @@
5 launcher_window->InputWindowEnableStruts(parent_->options()->hide_mode == LAUNCHER_HIDE_NEVER);
6 launcher_window->SetEnterFocusInputArea(launcher);
7
8+ launcher_window->geometry_changed.connect([this] (nux::Area* /*area*/, nux::Geometry const& geo) {
9+ parent_->launcher_width_changed.emit(geo.width);
10+ });
11+
12 launcher->add_request.connect(sigc::mem_fun(this, &Impl::OnLauncherAddRequest));
13 launcher->remove_request.connect(sigc::mem_fun(this, &Impl::OnLauncherRemoveRequest));
14
15
16=== modified file 'launcher/LauncherController.h'
17--- launcher/LauncherController.h 2012-12-07 04:21:35 +0000
18+++ launcher/LauncherController.h 2013-01-08 11:53:25 +0000
19@@ -83,6 +83,8 @@
20
21 void UpdateSuperTapDuration(int const super_tap_duration);
22
23+ sigc::signal<void, int> launcher_width_changed;
24+
25 protected:
26 // Introspectable methods
27 std::string GetName() const;
28
29=== modified file 'plugins/unityshell/src/unityshell.cpp'
30--- plugins/unityshell/src/unityshell.cpp 2013-01-07 16:19:54 +0000
31+++ plugins/unityshell/src/unityshell.cpp 2013-01-08 11:53:25 +0000
32@@ -2940,12 +2940,6 @@
33 hud_controller_->icon_size = launcher_options->icon_size();
34 hud_controller_->tile_size = launcher_options->tile_size();
35
36- /* The launcher geometry includes 1px used to draw the right margin
37- * that must not be considered when drawing an overlay */
38- hud_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;
39- dash_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;
40- panel_controller_->launcher_width = launcher_controller_->launcher().GetAbsoluteWidth() - 1;
41-
42 if (p)
43 {
44 CompOption::Vector &opts = p->vTable->getOptions ();
45@@ -3152,6 +3146,14 @@
46
47 AddChild(dash_controller_.get());
48
49+ launcher_controller_->launcher_width_changed.connect([this] (int launcher_width) {
50+ /* The launcher geometry includes 1px used to draw the right margin
51+ * that must not be considered when drawing an overlay */
52+ hud_controller_->launcher_width = launcher_width - 1;
53+ dash_controller_->launcher_width = launcher_width - 1;
54+ panel_controller_->launcher_width = launcher_width - 1;
55+ });
56+
57 ScheduleRelayout(0);
58 }
59
60
61=== modified file 'tests/autopilot/unity/tests/test_dash.py'
62--- tests/autopilot/unity/tests/test_dash.py 2012-11-23 16:15:07 +0000
63+++ tests/autopilot/unity/tests/test_dash.py 2013-01-08 11:53:25 +0000
64@@ -582,6 +582,18 @@
65 class DashVisualTests(DashTestCase):
66 """Tests that the dash visual is correct."""
67
68+ def test_dash_position_with_non_default_launcher_width(self):
69+ """"There should be no empty space between launcher and dash when the launcher
70+ has a non-default width.
71+ """
72+ self.set_unity_option('icon_size', 60)
73+ self.dash.ensure_visible()
74+
75+ monitor = self.dash.monitor
76+ launcher = self.launcher.get_launcher_for_monitor(monitor)
77+
78+ self.assertThat(self.dash.geometry[0], Eventually(Equals(launcher.geometry[0] + launcher.geometry[2] - 1)))
79+
80 def test_see_more_result_alignment(self):
81 """The see more results label should be baseline aligned
82 with the category name label.