Merge lp:~nick-dedekind/unity/lp1673950.tooltip.scaling into lp:unity

Proposed by Nick Dedekind
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 4230
Proposed branch: lp:~nick-dedekind/unity/lp1673950.tooltip.scaling
Merge into: lp:unity
Diff against target: 65 lines (+7/-8)
2 files modified
launcher/Tooltip.cpp (+6/-6)
launcher/Tooltip.h (+1/-2)
To merge this branch: bzr merge lp:~nick-dedekind/unity/lp1673950.tooltip.scaling
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+322697@code.launchpad.net

Commit message

Fixed tooltip scaling issues.

Description of the change

Fixed tooltip scaling issues.

Tooltip could appear off-screen when long and using high scaling.
Tooltip text was using incorrect vertical offset when scaling.

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/Tooltip.cpp'
2--- launcher/Tooltip.cpp 2016-01-29 03:45:34 +0000
3+++ launcher/Tooltip.cpp 2017-04-18 16:34:23 +0000
4@@ -124,13 +124,13 @@
5 {
6 int size = 0;
7 int max = GetBaseWidth() - ROTATED_ANCHOR_WIDTH.CP(cv_) - 2 * CORNER_RADIUS.CP(cv_) - 2 * _padding.CP(cv_);
8- if (_left_size.CP(cv_) > max)
9+ if (_left_size > max)
10 {
11 size = max;
12 }
13- else if (_left_size.CP(cv_) > 0)
14+ else if (_left_size > 0)
15 {
16- size = _left_size.CP(cv_);
17+ size = _left_size;
18 }
19 x = _anchorX - (ROTATED_ANCHOR_WIDTH.CP(cv_) / 2) - size - CORNER_RADIUS.CP(cv_) - _padding.CP(cv_);
20 }
21@@ -222,7 +222,7 @@
22 if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
23 _bottom_space->SetMinMaxSize(1, space_height + 1);
24 else
25- _bottom_space->SetMinMaxSize(1, space_height + ROTATED_ANCHOR_HEIGHT + 1);
26+ _bottom_space->SetMinMaxSize(1, space_height + ROTATED_ANCHOR_HEIGHT.CP(cv_) + 1);
27
28 CairoBaseWindow::PreLayoutManagement();
29 }
30@@ -653,7 +653,7 @@
31 height / dpi_scale,
32 anchor_width,
33 anchor_height,
34- _left_size,
35+ _left_size / dpi_scale,
36 CORNER_RADIUS,
37 blur_coef,
38 shadow_color,
39@@ -669,7 +669,7 @@
40 CORNER_RADIUS, // radius,
41 anchor_width, // anchor_width,
42 anchor_height, // anchor_height,
43- _left_size, // left_size,
44+ _left_size / dpi_scale, // left_size,
45 true, // negative,
46 false, // outline,
47 1.0, // line_width,
48
49=== modified file 'launcher/Tooltip.h'
50--- launcher/Tooltip.h 2015-12-17 01:08:54 +0000
51+++ launcher/Tooltip.h 2017-04-18 16:34:23 +0000
52@@ -78,7 +78,7 @@
53
54 int _anchorX;
55 int _anchorY;
56- RawPixel _left_size; // size of the segment from point 10 to 11, used when launcher at bottom.
57+ int _left_size; // size of the segment from point 10 to 11, used when launcher at bottom.
58 RawPixel _padding;
59
60 nux::HLayout* _hlayout;
61@@ -94,4 +94,3 @@
62 }
63
64 #endif // TOOLTIP_H
65-