Merge lp:~unity-team/unity/fixes-2011-04-04 into lp:unity

Proposed by Neil J. Patel
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merged at revision: 1084
Proposed branch: lp:~unity-team/unity/fixes-2011-04-04
Merge into: lp:unity
Diff against target: 614 lines (+118/-69)
23 files modified
src/IndicatorObjectFactoryRemote.cpp (+2/-2)
src/LauncherIcon.cpp (+5/-0)
src/LauncherIcon.h (+1/-1)
src/PanelController.cpp (+7/-0)
src/PanelHomeButton.cpp (+3/-1)
src/PanelHomeButton.h (+1/-0)
src/PanelMenuView.cpp (+1/-1)
src/PlaceFactoryFile.cpp (+34/-1)
src/PlaceFactoryFile.h (+4/-2)
src/PlaceLauncherSection.cpp (+4/-2)
src/PlaceLauncherSection.h (+2/-0)
src/PlaceRemote.cpp (+6/-0)
src/PlaceRemote.h (+1/-1)
src/PlacesController.cpp (+1/-1)
src/PlacesHorizontalTile.cpp (+13/-11)
src/PlacesSettings.cpp (+2/-2)
src/PlacesSimpleTile.cpp (+8/-7)
src/PlacesTile.cpp (+7/-32)
src/QuicklistMenuItemCheckmark.cpp (+1/-1)
src/QuicklistMenuItemLabel.cpp (+1/-1)
src/QuicklistMenuItemRadio.cpp (+1/-1)
src/StaticCairoText.cpp (+9/-1)
src/StaticCairoText.h (+4/-1)
To merge this branch: bzr merge lp:~unity-team/unity/fixes-2011-04-04
Reviewer Review Type Date Requested Status
Gord Allott Pending
Review via email: mp+56769@code.launchpad.net

Description of the change

Bugs attached plus some misc fixes.

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

On Fri, 08 Apr 2011 01:42:07 you wrote:
> +bool
> +PlaceFactoryFile::DoSortThemMister (Place *aa, Place *bb)
> +{
> +#define FIRST "/com/canonical/unity/applicationsplace"
> +#define SECOND "/com/canonical/unity/filesplace"
> +

For the love of clean code, what is wrong with:

  static const char* const apps_place =
"/com/canonical/unity/applicationsplace";
  static const char* const files_place = "/com/canonical/unity/filesplace";

#defines are brutal hammers that just aren't needed in places like this.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/IndicatorObjectFactoryRemote.cpp'
2--- src/IndicatorObjectFactoryRemote.cpp 2011-03-31 22:02:34 +0000
3+++ src/IndicatorObjectFactoryRemote.cpp 2011-04-07 13:41:22 +0000
4@@ -537,8 +537,8 @@
5 }
6 else if (g_strcmp0 (signal_name, "EntryShowNowChanged") == 0)
7 {
8- gchar *id = NULL;
9- bool show_now_state;
10+ gchar *id = NULL;
11+ gboolean show_now_state;
12
13 g_variant_get (parameters, "(sb)", &id, &show_now_state);
14
15
16=== modified file 'src/LauncherIcon.cpp'
17--- src/LauncherIcon.cpp 2011-04-06 17:53:41 +0000
18+++ src/LauncherIcon.cpp 2011-04-07 13:41:22 +0000
19@@ -71,6 +71,7 @@
20 _mouse_inside = false;
21 _has_visible_window = false;
22 _tooltip = new nux::Tooltip ();
23+ _tooltip->SinkReference ();
24 _icon_type = TYPE_NONE;
25 _sort_priority = 0;
26 _shortcut = 0;
27@@ -79,6 +80,7 @@
28 _superkey_label = 0;
29
30 _quicklist = new QuicklistView ();
31+ _quicklist->SinkReference ();
32 _quicklist_is_initialized = false;
33
34 _present_time_handle = 0;
35@@ -133,6 +135,9 @@
36
37 if (on_order_changed_connection.connected ())
38 on_order_changed_connection.disconnect ();
39+
40+ _quicklist->UnReference ();
41+ _tooltip->UnReference ();
42 }
43
44 bool
45
46=== modified file 'src/LauncherIcon.h'
47--- src/LauncherIcon.h 2011-03-31 20:33:43 +0000
48+++ src/LauncherIcon.h 2011-04-07 13:41:22 +0000
49@@ -88,6 +88,7 @@
50
51 void SetShortcut (guint64 shortcut);
52 guint64 GetShortcut ();
53+ void SetSortPriority (int priority);
54
55 void RecvMouseEnter ();
56 void RecvMouseLeave ();
57@@ -182,7 +183,6 @@
58 void Unpresent ();
59
60 void SetIconType (IconType type);
61- void SetSortPriority (int priority);
62
63 void SetEmblem (nux::BaseTexture *emblem);
64 void SetSuperkeyLabel (nux::BaseTexture* label);
65
66=== modified file 'src/PanelController.cpp'
67--- src/PanelController.cpp 2011-03-29 16:02:03 +0000
68+++ src/PanelController.cpp 2011-04-07 13:41:22 +0000
69@@ -134,8 +134,12 @@
70 (*it)->EnableInputWindow (true);
71 (*it)->InputWindowEnableStruts (true);
72
73+ g_debug ("PanelController:: Updated Panel for Monitor %d", i);
74+
75 i++;
76 }
77+ else
78+ break;
79 }
80
81 // Add new ones if needed
82@@ -181,6 +185,8 @@
83 unity_util_accessible_add_window (window);
84
85 _windows.push_back (window);
86+
87+ g_debug ("PanelController:: Added Panel for Monitor %d", i);
88 }
89 }
90
91@@ -190,6 +196,7 @@
92 for (sit = it; sit != eit; ++sit)
93 {
94 (*sit)->UnReference ();
95+ g_debug ("PanelController:: Removed extra Panel");
96 }
97
98 _windows.erase (it, _windows.end ());
99
100=== modified file 'src/PanelHomeButton.cpp'
101--- src/PanelHomeButton.cpp 2011-04-06 17:53:41 +0000
102+++ src/PanelHomeButton.cpp 2011-04-07 13:41:22 +0000
103@@ -56,7 +56,7 @@
104 G_CALLBACK (PanelHomeButton::OnIconThemeChanged), this);
105
106 UBusServer *ubus = ubus_server_get_default ();
107- ubus_server_register_interest (ubus, UBUS_LAUNCHER_ICON_URGENT_CHANGED,
108+ _urgent_interest = ubus_server_register_interest (ubus, UBUS_LAUNCHER_ICON_URGENT_CHANGED,
109 (UBusCallback)&PanelHomeButton::OnLauncherIconUrgentChanged,
110 this);
111
112@@ -67,6 +67,8 @@
113 {
114 if (_theme_changed_id)
115 g_signal_handler_disconnect (gtk_icon_theme_get_default (), _theme_changed_id);
116+
117+ ubus_server_unregister_interest (ubus_server_get_default (), _urgent_interest);
118 }
119
120 void
121
122=== modified file 'src/PanelHomeButton.h'
123--- src/PanelHomeButton.h 2011-03-29 12:23:52 +0000
124+++ src/PanelHomeButton.h 2011-04-07 13:41:22 +0000
125@@ -60,6 +60,7 @@
126 int _urgent_count;
127
128 gulong _theme_changed_id;
129+ guint _urgent_interest;
130 };
131
132 #endif // PANEL_HOME_BUTTON_H
133
134=== modified file 'src/PanelMenuView.cpp'
135--- src/PanelMenuView.cpp 2011-04-07 08:48:01 +0000
136+++ src/PanelMenuView.cpp 2011-04-07 13:41:22 +0000
137@@ -100,7 +100,7 @@
138 _on_winbutton_redraw_signal_connection = _window_buttons->redraw_signal.connect (sigc::mem_fun (this, &PanelMenuView::OnWindowButtonsRedraw));
139
140 _panel_titlebar_grab_area = new PanelTitlebarGrabArea ();
141- _panel_titlebar_grab_area->Reference ();
142+ _panel_titlebar_grab_area->SinkReference ();
143 _on_titlebargrab_mouse_down_connnection = _panel_titlebar_grab_area->mouse_down.connect (sigc::mem_fun (this, &PanelMenuView::OnMaximizedGrab));
144 _on_titlebargrab_mouse_doubleleftclick_connnection = _panel_titlebar_grab_area->mouse_doubleleftclick.connect (sigc::mem_fun (this, &PanelMenuView::OnMouseDoubleClicked));
145 _on_titlebargrab_mouse_middleclick_connnection = _panel_titlebar_grab_area->mouse_middleclick.connect (sigc::mem_fun (this, &PanelMenuView::OnMouseMiddleClicked));
146
147=== modified file 'src/PlaceFactoryFile.cpp'
148--- src/PlaceFactoryFile.cpp 2011-03-09 12:40:14 +0000
149+++ src/PlaceFactoryFile.cpp 2011-04-07 13:41:22 +0000
150@@ -17,6 +17,8 @@
151 */
152 #include "config.h"
153
154+#include <algorithm>
155+
156 #include "PlaceFactoryFile.h"
157
158 #include "PlaceRemote.h"
159@@ -120,7 +122,6 @@
160 if (place->IsValid ())
161 {
162 _places.push_back (place);
163- place_added.emit (place);
164 }
165 else
166 delete place;
167@@ -142,11 +143,43 @@
168 return;
169 }
170
171+ // Sort them
172+ std::sort (_places.begin (), _places.end (), DoSortThemMister);
173+
174+ // Signal their creation
175+ std::vector<Place *>::iterator it, eit = _places.end ();
176+ for (it = _places.begin (); it != eit; ++it)
177+ {
178+ place_added.emit (*it);
179+ g_debug ("%s", static_cast<PlaceRemote *> (*it)->GetDBusPath ());
180+ }
181+
182 read_directory = true;
183
184 g_object_unref (enumerator);
185 }
186
187+bool
188+PlaceFactoryFile::DoSortThemMister (Place *aa, Place *bb)
189+{
190+#define FIRST "/com/canonical/unity/applicationsplace"
191+#define SECOND "/com/canonical/unity/filesplace"
192+
193+ PlaceRemote *a = static_cast<PlaceRemote *> (aa);
194+ PlaceRemote *b = static_cast<PlaceRemote *> (bb);
195+
196+ if (g_strcmp0 (a->GetDBusPath (), FIRST) == 0)
197+ return true;
198+ else if (g_strcmp0 (b->GetDBusPath (), FIRST) == 0)
199+ return false;
200+ else if (g_strcmp0 (a->GetDBusPath (), SECOND) == 0)
201+ return true;
202+ else if (g_strcmp0 (b->GetDBusPath (), SECOND) == 0)
203+ return false;
204+ else
205+ return g_strcmp0 (a->GetDBusPath (), b->GetDBusPath ()) == 0;
206+}
207+
208 /*
209 * C to C++ glue
210 */
211
212=== modified file 'src/PlaceFactoryFile.h'
213--- src/PlaceFactoryFile.h 2010-12-10 18:40:26 +0000
214+++ src/PlaceFactoryFile.h 2011-04-07 13:41:22 +0000
215@@ -42,10 +42,12 @@
216 /* Callbacks, not interesting to others */
217 void OnDirectoryEnumerationReady (GObject *source,
218 GAsyncResult *result);
219-
220+private:
221+ static bool DoSortThemMister (Place *a, Place *b);
222+
223 public:
224 /* For Debugging */
225- bool read_directory;
226+ bool read_directory;
227
228 private:
229 char *_directory;
230
231=== modified file 'src/PlaceLauncherSection.cpp'
232--- src/PlaceLauncherSection.cpp 2011-03-29 14:36:45 +0000
233+++ src/PlaceLauncherSection.cpp 2011-04-07 13:41:22 +0000
234@@ -21,7 +21,8 @@
235 #include "PlaceLauncherSection.h"
236
237 PlaceLauncherSection::PlaceLauncherSection (Launcher *launcher)
238-: _launcher (launcher)
239+: _launcher (launcher),
240+ _priority (10000)
241 {
242 _factory = PlaceFactory::GetDefault ();
243 _on_place_added_connection = (sigc::connection) _factory->place_added.connect (sigc::mem_fun (this,
244@@ -49,6 +50,7 @@
245 if (entry->ShowInLauncher ())
246 {
247 PlaceLauncherIcon *icon = new PlaceLauncherIcon (_launcher, entry);
248+ icon->SetSortPriority (_priority++);
249 IconAdded.emit (icon);
250 }
251 }
252@@ -73,9 +75,9 @@
253 if (entry->ShowInLauncher ())
254 {
255 PlaceLauncherIcon *icon = new PlaceLauncherIcon (_launcher, entry);
256+ icon->SetSortPriority (_priority++);
257 IconAdded.emit (icon);
258 }
259 }
260 }
261 }
262-
263
264=== modified file 'src/PlaceLauncherSection.h'
265--- src/PlaceLauncherSection.h 2011-03-29 14:36:45 +0000
266+++ src/PlaceLauncherSection.h 2011-04-07 13:41:22 +0000
267@@ -43,6 +43,8 @@
268 Launcher *_launcher;
269 PlaceFactory *_factory;
270 sigc::connection _on_place_added_connection;
271+
272+ guint32 _priority;
273 };
274
275 #endif // _PLACE_LAUNCHER_SECTION_H_
276
277=== modified file 'src/PlaceRemote.cpp'
278--- src/PlaceRemote.cpp 2011-03-09 19:57:01 +0000
279+++ src/PlaceRemote.cpp 2011-04-07 13:41:22 +0000
280@@ -204,6 +204,12 @@
281 g_object_unref (_activation_proxy);
282 }
283
284+const gchar *
285+PlaceRemote::GetDBusPath ()
286+{
287+ return _dbus_path;
288+}
289+
290 void
291 PlaceRemote::Connect ()
292 {
293
294=== modified file 'src/PlaceRemote.h'
295--- src/PlaceRemote.h 2011-03-09 16:26:43 +0000
296+++ src/PlaceRemote.h 2011-04-07 13:41:22 +0000
297@@ -47,7 +47,7 @@
298 void OnEntryAdded (GVariant *args);
299 void OnEntryRemoved (const gchar *dbus_path);
300
301- const gchar * GetDBusName ();
302+ const gchar * GetDBusPath ();
303
304 void ActivateResult (const char *uri, const char *mimetype);
305
306
307=== modified file 'src/PlacesController.cpp'
308--- src/PlacesController.cpp 2011-04-06 16:35:35 +0000
309+++ src/PlacesController.cpp 2011-04-07 13:41:22 +0000
310@@ -252,7 +252,7 @@
311 width += tile_width;
312
313 width = MAX (width, tile_width * 7);
314- height = ((width/tile_width) - 3) * tile_width;
315+ height = MIN (rect.height, (style->GetTileHeight () * 5.5) + 12);
316
317 _view->SetSizeMode (PlacesView::SIZE_MODE_HOVER);
318 style->SetDefaultNColumns (6);
319
320=== modified file 'src/PlacesHorizontalTile.cpp'
321--- src/PlacesHorizontalTile.cpp 2011-03-29 22:16:19 +0000
322+++ src/PlacesHorizontalTile.cpp 2011-04-07 13:41:22 +0000
323@@ -47,16 +47,17 @@
324 _comment = g_strdup_printf ("<small>%s</small>", comment);
325
326 int w = (PlacesSettings::GetDefault ()->GetDefaultTileWidth () * 2) - icon_size - 24;//padding
327+ int lines = 0;
328
329 nux::HLayout *layout = new nux::HLayout ("", NUX_TRACKER_LOCATION);
330- layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12));
331+ layout->AddLayout (new nux::SpaceLayout (6, 6, 0, 0));
332
333 _icontex = new IconTexture (_icon, icon_size, defer_icon_loading);
334- _icontex->SetMinMaxSize (icon_size * 1.5, icon_size);
335+ _icontex->SetMinMaxSize (icon_size, icon_size);
336 AddChild (_icontex);
337- layout->AddView (_icontex, 0, nux::eCenter, nux::eFull);
338+ layout->AddView (_icontex, 0, nux::eLeft, nux::eFix);
339
340- layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12));
341+ layout->AddLayout (new nux::SpaceLayout (6, 6, 0, 0));
342
343 nux::VLayout *vlayout = new nux::VLayout ("", NUX_TRACKER_LOCATION);
344 layout->AddView (vlayout, 1, nux::eLeft, nux::eFull);
345@@ -66,12 +67,14 @@
346 _cairotext = new nux::StaticCairoText (_label);
347 _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_LEFT);
348 _cairotext->SetMaximumWidth (w);
349+ _cairotext->SetLines (-2);
350 vlayout->AddView (_cairotext, 0, nux::eLeft, nux::eFull);
351+ lines = _cairotext->GetLineCount ();
352
353 _cairotext = new nux::StaticCairoText (_comment);
354 _cairotext->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_END);
355 _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_LEFT);
356- _cairotext->SetLines (-3);
357+ _cairotext->SetLines (-1 * (4 - lines));
358 _cairotext->SetMaximumWidth (w);
359 _cairotext->SetTextColor (nux::Color (1.0f, 1.0f, 1.0f, 0.8f));
360 vlayout->AddView (_cairotext, 1, nux::eLeft, nux::eFull);
361@@ -197,13 +200,12 @@
362 {
363 nux::Geometry base = GetGeometry ();
364 int width = 0, height = 0;
365-
366 _icontex->GetTextureSize (&width, &height);
367-
368- _highlight_geometry.x = 12;
369- _highlight_geometry.y = 12;
370- _highlight_geometry.width = width;
371- _highlight_geometry.height = height;
372+
373+ _highlight_geometry.x = 6;
374+ _highlight_geometry.y = 6;
375+ _highlight_geometry.width = _icontex->GetMaximumWidth ();
376+ _highlight_geometry.height = base.height - 12;
377
378 return _highlight_geometry;
379 }
380
381=== modified file 'src/PlacesSettings.cpp'
382--- src/PlacesSettings.cpp 2011-03-13 19:23:11 +0000
383+++ src/PlacesSettings.cpp 2011-04-07 13:41:22 +0000
384@@ -20,6 +20,7 @@
385 #include "gdk/gdk.h"
386
387 #include "PlacesSettings.h"
388+#include "PlacesStyle.h"
389
390 #define HOME_EXPANDED "home-expanded"
391
392@@ -91,8 +92,7 @@
393 int
394 PlacesSettings::GetDefaultTileWidth ()
395 {
396- //FIXME: We want to calculate this from DPI
397- return 140;
398+ return PlacesStyle::GetDefault ()->GetTileWidth ();
399 }
400
401 PlacesSettings::DashBlurType
402
403=== modified file 'src/PlacesSimpleTile.cpp'
404--- src/PlacesSimpleTile.cpp 2011-03-29 15:57:38 +0000
405+++ src/PlacesSimpleTile.cpp 2011-04-07 13:41:22 +0000
406@@ -20,7 +20,7 @@
407 *
408 */
409
410-#include "PlacesSettings.h"
411+#include "PlacesStyle.h"
412 #include "ubus-server.h"
413 #include "UBusMessages.h"
414
415@@ -40,29 +40,30 @@
416 _icon (NULL),
417 _uri (NULL)
418 {
419+ PlacesStyle *style = PlacesStyle::GetDefault ();
420 nux::VLayout *layout = new nux::VLayout ("", NUX_TRACKER_LOCATION);
421
422 _label = g_strdup (label);
423 _icon = g_strdup (icon_name);
424
425 _icontex = new IconTexture (_icon, icon_size, defer_icon_loading);
426- _icontex->SetMinMaxSize (PlacesSettings::GetDefault ()->GetDefaultTileWidth (), icon_size);
427+ _icontex->SetMinMaxSize (style->GetTileWidth (), icon_size);
428 _icontex->SinkReference ();
429 AddChild (_icontex);
430
431- _cairotext = new nux::StaticCairoText (_label);
432+ _cairotext = new nux::StaticCairoText ("");
433+ _cairotext->SetMaximumWidth (style->GetTileWidth ());
434 _cairotext->SinkReference ();
435-
436 _cairotext->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_START);
437 _cairotext->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_CENTRE);
438- _cairotext->SetMaximumWidth (140);
439-
440+ _cairotext->SetText (_label);
441+
442 layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12));
443 layout->AddView (_icontex, 0, nux::eCenter, nux::eFull);
444 layout->AddLayout (new nux::SpaceLayout (0, 0, 12, 12));
445 layout->AddView (_cairotext, 0, nux::eCenter, nux::eFull);
446
447- SetMinMaxSize (160, 128);
448+ SetMinMaxSize (style->GetTileWidth (), style->GetTileHeight ());
449
450 SetLayout (layout);
451
452
453=== modified file 'src/PlacesTile.cpp'
454--- src/PlacesTile.cpp 2011-04-06 17:53:41 +0000
455+++ src/PlacesTile.cpp 2011-04-07 13:41:22 +0000
456@@ -115,9 +115,7 @@
457 true);
458 cairo_fill (cr);
459 cairo_graphics->BlurSurface (BLUR_SIZE - 2);
460-
461- // draw tiled background
462- // set up clip path
463+
464 cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
465 cairo_graphics->DrawRoundedRectangle (cr,
466 1.0,
467@@ -128,44 +126,21 @@
468 bg_height,
469 true);
470 cairo_clip (cr);
471-
472- int w, h;
473- cairo_surface_t *image;
474- cairo_pattern_t *pattern;
475-
476- cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
477- image = cairo_image_surface_create_from_png (PKGDATADIR"/places-tile-bg-tilable.png");
478- w = cairo_image_surface_get_width (image);
479- h = cairo_image_surface_get_height (image);
480-
481-
482- pattern = cairo_pattern_create_for_surface (image);
483- cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
484-
485- cairo_set_source (cr, pattern);
486-
487- cairo_rectangle (cr, 0, 0, base.width, base.height);
488- cairo_fill (cr);
489-
490- cairo_pattern_destroy (pattern);
491- cairo_surface_destroy (image);
492-
493- // draw the outline
494-
495 cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
496
497 cairo_graphics->DrawRoundedRectangle (cr,
498 1.0,
499 bg_x,
500- bg_y,
501+ bg_y,
502 5.0,
503 bg_width,
504 bg_height,
505 true);
506- cairo_set_source_rgba (cr, 0.66, 0.66, 0.66, 1.0);
507- cairo_set_line_width (cr, 1.0);
508- cairo_stroke (cr);
509-
510+ cairo_set_source_rgba (cr, 240/255.0f, 240/255.0f, 240/255.0f, 1.0f);
511+ cairo_fill_preserve (cr);
512+
513+ cairo_set_source_rgba (cr, 1.0f, 1.0f, 1.0f, 1.0);
514+ cairo_stroke (cr);
515
516 cairo_destroy (cr);
517
518
519=== modified file 'src/QuicklistMenuItemCheckmark.cpp'
520--- src/QuicklistMenuItemCheckmark.cpp 2011-04-06 17:53:41 +0000
521+++ src/QuicklistMenuItemCheckmark.cpp 2011-04-07 13:41:22 +0000
522@@ -191,7 +191,7 @@
523 texture = _normalTexture[0]->GetDeviceTexture ();
524 }
525
526- _color = nux::Colors::Gray;
527+ _color = nux::Color (0.8f, 0.8f, 0.8f, 1.0f);
528 }
529
530 gfxContext.QRP_1Tex (base.x,
531
532=== modified file 'src/QuicklistMenuItemLabel.cpp'
533--- src/QuicklistMenuItemLabel.cpp 2011-04-06 17:53:41 +0000
534+++ src/QuicklistMenuItemLabel.cpp 2011-04-07 13:41:22 +0000
535@@ -162,7 +162,7 @@
536 else
537 {
538 texture = _normalTexture[0]->GetDeviceTexture ();
539- _color = nux::Colors::Gray;
540+ _color = nux::Color (0.8f, 0.8f, 0.8f, 1.0f);
541 }
542
543 gfxContext.QRP_1Tex (base.x,
544
545=== modified file 'src/QuicklistMenuItemRadio.cpp'
546--- src/QuicklistMenuItemRadio.cpp 2011-04-06 17:53:41 +0000
547+++ src/QuicklistMenuItemRadio.cpp 2011-04-07 13:41:22 +0000
548@@ -191,7 +191,7 @@
549 texture = _normalTexture[0]->GetDeviceTexture ();
550 }
551
552- _color = nux::Colors::Gray;
553+ _color = nux::Color (0.8f, 0.8f, 0.8f, 1.0f);
554 }
555
556 gfxContext.QRP_1Tex (base.x,
557
558=== modified file 'src/StaticCairoText.cpp'
559--- src/StaticCairoText.cpp 2011-03-29 22:16:19 +0000
560+++ src/StaticCairoText.cpp 2011-04-07 13:41:22 +0000
561@@ -36,7 +36,8 @@
562 _fontstring (NULL),
563 _cairoGraphics (NULL),
564 _texture2D (NULL),
565- _lines (-2)
566+ _lines (-2),
567+ _actual_lines (0)
568
569 {
570 _textColor = Color(1.0f, 1.0f, 1.0f, 1.0f);
571@@ -260,6 +261,11 @@
572 sigFontChanged.emit (this);
573 }
574
575+int
576+StaticCairoText::GetLineCount ()
577+{
578+ return _actual_lines;
579+}
580
581 void StaticCairoText::GetTextExtents (int &width, int &height)
582 {
583@@ -447,6 +453,8 @@
584 cairo_move_to (cr, 0.0f, 0.0f);
585 pango_cairo_show_layout (cr, layout);
586
587+ _actual_lines = pango_layout_get_line_count (layout);
588+
589 // clean up
590 pango_font_description_free (desc);
591 g_object_unref (layout);
592
593=== modified file 'src/StaticCairoText.h'
594--- src/StaticCairoText.h 2011-03-29 22:16:19 +0000
595+++ src/StaticCairoText.h 2011-04-07 13:41:22 +0000
596@@ -86,7 +86,9 @@
597 void SetTextAlignment (AlignState state);
598 void SetTextVerticalAlignment (AlignState state);
599 void SetFont (const char *fontstring);
600- void SetLines (int lines);
601+ void SetLines (int maximum_lines);
602+
603+ int GetLineCount ();
604
605 void GetTextExtents (int &width, int &height);
606
607@@ -113,6 +115,7 @@
608 int _pre_layout_height;
609
610 int _lines;
611+ int _actual_lines;
612
613 void GetTextExtents (const TCHAR* font,
614 int& width,