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