~canonical-dx-team/unity/unity.fix-ql-losing-focus

« back to all changes in this revision

Viewing changes to src/PlacesGroup.cpp

Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
  //~ OnMouseEnter.connect (sigc::mem_fun (this, &PlacesGroup::RecvMouseEnter));
52
52
  //~ OnMouseLeave.connect (sigc::mem_fun (this, &PlacesGroup::RecvMouseLeave));
53
53
 
 
54
  _icon_texture = new IconTexture ("", 24);
 
55
  _icon_texture->SetMinimumSize (24, 24);
 
56
 
54
57
  _label = new nux::StaticCairoText ("", NUX_TRACKER_LOCATION);
55
 
  _label->SetFont ("Ubuntu normal 11");
56
58
  _label->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_END);
57
59
  _label->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_LEFT);
58
 
  _label->SetMaximumWidth (320);
59
 
  _label->SetMinimumWidth (1);
60
60
 
61
61
  _title = new nux::StaticCairoText ("", NUX_TRACKER_LOCATION);
62
 
  _title->SetFont ("Ubuntu normal 11");
63
62
  _title->SetTextEllipsize (nux::StaticCairoText::NUX_ELLIPSIZE_END);
64
 
  _title->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_RIGHT);
65
 
  _title->SetMaximumWidth (320);
66
 
  _title->SetMinimumWidth (1);
 
63
  _title->SetTextAlignment (nux::StaticCairoText::NUX_ALIGN_LEFT);
67
64
 
68
65
  _header_layout = new nux::HLayout (NUX_TRACKER_LOCATION);
 
66
  _header_layout->SetHorizontalInternalMargin (12);
69
67
 
70
 
  _header_layout->AddView (_title, 0, nux::MINOR_POSITION_TOP, nux::MINOR_SIZE_FULL);
 
68
  _header_layout->AddView (_icon_texture, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);
 
69
  _header_layout->AddView (_title, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FIX);
71
70
  _header_layout->AddSpace (1, 1);
72
71
 
73
72
  // FIXME: We don't want to show this as it does nothing right now
102
101
 
103
102
void PlacesGroup::SetTitle (const char *title)
104
103
{
105
 
  _title_string = g_strdup (title);
 
104
  const gchar *temp = "<big>%s</big>";
 
105
 
 
106
  _title_string = g_strdup_printf (temp, title);
106
107
  UpdateTitle ();
107
108
}
108
109
 
109
110
void PlacesGroup::SetEmblem (const char *path_to_emblem)
110
111
{
 
112
  _icon_texture->SetByIconName (path_to_emblem, 24);
111
113
}
112
114
 
113
115
void PlacesGroup::AddLayout (nux::Layout *layout)