Merge lp:~3v1n0/unity/icons-emblem-scaling into lp:unity
- icons-emblem-scaling
- Merge into trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Christopher Townsend | ||||||||
Approved revision: | no longer in the source branch. | ||||||||
Merged at revision: | 3861 | ||||||||
Proposed branch: | lp:~3v1n0/unity/icons-emblem-scaling | ||||||||
Merge into: | lp:unity | ||||||||
Diff against target: |
669 lines (+202/-141) 13 files modified
hud/HudIconTextureSource.cpp (+0/-5) hud/HudIconTextureSource.h (+0/-1) launcher/Launcher.cpp (+1/-1) launcher/LauncherIcon.cpp (+114/-103) launcher/LauncherIcon.h (+12/-8) launcher/MockLauncherIcon.h (+0/-5) launcher/SwitcherView.cpp (+2/-0) panel/PanelIndicatorEntryView.cpp (+1/-1) unity-shared/DecorationStyle.cpp (+2/-2) unity-shared/IconRenderer.cpp (+35/-9) unity-shared/IconTextureSource.cpp (+26/-0) unity-shared/IconTextureSource.h (+7/-3) unity-shared/TextInput.cpp (+2/-3) |
||||||||
To merge this branch: | bzr merge lp:~3v1n0/unity/icons-emblem-scaling | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Christopher Townsend | Approve | ||
Review via email: mp+229937@code.launchpad.net |
Commit message
IconRenderer: draw count texture at proper scaling, built by LauncherIcon
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3853
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Christopher Townsend (townsend) wrote : | # |
Looks pretty good. Just to note as discussed, when scaling down < 1, the text can become hard to read depending on the scaling factor, but there is not much that can be done to make it better.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3855
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3855
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3855
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3855
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:3855
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'hud/HudIconTextureSource.cpp' | |||
2 | --- hud/HudIconTextureSource.cpp 2012-10-29 09:34:54 +0000 | |||
3 | +++ hud/HudIconTextureSource.cpp 2014-08-08 15:13:47 +0000 | |||
4 | @@ -109,11 +109,6 @@ | |||
5 | 109 | return nux::Color(0.0f, 0.0f, 0.0f, 0.0f); | 109 | return nux::Color(0.0f, 0.0f, 0.0f, 0.0f); |
6 | 110 | } | 110 | } |
7 | 111 | 111 | ||
8 | 112 | nux::BaseTexture* HudIconTextureSource::Emblem() | ||
9 | 113 | { | ||
10 | 114 | return nullptr; | ||
11 | 115 | } | ||
12 | 116 | |||
13 | 117 | } | 112 | } |
14 | 118 | } | 113 | } |
15 | 119 | 114 | ||
16 | 120 | 115 | ||
17 | === modified file 'hud/HudIconTextureSource.h' | |||
18 | --- hud/HudIconTextureSource.h 2013-11-06 11:21:43 +0000 | |||
19 | +++ hud/HudIconTextureSource.h 2014-08-08 15:13:47 +0000 | |||
20 | @@ -37,7 +37,6 @@ | |||
21 | 37 | virtual nux::Color BackgroundColor() const; | 37 | virtual nux::Color BackgroundColor() const; |
22 | 38 | virtual nux::BaseTexture* TextureForSize(int size); | 38 | virtual nux::BaseTexture* TextureForSize(int size); |
23 | 39 | virtual nux::Color GlowColor(); | 39 | virtual nux::Color GlowColor(); |
24 | 40 | virtual nux::BaseTexture* Emblem(); | ||
25 | 41 | void ColorForIcon(GdkPixbuf* pixbuf); | 40 | void ColorForIcon(GdkPixbuf* pixbuf); |
26 | 42 | 41 | ||
27 | 43 | private: | 42 | private: |
28 | 44 | 43 | ||
29 | === modified file 'launcher/Launcher.cpp' | |||
30 | --- launcher/Launcher.cpp 2014-07-17 18:33:37 +0000 | |||
31 | +++ launcher/Launcher.cpp 2014-08-08 15:13:47 +0000 | |||
32 | @@ -1219,6 +1219,7 @@ | |||
33 | 1219 | Resize(nux::Point(monitor_geo.x, monitor_geo.y + panel_height), monitor_geo.height - panel_height); | 1219 | Resize(nux::Point(monitor_geo.x, monitor_geo.y + panel_height), monitor_geo.height - panel_height); |
34 | 1220 | 1220 | ||
35 | 1221 | icon_renderer_->monitor = new_monitor; | 1221 | icon_renderer_->monitor = new_monitor; |
36 | 1222 | icon_renderer_->scale = cv_->DPIScale(); | ||
37 | 1222 | SetIconSize(options()->tile_size, options()->icon_size); | 1223 | SetIconSize(options()->tile_size, options()->icon_size); |
38 | 1223 | } | 1224 | } |
39 | 1224 | 1225 | ||
40 | @@ -1519,7 +1520,6 @@ | |||
41 | 1519 | ui::IconRenderer::DestroyShortcutTextures(); | 1520 | ui::IconRenderer::DestroyShortcutTextures(); |
42 | 1520 | 1521 | ||
43 | 1521 | icon_size_ = tile_size; | 1522 | icon_size_ = tile_size; |
44 | 1522 | icon_renderer_->scale = cv_->DPIScale(); | ||
45 | 1523 | icon_renderer_->SetTargetSize(icon_size_.CP(cv_), RawPixel(icon_size).CP(cv_), SPACE_BETWEEN_ICONS.CP(cv_)); | 1523 | icon_renderer_->SetTargetSize(icon_size_.CP(cv_), RawPixel(icon_size).CP(cv_), SPACE_BETWEEN_ICONS.CP(cv_)); |
46 | 1524 | AbstractLauncherIcon::icon_size = icon_size_; | 1524 | AbstractLauncherIcon::icon_size = icon_size_; |
47 | 1525 | 1525 | ||
48 | 1526 | 1526 | ||
49 | === modified file 'launcher/LauncherIcon.cpp' | |||
50 | --- launcher/LauncherIcon.cpp 2014-05-28 12:14:44 +0000 | |||
51 | +++ launcher/LauncherIcon.cpp 2014-08-08 15:13:47 +0000 | |||
52 | @@ -59,6 +59,11 @@ | |||
53 | 59 | const std::string CENTER_STABILIZE_TIMEOUT = "center-stabilize-timeout"; | 59 | const std::string CENTER_STABILIZE_TIMEOUT = "center-stabilize-timeout"; |
54 | 60 | const std::string PRESENT_TIMEOUT = "present-timeout"; | 60 | const std::string PRESENT_TIMEOUT = "present-timeout"; |
55 | 61 | const std::string QUIRK_DELAY_TIMEOUT = "quirk-delay-timeout"; | 61 | const std::string QUIRK_DELAY_TIMEOUT = "quirk-delay-timeout"; |
56 | 62 | |||
57 | 63 | const int COUNT_WIDTH = 32; | ||
58 | 64 | const int COUNT_HEIGHT = 16; | ||
59 | 65 | const int COUNT_FONT_WIDTH = COUNT_WIDTH - 4; | ||
60 | 66 | const int COUNT_FONT_HEIGHT = COUNT_HEIGHT - 5; | ||
61 | 62 | } | 67 | } |
62 | 63 | 68 | ||
63 | 64 | NUX_IMPLEMENT_OBJECT_TYPE(LauncherIcon); | 69 | NUX_IMPLEMENT_OBJECT_TYPE(LauncherIcon); |
64 | @@ -69,7 +74,6 @@ | |||
65 | 69 | LauncherIcon::LauncherIcon(IconType type) | 74 | LauncherIcon::LauncherIcon(IconType type) |
66 | 70 | : _icon_type(type) | 75 | : _icon_type(type) |
67 | 71 | , _sticky(false) | 76 | , _sticky(false) |
68 | 72 | , _remote_urgent(false) | ||
69 | 73 | , _present_urgency(0) | 77 | , _present_urgency(0) |
70 | 74 | , _progress(0.0f) | 78 | , _progress(0.0f) |
71 | 75 | , _sort_priority(DefaultPriority(type)) | 79 | , _sort_priority(DefaultPriority(type)) |
72 | @@ -99,6 +103,8 @@ | |||
73 | 99 | mouse_down.connect(sigc::mem_fun(this, &LauncherIcon::RecvMouseDown)); | 103 | mouse_down.connect(sigc::mem_fun(this, &LauncherIcon::RecvMouseDown)); |
74 | 100 | mouse_up.connect(sigc::mem_fun(this, &LauncherIcon::RecvMouseUp)); | 104 | mouse_up.connect(sigc::mem_fun(this, &LauncherIcon::RecvMouseUp)); |
75 | 101 | mouse_click.connect(sigc::mem_fun(this, &LauncherIcon::RecvMouseClick)); | 105 | mouse_click.connect(sigc::mem_fun(this, &LauncherIcon::RecvMouseClick)); |
76 | 106 | Settings::Instance().dpi_changed.connect(sigc::mem_fun(this, &LauncherIcon::CleanCountTextures)); | ||
77 | 107 | icon_size.changed.connect(sigc::hide(sigc::mem_fun(this, &LauncherIcon::CleanCountTextures))); | ||
78 | 102 | 108 | ||
79 | 103 | for (unsigned i = 0; i < monitors::MAX; ++i) | 109 | for (unsigned i = 0; i < monitors::MAX; ++i) |
80 | 104 | { | 110 | { |
81 | @@ -966,14 +972,42 @@ | |||
82 | 966 | return result; | 972 | return result; |
83 | 967 | } | 973 | } |
84 | 968 | 974 | ||
87 | 969 | nux::BaseTexture* | 975 | nux::BaseTexture* LauncherIcon::Emblem() const |
86 | 970 | LauncherIcon::Emblem() | ||
88 | 971 | { | 976 | { |
89 | 972 | return _emblem.GetPointer(); | 977 | return _emblem.GetPointer(); |
90 | 973 | } | 978 | } |
91 | 974 | 979 | ||
94 | 975 | void | 980 | nux::BaseTexture* LauncherIcon::CountTexture(double scale) |
95 | 976 | LauncherIcon::SetEmblem(LauncherIcon::BaseTexturePtr const& emblem) | 981 | { |
96 | 982 | int count = Count(); | ||
97 | 983 | |||
98 | 984 | if (!count) | ||
99 | 985 | return nullptr; | ||
100 | 986 | |||
101 | 987 | auto it = _counts.find(scale); | ||
102 | 988 | |||
103 | 989 | if (it != _counts.end()) | ||
104 | 990 | return it->second.GetPointer(); | ||
105 | 991 | |||
106 | 992 | auto const& texture = DrawCountTexture(count, scale); | ||
107 | 993 | _counts[scale] = texture; | ||
108 | 994 | return texture.GetPointer(); | ||
109 | 995 | } | ||
110 | 996 | |||
111 | 997 | unsigned LauncherIcon::Count() const | ||
112 | 998 | { | ||
113 | 999 | if (!_remote_entries.empty()) | ||
114 | 1000 | { | ||
115 | 1001 | auto const& remote = _remote_entries.front(); | ||
116 | 1002 | |||
117 | 1003 | if (remote->CountVisible()) | ||
118 | 1004 | return remote->Count(); | ||
119 | 1005 | } | ||
120 | 1006 | |||
121 | 1007 | return 0; | ||
122 | 1008 | } | ||
123 | 1009 | |||
124 | 1010 | void LauncherIcon::SetEmblem(LauncherIcon::BaseTexturePtr const& emblem) | ||
125 | 977 | { | 1011 | { |
126 | 978 | _emblem = emblem; | 1012 | _emblem = emblem; |
127 | 979 | EmitNeedsRedraw(); | 1013 | EmitNeedsRedraw(); |
128 | @@ -994,60 +1028,44 @@ | |||
129 | 994 | emblem->UnReference(); | 1028 | emblem->UnReference(); |
130 | 995 | } | 1029 | } |
131 | 996 | 1030 | ||
167 | 997 | void | 1031 | void LauncherIcon::CleanCountTextures() |
168 | 998 | LauncherIcon::SetEmblemText(std::string const& text) | 1032 | { |
169 | 999 | { | 1033 | _counts.clear(); |
170 | 1000 | PangoLayout* layout = NULL; | 1034 | } |
171 | 1001 | 1035 | ||
172 | 1002 | PangoContext* pangoCtx = NULL; | 1036 | BaseTexturePtr LauncherIcon::DrawCountTexture(unsigned count, double scale) |
173 | 1003 | PangoFontDescription* desc = NULL; | 1037 | { |
174 | 1004 | GdkScreen* screen = gdk_screen_get_default(); // not ref'ed | 1038 | auto const& count_text = (count / 10000 != 0) ? "****" : std::to_string(count); |
175 | 1005 | GtkSettings* settings = gtk_settings_get_default(); // not ref'ed | 1039 | |
176 | 1006 | gchar* fontName = NULL; | 1040 | glib::Object<PangoContext> pango_ctx(gdk_pango_context_get()); |
177 | 1007 | 1041 | glib::Object<PangoLayout> layout(pango_layout_new(pango_ctx)); | |
178 | 1008 | int width = 32; | 1042 | |
179 | 1009 | int height = 8 * 2; | 1043 | glib::String font_name; |
180 | 1010 | int font_height = height - 5; | 1044 | g_object_get(gtk_settings_get_default(), "gtk-font-name", &font_name, nullptr); |
181 | 1011 | 1045 | std::shared_ptr<PangoFontDescription> desc(pango_font_description_from_string(font_name), pango_font_description_free); | |
182 | 1012 | 1046 | pango_font_description_set_absolute_size(desc.get(), pango_units_from_double(COUNT_FONT_HEIGHT)); | |
183 | 1013 | nux::CairoGraphics cg(CAIRO_FORMAT_ARGB32, width, height); | 1047 | pango_layout_set_font_description(layout, desc.get()); |
184 | 1014 | cairo_t* cr = cg.GetInternalContext(); | 1048 | |
185 | 1015 | 1049 | pango_layout_set_width(layout, pango_units_from_double(COUNT_FONT_WIDTH)); | |
151 | 1016 | cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR); | ||
152 | 1017 | cairo_paint(cr); | ||
153 | 1018 | |||
154 | 1019 | cairo_set_operator(cr, CAIRO_OPERATOR_OVER); | ||
155 | 1020 | |||
156 | 1021 | |||
157 | 1022 | layout = pango_cairo_create_layout(cr); | ||
158 | 1023 | |||
159 | 1024 | g_object_get(settings, "gtk-font-name", &fontName, NULL); | ||
160 | 1025 | desc = pango_font_description_from_string(fontName); | ||
161 | 1026 | pango_font_description_set_absolute_size(desc, pango_units_from_double(font_height)); | ||
162 | 1027 | |||
163 | 1028 | pango_layout_set_font_description(layout, desc); | ||
164 | 1029 | pango_font_description_free(desc); | ||
165 | 1030 | |||
166 | 1031 | pango_layout_set_width(layout, pango_units_from_double(width - 4.0f)); | ||
186 | 1032 | pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); | 1050 | pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); |
187 | 1033 | pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE); | 1051 | pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE); |
196 | 1034 | pango_layout_set_markup_with_accel(layout, text.c_str(), -1, '_', NULL); | 1052 | pango_layout_set_markup_with_accel(layout, count_text.c_str(), -1, '_', nullptr); |
197 | 1035 | 1053 | ||
198 | 1036 | pangoCtx = pango_layout_get_context(layout); // is not ref'ed | 1054 | PangoRectangle ink_rect; |
199 | 1037 | pango_cairo_context_set_font_options(pangoCtx, | 1055 | pango_layout_get_pixel_extents(layout, &ink_rect, nullptr); |
192 | 1038 | gdk_screen_get_font_options(screen)); | ||
193 | 1039 | |||
194 | 1040 | PangoRectangle logical_rect, ink_rect; | ||
195 | 1041 | pango_layout_get_extents(layout, &logical_rect, &ink_rect); | ||
200 | 1042 | 1056 | ||
201 | 1043 | /* DRAW OUTLINE */ | 1057 | /* DRAW OUTLINE */ |
203 | 1044 | float radius = height / 2.0f - 1.0f; | 1058 | float radius = COUNT_HEIGHT / 2.0f - 1.0f; |
204 | 1045 | float inset = radius + 1.0f; | 1059 | float inset = radius + 1.0f; |
205 | 1046 | 1060 | ||
207 | 1047 | cairo_move_to(cr, inset, height - 1.0f); | 1061 | nux::CairoGraphics cg(CAIRO_FORMAT_ARGB32, std::round(COUNT_WIDTH * scale), std::round(COUNT_HEIGHT * scale)); |
208 | 1062 | cairo_surface_set_device_scale(cg.GetSurface(), scale, scale); | ||
209 | 1063 | cairo_t* cr = cg.GetInternalContext(); | ||
210 | 1064 | |||
211 | 1065 | cairo_move_to(cr, inset, COUNT_HEIGHT - 1.0f); | ||
212 | 1048 | cairo_arc(cr, inset, inset, radius, 0.5 * M_PI, 1.5 * M_PI); | 1066 | cairo_arc(cr, inset, inset, radius, 0.5 * M_PI, 1.5 * M_PI); |
215 | 1049 | cairo_arc(cr, width - inset, inset, radius, 1.5 * M_PI, 0.5 * M_PI); | 1067 | cairo_arc(cr, COUNT_WIDTH - inset, inset, radius, 1.5 * M_PI, 0.5 * M_PI); |
216 | 1050 | cairo_line_to(cr, inset, height - 1.0f); | 1068 | cairo_line_to(cr, inset, COUNT_HEIGHT - 1.0f); |
217 | 1051 | 1069 | ||
218 | 1052 | cairo_set_source_rgba(cr, 0.35f, 0.35f, 0.35f, 1.0f); | 1070 | cairo_set_source_rgba(cr, 0.35f, 0.35f, 0.35f, 1.0f); |
219 | 1053 | cairo_fill_preserve(cr); | 1071 | cairo_fill_preserve(cr); |
220 | @@ -1059,16 +1077,11 @@ | |||
221 | 1059 | cairo_set_line_width(cr, 1.0f); | 1077 | cairo_set_line_width(cr, 1.0f); |
222 | 1060 | 1078 | ||
223 | 1061 | /* DRAW TEXT */ | 1079 | /* DRAW TEXT */ |
227 | 1062 | cairo_move_to(cr, | 1080 | cairo_move_to(cr, (COUNT_WIDTH - ink_rect.width) / 2.0 - ink_rect.x, |
228 | 1063 | (int)((width - pango_units_to_double(logical_rect.width)) / 2.0f), | 1081 | (COUNT_HEIGHT - ink_rect.height) / 2.0 - ink_rect.y); |
226 | 1064 | (int)((height - pango_units_to_double(logical_rect.height)) / 2.0f - pango_units_to_double(logical_rect.y))); | ||
229 | 1065 | pango_cairo_show_layout(cr, layout); | 1082 | pango_cairo_show_layout(cr, layout); |
230 | 1066 | 1083 | ||
236 | 1067 | SetEmblem(texture_ptr_from_cairo_graphics(cg)); | 1084 | return texture_ptr_from_cairo_graphics(cg); |
232 | 1068 | |||
233 | 1069 | // clean up | ||
234 | 1070 | g_object_unref(layout); | ||
235 | 1071 | g_free(fontName); | ||
237 | 1072 | } | 1085 | } |
238 | 1073 | 1086 | ||
239 | 1074 | void | 1087 | void |
240 | @@ -1077,26 +1090,34 @@ | |||
241 | 1077 | SetEmblem(BaseTexturePtr()); | 1090 | SetEmblem(BaseTexturePtr()); |
242 | 1078 | } | 1091 | } |
243 | 1079 | 1092 | ||
246 | 1080 | void | 1093 | void LauncherIcon::InsertEntryRemote(LauncherEntryRemote::Ptr const& remote) |
245 | 1081 | LauncherIcon::InsertEntryRemote(LauncherEntryRemote::Ptr const& remote) | ||
247 | 1082 | { | 1094 | { |
249 | 1083 | if (std::find(_entry_list.begin(), _entry_list.end(), remote) != _entry_list.end()) | 1095 | if (!remote || std::find(_remote_entries.begin(), _remote_entries.end(), remote) != _remote_entries.end()) |
250 | 1084 | return; | 1096 | return; |
251 | 1085 | 1097 | ||
253 | 1086 | _entry_list.push_front(remote); | 1098 | _remote_entries.push_back(remote); |
254 | 1087 | AddChild(remote.get()); | 1099 | AddChild(remote.get()); |
267 | 1088 | 1100 | SelectEntryRemote(remote); | |
268 | 1089 | remote->emblem_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteEmblemChanged)); | 1101 | } |
269 | 1090 | remote->count_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteCountChanged)); | 1102 | |
270 | 1091 | remote->progress_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteProgressChanged)); | 1103 | void LauncherIcon::SelectEntryRemote(LauncherEntryRemote::Ptr const& remote) |
271 | 1092 | remote->quicklist_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteQuicklistChanged)); | 1104 | { |
272 | 1093 | 1105 | if (!remote) | |
273 | 1094 | remote->emblem_visible_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteEmblemVisibleChanged)); | 1106 | return; |
274 | 1095 | remote->count_visible_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteCountVisibleChanged)); | 1107 | |
275 | 1096 | remote->progress_visible_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteProgressVisibleChanged)); | 1108 | auto& cm = _remote_connections; |
276 | 1097 | 1109 | cm.Clear(); | |
277 | 1098 | remote->urgent_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteUrgentChanged)); | 1110 | |
278 | 1099 | 1111 | cm.Add(remote->emblem_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteEmblemChanged))); | |
279 | 1112 | cm.Add(remote->count_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteCountChanged))); | ||
280 | 1113 | cm.Add(remote->progress_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteProgressChanged))); | ||
281 | 1114 | cm.Add(remote->quicklist_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteQuicklistChanged))); | ||
282 | 1115 | |||
283 | 1116 | cm.Add(remote->emblem_visible_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteEmblemVisibleChanged))); | ||
284 | 1117 | cm.Add(remote->count_visible_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteCountVisibleChanged))); | ||
285 | 1118 | cm.Add(remote->progress_visible_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteProgressVisibleChanged))); | ||
286 | 1119 | |||
287 | 1120 | cm.Add(remote->urgent_changed.connect(sigc::mem_fun(this, &LauncherIcon::OnRemoteUrgentChanged))); | ||
288 | 1100 | 1121 | ||
289 | 1101 | if (remote->EmblemVisible()) | 1122 | if (remote->EmblemVisible()) |
290 | 1102 | OnRemoteEmblemVisibleChanged(remote.get()); | 1123 | OnRemoteEmblemVisibleChanged(remote.get()); |
291 | @@ -1113,28 +1134,30 @@ | |||
292 | 1113 | OnRemoteQuicklistChanged(remote.get()); | 1134 | OnRemoteQuicklistChanged(remote.get()); |
293 | 1114 | } | 1135 | } |
294 | 1115 | 1136 | ||
297 | 1116 | void | 1137 | void LauncherIcon::RemoveEntryRemote(LauncherEntryRemote::Ptr const& remote) |
296 | 1117 | LauncherIcon::RemoveEntryRemote(LauncherEntryRemote::Ptr const& remote) | ||
298 | 1118 | { | 1138 | { |
300 | 1119 | if (std::find(_entry_list.begin(), _entry_list.end(), remote) == _entry_list.end()) | 1139 | auto remote_it = std::find(_remote_entries.begin(), _remote_entries.end(), remote); |
301 | 1140 | |||
302 | 1141 | if (remote_it == _remote_entries.end()) | ||
303 | 1120 | return; | 1142 | return; |
304 | 1121 | 1143 | ||
306 | 1122 | _entry_list.remove(remote); | 1144 | SetQuirk(Quirk::PROGRESS, false); |
307 | 1145 | |||
308 | 1146 | if (remote->Urgent()) | ||
309 | 1147 | SetQuirk(Quirk::URGENT, false); | ||
310 | 1148 | |||
311 | 1149 | _remote_entries.erase(remote_it); | ||
312 | 1123 | RemoveChild(remote.get()); | 1150 | RemoveChild(remote.get()); |
313 | 1124 | |||
314 | 1125 | DeleteEmblem(); | 1151 | DeleteEmblem(); |
315 | 1126 | SetQuirk(Quirk::PROGRESS, false); | ||
316 | 1127 | |||
317 | 1128 | if (_remote_urgent) | ||
318 | 1129 | SetQuirk(Quirk::URGENT, false); | ||
319 | 1130 | |||
320 | 1131 | _remote_menus = nullptr; | 1152 | _remote_menus = nullptr; |
321 | 1153 | |||
322 | 1154 | if (!_remote_entries.empty()) | ||
323 | 1155 | SelectEntryRemote(_remote_entries.back()); | ||
324 | 1132 | } | 1156 | } |
325 | 1133 | 1157 | ||
326 | 1134 | void | 1158 | void |
327 | 1135 | LauncherIcon::OnRemoteUrgentChanged(LauncherEntryRemote* remote) | 1159 | LauncherIcon::OnRemoteUrgentChanged(LauncherEntryRemote* remote) |
328 | 1136 | { | 1160 | { |
329 | 1137 | _remote_urgent = remote->Urgent(); | ||
330 | 1138 | SetQuirk(Quirk::URGENT, remote->Urgent()); | 1161 | SetQuirk(Quirk::URGENT, remote->Urgent()); |
331 | 1139 | } | 1162 | } |
332 | 1140 | 1163 | ||
333 | @@ -1153,14 +1176,8 @@ | |||
334 | 1153 | if (!remote->CountVisible()) | 1176 | if (!remote->CountVisible()) |
335 | 1154 | return; | 1177 | return; |
336 | 1155 | 1178 | ||
345 | 1156 | if (remote->Count() / 10000 != 0) | 1179 | CleanCountTextures(); |
346 | 1157 | { | 1180 | EmitNeedsRedraw(); |
339 | 1158 | SetEmblemText("****"); | ||
340 | 1159 | } | ||
341 | 1160 | else | ||
342 | 1161 | { | ||
343 | 1162 | SetEmblemText(std::to_string(remote->Count())); | ||
344 | 1163 | } | ||
347 | 1164 | } | 1181 | } |
348 | 1165 | 1182 | ||
349 | 1166 | void | 1183 | void |
350 | @@ -1190,14 +1207,8 @@ | |||
351 | 1190 | void | 1207 | void |
352 | 1191 | LauncherIcon::OnRemoteCountVisibleChanged(LauncherEntryRemote* remote) | 1208 | LauncherIcon::OnRemoteCountVisibleChanged(LauncherEntryRemote* remote) |
353 | 1192 | { | 1209 | { |
362 | 1193 | if (remote->CountVisible()) | 1210 | CleanCountTextures(); |
363 | 1194 | { | 1211 | EmitNeedsRedraw(); |
356 | 1195 | SetEmblemText(std::to_string(remote->Count())); | ||
357 | 1196 | } | ||
358 | 1197 | else | ||
359 | 1198 | { | ||
360 | 1199 | DeleteEmblem(); | ||
361 | 1200 | } | ||
364 | 1201 | } | 1212 | } |
365 | 1202 | 1213 | ||
366 | 1203 | void | 1214 | void |
367 | 1204 | 1215 | ||
368 | === modified file 'launcher/LauncherIcon.h' | |||
369 | --- launcher/LauncherIcon.h 2014-05-28 09:56:00 +0000 | |||
370 | +++ launcher/LauncherIcon.h 2014-08-08 15:13:47 +0000 | |||
371 | @@ -154,14 +154,15 @@ | |||
372 | 154 | } | 154 | } |
373 | 155 | 155 | ||
374 | 156 | nux::BaseTexture* TextureForSize(int size); | 156 | nux::BaseTexture* TextureForSize(int size); |
377 | 157 | 157 | nux::BaseTexture* Emblem() const override; | |
378 | 158 | nux::BaseTexture* Emblem(); | 158 | nux::BaseTexture* CountTexture(double scale) override; |
379 | 159 | 159 | ||
380 | 160 | MenuItemsVector Menus(); | 160 | MenuItemsVector Menus(); |
385 | 161 | 161 | unsigned Count() const; | |
386 | 162 | void InsertEntryRemote(LauncherEntryRemote::Ptr const& remote); | 162 | |
387 | 163 | 163 | void InsertEntryRemote(LauncherEntryRemote::Ptr const&); | |
388 | 164 | void RemoveEntryRemote(LauncherEntryRemote::Ptr const& remote); | 164 | void SelectEntryRemote(LauncherEntryRemote::Ptr const&); |
389 | 165 | void RemoveEntryRemote(LauncherEntryRemote::Ptr const&); | ||
390 | 165 | 166 | ||
391 | 166 | nux::DndAction QueryAcceptDrop(DndData const& dnd_data) | 167 | nux::DndAction QueryAcceptDrop(DndData const& dnd_data) |
392 | 167 | { | 168 | { |
393 | @@ -323,9 +324,10 @@ | |||
394 | 323 | void LoadQuicklist(); | 324 | void LoadQuicklist(); |
395 | 324 | 325 | ||
396 | 325 | void OnTooltipEnabledChanged(bool value); | 326 | void OnTooltipEnabledChanged(bool value); |
397 | 327 | void CleanCountTextures(); | ||
398 | 328 | BaseTexturePtr DrawCountTexture(unsigned count, double scale); | ||
399 | 326 | 329 | ||
400 | 327 | bool _sticky; | 330 | bool _sticky; |
401 | 328 | bool _remote_urgent; | ||
402 | 329 | float _present_urgency; | 331 | float _present_urgency; |
403 | 330 | float _progress; | 332 | float _progress; |
404 | 331 | int _sort_priority; | 333 | int _sort_priority; |
405 | @@ -346,8 +348,10 @@ | |||
406 | 346 | time::Spec _last_action; | 348 | time::Spec _last_action; |
407 | 347 | 349 | ||
408 | 348 | BaseTexturePtr _emblem; | 350 | BaseTexturePtr _emblem; |
409 | 351 | std::unordered_map<double, BaseTexturePtr> _counts; | ||
410 | 349 | 352 | ||
412 | 350 | std::list<LauncherEntryRemote::Ptr> _entry_list; | 353 | std::vector<LauncherEntryRemote::Ptr> _remote_entries; |
413 | 354 | connection::Manager _remote_connections; | ||
414 | 351 | glib::Object<DbusmenuClient> _remote_menus; | 355 | glib::Object<DbusmenuClient> _remote_menus; |
415 | 352 | 356 | ||
416 | 353 | static glib::Object<GtkIconTheme> _unity_theme; | 357 | static glib::Object<GtkIconTheme> _unity_theme; |
417 | 354 | 358 | ||
418 | === modified file 'launcher/MockLauncherIcon.h' | |||
419 | --- launcher/MockLauncherIcon.h 2013-12-11 15:03:25 +0000 | |||
420 | +++ launcher/MockLauncherIcon.h 2014-08-08 15:13:47 +0000 | |||
421 | @@ -329,11 +329,6 @@ | |||
422 | 329 | return icon_; | 329 | return icon_; |
423 | 330 | } | 330 | } |
424 | 331 | 331 | ||
425 | 332 | nux::BaseTexture* Emblem() | ||
426 | 333 | { | ||
427 | 334 | return 0; | ||
428 | 335 | } | ||
429 | 336 | |||
430 | 337 | MenuItemsVector Menus() | 332 | MenuItemsVector Menus() |
431 | 338 | { | 333 | { |
432 | 339 | return MenuItemsVector (); | 334 | return MenuItemsVector (); |
433 | 340 | 335 | ||
434 | === modified file 'launcher/SwitcherView.cpp' | |||
435 | --- launcher/SwitcherView.cpp 2014-07-15 16:28:45 +0000 | |||
436 | +++ launcher/SwitcherView.cpp 2014-08-08 15:13:47 +0000 | |||
437 | @@ -76,6 +76,7 @@ | |||
438 | 76 | icon_renderer_->pip_style = OVER_TILE; | 76 | icon_renderer_->pip_style = OVER_TILE; |
439 | 77 | icon_renderer_->monitor = monitors::MAX; | 77 | icon_renderer_->monitor = monitors::MAX; |
440 | 78 | icon_renderer_->SetTargetSize(tile_size, icon_size, minimum_spacing); | 78 | icon_renderer_->SetTargetSize(tile_size, icon_size, minimum_spacing); |
441 | 79 | icon_renderer_->scale = scale(); | ||
442 | 79 | 80 | ||
443 | 80 | text_view_->SetMaximumWidth(tile_size * TEXT_TILE_MULTIPLIER); | 81 | text_view_->SetMaximumWidth(tile_size * TEXT_TILE_MULTIPLIER); |
444 | 81 | text_view_->SetLines(1); | 82 | text_view_->SetLines(1); |
445 | @@ -196,6 +197,7 @@ | |||
446 | 196 | tile_size = TILE_SIZE.CP(scale); | 197 | tile_size = TILE_SIZE.CP(scale); |
447 | 197 | text_size = TEXT_SIZE.CP(scale); | 198 | text_size = TEXT_SIZE.CP(scale); |
448 | 198 | vertical_size = tile_size + VERTICAL_PADDING.CP(scale) * 2; | 199 | vertical_size = tile_size + VERTICAL_PADDING.CP(scale) * 2; |
449 | 200 | icon_renderer_->scale = scale; | ||
450 | 199 | } | 201 | } |
451 | 200 | 202 | ||
452 | 201 | void SwitcherView::StartAnimation() | 203 | void SwitcherView::StartAnimation() |
453 | 202 | 204 | ||
454 | === modified file 'panel/PanelIndicatorEntryView.cpp' | |||
455 | --- panel/PanelIndicatorEntryView.cpp 2014-05-30 07:20:13 +0000 | |||
456 | +++ panel/PanelIndicatorEntryView.cpp 2014-08-08 15:13:47 +0000 | |||
457 | @@ -426,7 +426,7 @@ | |||
458 | 426 | } | 426 | } |
459 | 427 | } | 427 | } |
460 | 428 | 428 | ||
462 | 429 | glib::Object<PangoContext> context(gdk_pango_context_get_for_screen(gdk_screen_get_default())); | 429 | glib::Object<PangoContext> context(gdk_pango_context_get()); |
463 | 430 | std::shared_ptr<PangoFontDescription> desc(pango_font_description_from_string(font.c_str()), pango_font_description_free); | 430 | std::shared_ptr<PangoFontDescription> desc(pango_font_description_from_string(font.c_str()), pango_font_description_free); |
464 | 431 | pango_context_set_font_description(context, desc.get()); | 431 | pango_context_set_font_description(context, desc.get()); |
465 | 432 | pango_context_set_language(context, gtk_get_default_language()); | 432 | pango_context_set_language(context, gtk_get_default_language()); |
466 | 433 | 433 | ||
467 | === modified file 'unity-shared/DecorationStyle.cpp' | |||
468 | --- unity-shared/DecorationStyle.cpp 2014-06-13 15:22:15 +0000 | |||
469 | +++ unity-shared/DecorationStyle.cpp 2014-08-08 15:13:47 +0000 | |||
470 | @@ -147,8 +147,8 @@ | |||
471 | 147 | , ctx_(gtk_style_context_new()) | 147 | , ctx_(gtk_style_context_new()) |
472 | 148 | , settings_(g_settings_new(SETTINGS_NAME.c_str())) | 148 | , settings_(g_settings_new(SETTINGS_NAME.c_str())) |
473 | 149 | , usettings_(g_settings_new(UNITY_SETTINGS_NAME.c_str())) | 149 | , usettings_(g_settings_new(UNITY_SETTINGS_NAME.c_str())) |
476 | 150 | , title_pango_ctx_(gdk_pango_context_get_for_screen(gdk_screen_get_default())) | 150 | , title_pango_ctx_(gdk_pango_context_get()) |
477 | 151 | , menu_item_pango_ctx_(gdk_pango_context_get_for_screen(gdk_screen_get_default())) | 151 | , menu_item_pango_ctx_(gdk_pango_context_get()) |
478 | 152 | , title_alignment_(0) | 152 | , title_alignment_(0) |
479 | 153 | , title_indent_(0) | 153 | , title_indent_(0) |
480 | 154 | , title_fade_(0) | 154 | , title_fade_(0) |
481 | 155 | 155 | ||
482 | === modified file 'unity-shared/IconRenderer.cpp' | |||
483 | --- unity-shared/IconRenderer.cpp 2014-05-08 18:52:16 +0000 | |||
484 | +++ unity-shared/IconRenderer.cpp 2014-08-08 15:13:47 +0000 | |||
485 | @@ -199,6 +199,8 @@ | |||
486 | 199 | const std::array<int, IconSize::SIZE> TILE_SIZES = { 54, 150 }; | 199 | const std::array<int, IconSize::SIZE> TILE_SIZES = { 54, 150 }; |
487 | 200 | const std::array<int, IconSize::SIZE> GLOW_SIZES = { 62, 200 }; | 200 | const std::array<int, IconSize::SIZE> GLOW_SIZES = { 62, 200 }; |
488 | 201 | const std::array<int, IconSize::SIZE> MARKER_SIZES = { 19, 37 }; | 201 | const std::array<int, IconSize::SIZE> MARKER_SIZES = { 19, 37 }; |
489 | 202 | |||
490 | 203 | constexpr double count_scaling(double icon_size, bool switcher) { return icon_size / (TILE_SIZES[local::IconSize::SMALL] * (switcher ? 2.0 : 1.0)); } | ||
491 | 202 | } // anonymous namespace | 204 | } // anonymous namespace |
492 | 203 | } // local namespace | 205 | } // local namespace |
493 | 204 | 206 | ||
494 | @@ -352,6 +354,7 @@ | |||
495 | 352 | GetInverseScreenPerspectiveMatrix(ViewMatrix, ProjectionMatrix, geo.width, geo.height, 0.1f, 1000.0f, DEGTORAD(90)); | 354 | GetInverseScreenPerspectiveMatrix(ViewMatrix, ProjectionMatrix, geo.width, geo.height, 0.1f, 1000.0f, DEGTORAD(90)); |
496 | 353 | 355 | ||
497 | 354 | nux::Matrix4 const& PremultMatrix = ProjectionMatrix * ViewMatrix; | 356 | nux::Matrix4 const& PremultMatrix = ProjectionMatrix * ViewMatrix; |
498 | 357 | int monitor = this->monitor(); | ||
499 | 355 | 358 | ||
500 | 356 | std::list<RenderArg>::iterator it; | 359 | std::list<RenderArg>::iterator it; |
501 | 357 | int i; | 360 | int i; |
502 | @@ -363,6 +366,7 @@ | |||
503 | 363 | it->logical_center == launcher_icon->LastLogicalCenter(monitor) && | 366 | it->logical_center == launcher_icon->LastLogicalCenter(monitor) && |
504 | 364 | it->rotation == launcher_icon->LastRotation(monitor) && | 367 | it->rotation == launcher_icon->LastRotation(monitor) && |
505 | 365 | it->skip == launcher_icon->WasSkipping(monitor) && | 368 | it->skip == launcher_icon->WasSkipping(monitor) && |
506 | 369 | (launcher_icon->Count() != 0) == launcher_icon->HadCount(monitor) && | ||
507 | 366 | (launcher_icon->Emblem() != nullptr) == launcher_icon->HadEmblem(monitor)) | 370 | (launcher_icon->Emblem() != nullptr) == launcher_icon->HadEmblem(monitor)) |
508 | 367 | { | 371 | { |
509 | 368 | continue; | 372 | continue; |
510 | @@ -372,6 +376,7 @@ | |||
511 | 372 | launcher_icon->RememberRotation(monitor, it->rotation); | 376 | launcher_icon->RememberRotation(monitor, it->rotation); |
512 | 373 | launcher_icon->RememberSkip(monitor, it->skip); | 377 | launcher_icon->RememberSkip(monitor, it->skip); |
513 | 374 | launcher_icon->RememberEmblem(monitor, launcher_icon->Emblem() != nullptr); | 378 | launcher_icon->RememberEmblem(monitor, launcher_icon->Emblem() != nullptr); |
514 | 379 | launcher_icon->RememberCount(monitor, launcher_icon->Count() != 0); | ||
515 | 375 | 380 | ||
516 | 376 | float w = icon_size; | 381 | float w = icon_size; |
517 | 377 | float h = icon_size; | 382 | float h = icon_size; |
518 | @@ -423,16 +428,26 @@ | |||
519 | 423 | 428 | ||
520 | 424 | UpdateIconTransform(launcher_icon, ViewProjectionMatrix, geo, x, y, w, h, z, ui::IconTextureSource::TRANSFORM_HIT_AREA); | 429 | UpdateIconTransform(launcher_icon, ViewProjectionMatrix, geo, x, y, w, h, z, ui::IconTextureSource::TRANSFORM_HIT_AREA); |
521 | 425 | 430 | ||
526 | 426 | if (launcher_icon->Emblem()) | 431 | float emb_w, emb_h; |
527 | 427 | { | 432 | nux::BaseTexture* emblem = launcher_icon->Emblem(); |
528 | 428 | nux::BaseTexture* emblem = launcher_icon->Emblem(); | 433 | |
529 | 429 | 434 | if (nux::BaseTexture* count_texture = launcher_icon->CountTexture(local::count_scaling(icon_size, pip_style != OUTSIDE_TILE))) | |
530 | 435 | { | ||
531 | 436 | emblem = count_texture; | ||
532 | 437 | emb_w = emblem->GetWidth(); | ||
533 | 438 | emb_h = emblem->GetHeight(); | ||
534 | 439 | } | ||
535 | 440 | else if (emblem) | ||
536 | 441 | { | ||
537 | 442 | emb_w = std::round(emblem->GetWidth() * scale()); | ||
538 | 443 | emb_h = std::round(emblem->GetHeight() * scale()); | ||
539 | 444 | } | ||
540 | 445 | |||
541 | 446 | if (emblem) | ||
542 | 447 | { | ||
543 | 430 | float w = icon_size; | 448 | float w = icon_size; |
544 | 431 | float h = icon_size; | 449 | float h = icon_size; |
545 | 432 | 450 | ||
546 | 433 | float emb_w = emblem->GetWidth(); | ||
547 | 434 | float emb_h = emblem->GetHeight(); | ||
548 | 435 | |||
549 | 436 | x = it->render_center.x + (icon_size * 0.50f - emb_w - icon_size * 0.05f); // puts right edge of emblem just over the edge of the launcher icon | 451 | x = it->render_center.x + (icon_size * 0.50f - emb_w - icon_size * 0.05f); // puts right edge of emblem just over the edge of the launcher icon |
550 | 437 | y = it->render_center.y - icon_size * 0.50f; // y = top left corner position of emblem | 452 | y = it->render_center.y - icon_size * 0.50f; // y = top left corner position of emblem |
551 | 438 | z = it->render_center.z; | 453 | z = it->render_center.z; |
552 | @@ -718,7 +733,18 @@ | |||
553 | 718 | tile_transform); | 733 | tile_transform); |
554 | 719 | } | 734 | } |
555 | 720 | 735 | ||
557 | 721 | if (arg.icon->Emblem()) | 736 | if (nux::BaseTexture* count_texture = arg.icon->CountTexture(local::count_scaling(icon_size, pip_style != OUTSIDE_TILE))) |
558 | 737 | { | ||
559 | 738 | RenderElement(GfxContext, | ||
560 | 739 | arg, | ||
561 | 740 | count_texture->GetDeviceTexture(), | ||
562 | 741 | nux::color::White, | ||
563 | 742 | nux::color::White, | ||
564 | 743 | arg.alpha, | ||
565 | 744 | force_filter, | ||
566 | 745 | arg.icon->GetTransform(ui::IconTextureSource::TRANSFORM_EMBLEM, monitor)); | ||
567 | 746 | } | ||
568 | 747 | else if (arg.icon->Emblem()) | ||
569 | 722 | { | 748 | { |
570 | 723 | RenderElement(GfxContext, | 749 | RenderElement(GfxContext, |
571 | 724 | arg, | 750 | arg, |
572 | @@ -726,7 +752,7 @@ | |||
573 | 726 | nux::color::White, | 752 | nux::color::White, |
574 | 727 | nux::color::White, | 753 | nux::color::White, |
575 | 728 | arg.alpha, | 754 | arg.alpha, |
577 | 729 | force_filter, | 755 | force_filter || scale != 1.0, |
578 | 730 | arg.icon->GetTransform(ui::IconTextureSource::TRANSFORM_EMBLEM, monitor)); | 756 | arg.icon->GetTransform(ui::IconTextureSource::TRANSFORM_EMBLEM, monitor)); |
579 | 731 | } | 757 | } |
580 | 732 | 758 | ||
581 | 733 | 759 | ||
582 | === modified file 'unity-shared/IconTextureSource.cpp' | |||
583 | --- unity-shared/IconTextureSource.cpp 2013-10-04 00:46:07 +0000 | |||
584 | +++ unity-shared/IconTextureSource.cpp 2014-08-08 15:13:47 +0000 | |||
585 | @@ -34,6 +34,7 @@ | |||
586 | 34 | IconTextureSource::IconTextureSource() | 34 | IconTextureSource::IconTextureSource() |
587 | 35 | : skip_(RENDERERS_SIZE, false) | 35 | : skip_(RENDERERS_SIZE, false) |
588 | 36 | , had_emblem_(RENDERERS_SIZE, false) | 36 | , had_emblem_(RENDERERS_SIZE, false) |
589 | 37 | , had_count_(RENDERERS_SIZE, false) | ||
590 | 37 | , last_render_center_(RENDERERS_SIZE) | 38 | , last_render_center_(RENDERERS_SIZE) |
591 | 38 | , last_logical_center_(RENDERERS_SIZE) | 39 | , last_logical_center_(RENDERERS_SIZE) |
592 | 39 | , last_rotation_(RENDERERS_SIZE) | 40 | , last_rotation_(RENDERERS_SIZE) |
593 | @@ -91,5 +92,30 @@ | |||
594 | 91 | return had_emblem_[monitor]; | 92 | return had_emblem_[monitor]; |
595 | 92 | } | 93 | } |
596 | 93 | 94 | ||
597 | 95 | void IconTextureSource::RememberCount(int monitor, bool has_count) | ||
598 | 96 | { | ||
599 | 97 | had_count_[monitor] = has_count; | ||
600 | 98 | } | ||
601 | 99 | |||
602 | 100 | bool IconTextureSource::HadCount(int monitor) const | ||
603 | 101 | { | ||
604 | 102 | return had_count_[monitor]; | ||
605 | 103 | } | ||
606 | 104 | |||
607 | 105 | unsigned IconTextureSource::Count() const | ||
608 | 106 | { | ||
609 | 107 | return 0; | ||
610 | 108 | } | ||
611 | 109 | |||
612 | 110 | nux::BaseTexture* IconTextureSource::Emblem() const | ||
613 | 111 | { | ||
614 | 112 | return nullptr; | ||
615 | 113 | } | ||
616 | 114 | |||
617 | 115 | nux::BaseTexture* IconTextureSource::CountTexture(double scale) | ||
618 | 116 | { | ||
619 | 117 | return nullptr; | ||
620 | 118 | } | ||
621 | 119 | |||
622 | 94 | } | 120 | } |
623 | 95 | } | 121 | } |
624 | 96 | \ No newline at end of file | 122 | \ No newline at end of file |
625 | 97 | 123 | ||
626 | === modified file 'unity-shared/IconTextureSource.h' | |||
627 | --- unity-shared/IconTextureSource.h 2013-11-06 11:21:43 +0000 | |||
628 | +++ unity-shared/IconTextureSource.h 2014-08-08 15:13:47 +0000 | |||
629 | @@ -62,17 +62,21 @@ | |||
630 | 62 | void RememberEmblem(int monitor, bool has_emblem); | 62 | void RememberEmblem(int monitor, bool has_emblem); |
631 | 63 | bool HadEmblem(int monitor) const; | 63 | bool HadEmblem(int monitor) const; |
632 | 64 | 64 | ||
633 | 65 | void RememberCount(int monitor, bool has_count); | ||
634 | 66 | bool HadCount(int monitor) const; | ||
635 | 67 | |||
636 | 65 | virtual nux::Color BackgroundColor() const = 0; | 68 | virtual nux::Color BackgroundColor() const = 0; |
637 | 66 | |||
638 | 67 | virtual nux::Color GlowColor() = 0; | 69 | virtual nux::Color GlowColor() = 0; |
639 | 68 | |||
640 | 69 | virtual nux::BaseTexture* TextureForSize(int size) = 0; | 70 | virtual nux::BaseTexture* TextureForSize(int size) = 0; |
641 | 70 | 71 | ||
643 | 71 | virtual nux::BaseTexture* Emblem() = 0; | 72 | virtual unsigned Count() const; |
644 | 73 | virtual nux::BaseTexture* CountTexture(double scale); | ||
645 | 74 | virtual nux::BaseTexture* Emblem() const; | ||
646 | 72 | 75 | ||
647 | 73 | private: | 76 | private: |
648 | 74 | std::vector<bool> skip_; | 77 | std::vector<bool> skip_; |
649 | 75 | std::vector<bool> had_emblem_; | 78 | std::vector<bool> had_emblem_; |
650 | 79 | std::vector<bool> had_count_; | ||
651 | 76 | std::vector<nux::Point3> last_render_center_; | 80 | std::vector<nux::Point3> last_render_center_; |
652 | 77 | std::vector<nux::Point3> last_logical_center_; | 81 | std::vector<nux::Point3> last_logical_center_; |
653 | 78 | std::vector<nux::Vector3> last_rotation_; | 82 | std::vector<nux::Vector3> last_rotation_; |
654 | 79 | 83 | ||
655 | === modified file 'unity-shared/TextInput.cpp' | |||
656 | --- unity-shared/TextInput.cpp 2014-07-28 17:55:19 +0000 | |||
657 | +++ unity-shared/TextInput.cpp 2014-08-08 15:13:47 +0000 | |||
658 | @@ -234,9 +234,8 @@ | |||
659 | 234 | gtk_style_context_set_path(style_context, widget_path.get()); | 234 | gtk_style_context_set_path(style_context, widget_path.get()); |
660 | 235 | gtk_style_context_add_class(style_context, "tooltip"); | 235 | gtk_style_context_add_class(style_context, "tooltip"); |
661 | 236 | 236 | ||
665 | 237 | glib::Object<PangoLayout> layout; | 237 | glib::Object<PangoContext> context(gdk_pango_context_get()); |
666 | 238 | glib::Object<PangoContext> context(gdk_pango_context_get_for_screen(gdk_screen_get_default())); | 238 | glib::Object<PangoLayout> layout(pango_layout_new(context)); |
664 | 239 | layout = pango_layout_new(context); | ||
667 | 240 | 239 | ||
668 | 241 | std::shared_ptr<PangoFontDescription> desc(pango_font_description_from_string(font_name), pango_font_description_free); | 240 | std::shared_ptr<PangoFontDescription> desc(pango_font_description_from_string(font_name), pango_font_description_free); |
669 | 242 | pango_context_set_font_description(context, desc.get()); | 241 | pango_context_set_font_description(context, desc.get()); |
PASSED: Continuous integration, rev:3852 jenkins. qa.ubuntu. com/job/ unity-ci/ 1054/ jenkins. qa.ubuntu. com/job/ unity-utopic- amd64-ci/ 141 jenkins. qa.ubuntu. com/job/ unity-utopic- armhf-ci/ 141 jenkins. qa.ubuntu. com/job/ unity-utopic- i386-ci/ 141
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- ci/1054/ rebuild
http://