Merge lp:~azzar1/unity/scale-switcher-details into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 4169
Proposed branch: lp:~azzar1/unity/scale-switcher-details
Merge into: lp:unity
Diff against target: 55 lines (+11/-2)
2 files modified
launcher/SwitcherController.cpp (+3/-2)
launcher/SwitcherView.cpp (+8/-0)
To merge this branch: bzr merge lp:~azzar1/unity/scale-switcher-details
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+300800@code.launchpad.net

Commit message

Make sure the switcher detail view is properly scaled. Also scale the xy_offset to make sure the switcher and launcher do not overlap.

Description of the change

Make sure the switcher detail view is properly scaled. Also scale the xy_offset to make sure the switcher and launcher do not overlap.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/SwitcherController.cpp'
2--- launcher/SwitcherController.cpp 2016-07-04 12:45:06 +0000
3+++ launcher/SwitcherController.cpp 2016-07-21 18:06:34 +0000
4@@ -45,7 +45,7 @@
5 const std::string DETAIL_TIMEOUT = "detail-timeout";
6 const std::string VIEW_CONSTRUCT_IDLE = "view-construct-idle";
7 const unsigned FADE_DURATION = 80;
8-const int XY_OFFSET = 100;
9+const RawPixel XY_OFFSET = 100_em;
10 }
11
12 namespace switcher
13@@ -441,7 +441,8 @@
14 int monitor = uscreen->GetMonitorWithMouse();
15 auto monitor_geo = uscreen->GetMonitorGeometry(monitor);
16
17- monitor_geo.Expand(-XY_OFFSET, -XY_OFFSET);
18+ auto em = Settings::Instance().em(monitor);
19+ monitor_geo.Expand(-XY_OFFSET.CP(em), -XY_OFFSET.CP(em));
20
21 return monitor_geo;
22 }
23
24=== modified file 'launcher/SwitcherView.cpp'
25--- launcher/SwitcherView.cpp 2016-07-13 17:26:55 +0000
26+++ launcher/SwitcherView.cpp 2016-07-21 18:06:34 +0000
27@@ -49,6 +49,9 @@
28 RawPixel const EXTRA_ICON_SPACE = 10_em;
29 RawPixel const TEXT_SIZE = 15_em;
30
31+ RawPixel const LAYOUT_SPACING = 8_em;
32+ RawPixel const LAYOUT_MAX_ROW_HEIGHT = 400_em;
33+
34 unsigned int const ANIMATION_LENGTH = 250;
35 unsigned int const MAX_DIRECTIONS_CHANGED = 3;
36 unsigned int const SCROLL_WHEEL_EVENTS_DISTANCE = 75;
37@@ -88,6 +91,9 @@
38 text_view_->SetFontWeight(PANGO_WEIGHT_BOLD);
39 text_view_->SetScale(scale);
40
41+ layout_system_.spacing = LAYOUT_SPACING.CP(scale);
42+ layout_system_.max_row_height = LAYOUT_MAX_ROW_HEIGHT.CP(scale);
43+
44 icon_size.changed.connect(sigc::mem_fun(this, &SwitcherView::OnIconSizeChanged));
45 tile_size.changed.connect(sigc::mem_fun(this, &SwitcherView::OnTileSizeChanged));
46 scale.changed.connect(sigc::mem_fun(this, &SwitcherView::OnScaleChanged));
47@@ -211,6 +217,8 @@
48 text_size = TEXT_SIZE.CP(scale);
49 vertical_size = tile_size + VERTICAL_PADDING.CP(scale) * 2;
50 icon_renderer_->scale = scale;
51+ layout_system_.spacing = LAYOUT_SPACING.CP(scale);
52+ layout_system_.max_row_height = LAYOUT_MAX_ROW_HEIGHT.CP(scale);
53 }
54
55 void SwitcherView::StartAnimation()