Merge lp:~feng-kylin/unity/lp_1573897 into lp:unity

Proposed by handsome_feng
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 4118
Proposed branch: lp:~feng-kylin/unity/lp_1573897
Merge into: lp:unity
Diff against target: 95 lines (+50/-11)
1 file modified
plugins/unityshell/src/unityshell.cpp (+50/-11)
To merge this branch: bzr merge lp:~feng-kylin/unity/lp_1573897
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Needs Fixing
Eleni Maria Stea (community) Approve
Review via email: mp+292883@code.launchpad.net

Commit message

Change the x_offset of expo when launcher position changed.

Description of the change

Change the x_offset of expo when launcher position changed.

To post a comment you must log in.
Revision history for this message
Eleni Maria Stea (hikiko) :
review: Approve
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Would be nice to add a y_bottom_offset to expo plugin and using it to properly resize the expo area in case the launcher is in the bottom.

Revision history for this message
Andrea Azzarone (azzar1) :
review: Needs Fixing
Revision history for this message
handsome_feng (feng-kylin) wrote :

> Would be nice to add a y_bottom_offset to expo plugin and using it to properly
> resize the expo area in case the launcher is in the bottom.

Yes, I will wait eleni to add the extra options to expo and scale.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2016-03-31 05:57:11 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2016-05-11 09:20:19 +0000
4@@ -3623,7 +3623,17 @@
5
6 int scale_offset = (launcher_options->hide_mode == LAUNCHER_HIDE_NEVER) ? 0 : launcher_controller_->launcher().GetWidth();
7 CompOption::Value v(scale_offset);
8- screen->setOptionForPlugin("scale", "x_offset", v);
9+ CompOption::Value bv(0);
10+ if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
11+ {
12+ screen->setOptionForPlugin("scale", "x_offset", v);
13+ screen->setOptionForPlugin("scale", "y_bottom_offset", bv);
14+ }
15+ else
16+ {
17+ screen->setOptionForPlugin("scale", "x_offset", bv);
18+ screen->setOptionForPlugin("scale", "y_bottom_offset", v);
19+ }
20 break;
21 }
22 case UnityshellOptions::BacklightMode:
23@@ -3834,11 +3844,19 @@
24 }
25
26 auto max_bounds = NuxGeometryFromCompRect(output.workArea());
27- if (launcher_controller_->options()->hide_mode != LAUNCHER_HIDE_NEVER && Settings::Instance().launcher_position() == LauncherPosition::LEFT)
28+ if (launcher_controller_->options()->hide_mode != LAUNCHER_HIDE_NEVER)
29 {
30- int monitor_width = unity_settings_.LauncherSize(monitor);
31- max_bounds.x += monitor_width;
32- max_bounds.width -= monitor_width;
33+ if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
34+ {
35+ int monitor_width = unity_settings_.LauncherSize(monitor);
36+ max_bounds.x += monitor_width;
37+ max_bounds.width -= monitor_width;
38+ }
39+ else if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM)
40+ {
41+ int launcher_size = unity_settings_.LauncherSize(monitor);
42+ max_bounds.height -= launcher_size;
43+ }
44 }
45
46 nux::Geometry final_bounds;
47@@ -4098,14 +4116,31 @@
48 adjustment_x = launcher_size;
49 shortcut_controller_->SetAdjustment(adjustment_x, panel_style_.PanelHeight(launcher->monitor));
50
51+ CompOption::Value v(launcher_size);
52 if (launcher_position == LauncherPosition::LEFT)
53 {
54- CompOption::Value v(launcher_size);
55- screen->setOptionForPlugin("expo", "x_offset", v);
56-
57- if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
58- v.set(0);
59-
60+ screen->setOptionForPlugin("expo", "x_offset", v);
61+
62+ if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
63+ v.set(0);
64+
65+ screen->setOptionForPlugin("scale", "x_offset", v);
66+
67+ v.set(0);
68+ screen->setOptionForPlugin("expo", "y_bottom_offset", v);
69+ screen->setOptionForPlugin("scale", "y_bottom_offset", v);
70+ }
71+ else
72+ {
73+ screen->setOptionForPlugin("expo", "y_bottom_offset", v);
74+
75+ if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
76+ v.set(0);
77+
78+ screen->setOptionForPlugin("scale", "y_bottom_offset", v);
79+
80+ v.set(0);
81+ screen->setOptionForPlugin("expo", "x_offset", v);
82 screen->setOptionForPlugin("scale", "x_offset", v);
83 }
84 };
85@@ -4124,6 +4159,10 @@
86 check_launchers_size();
87 });
88
89+ Settings::Instance().launcher_position.changed.connect([this, check_launchers_size] (LauncherPosition const&) {
90+ check_launchers_size();
91+ });
92+
93 check_launchers_size();
94
95 launcher_controller_->options()->scroll_inactive_icons = optionGetScrollInactiveIcons();