48
48
_home_button = new PanelHomeButton ();
49
49
_layout->AddView (_home_button, 0, nux::eCenter, nux::eFull);
51
50
AddChild (_home_button);
52
_menu_view = new PanelMenuView ();
53
_layout->AddView (_menu_view, 1, nux::eCenter, nux::eFull);
54
AddChild (_menu_view);
53
56
_remote = new IndicatorObjectFactoryRemote ();
54
57
_remote->OnObjectAdded.connect (sigc::mem_fun (this, &PanelView::OnObjectAdded));
55
58
_remote->OnMenuPointerMoved.connect (sigc::mem_fun (this, &PanelView::OnMenuPointerMoved));
56
59
_remote->OnEntryActivateRequest.connect (sigc::mem_fun (this, &PanelView::OnEntryActivateRequest));
60
_remote->IndicatorObjectFactory::OnEntryActivated.connect (sigc::mem_fun (this, &PanelView::OnEntryActivated));
59
63
PanelView::~PanelView ()
206
210
// Appmenu is treated differently as it needs to expand
207
211
// We could do this in a more special way, but who has the time for special?
208
_layout->AddView (view, (g_strstr_len (proxy->GetName ().c_str (), -1, "appmenu") != NULL), nux::eCenter, nux::eFull);
212
if (g_strstr_len (proxy->GetName ().c_str (), -1, "appmenu") != NULL)
213
_menu_view->SetProxy (proxy);
215
_layout->AddView (view, 0, nux::eCenter, nux::eFull);
209
217
_layout->SetContentDistribution (nux::eStackLeft);
226
234
if (x >= geo.x && x <= (geo.x + geo.width)
227
235
&& y >= geo.y && y <= (geo.y + geo.height))
237
std::list<Area *>::iterator it;
239
std::list<Area *> my_children = _layout->GetChildren ();
240
for (it = my_children.begin(); it != my_children.end(); it++)
229
std::list<Area *>::iterator it;
242
PanelIndicatorObjectView *view = static_cast<PanelIndicatorObjectView *> (*it);
244
if (view->_layout == NULL)
231
std::list<Area *> my_children = _layout->GetChildren ();
232
for (it = my_children.begin(); it != my_children.end(); it++)
247
geo = view->GetGeometry ();
248
if (x >= geo.x && x <= (geo.x + geo.width)
249
&& y >= geo.y && y <= (geo.y + geo.height))
234
PanelIndicatorObjectView *view = static_cast<PanelIndicatorObjectView *> (*it);
236
if (view->_layout == NULL)
239
geo = view->GetGeometry ();
240
if (x >= geo.x && x <= (geo.x + geo.width)
241
&& y >= geo.y && y <= (geo.y + geo.height))
251
std::list<Area *>::iterator it2;
253
std::list<Area *> its_children = view->_layout->GetChildren ();
254
for (it2 = its_children.begin(); it2 != its_children.end(); it2++)
256
PanelIndicatorObjectEntryView *entry = static_cast<PanelIndicatorObjectEntryView *> (*it2);
258
geo = entry->GetGeometry ();
259
if (x >= geo.x && x <= (geo.x + geo.width)
260
&& y >= geo.y && y <= (geo.y + geo.height))
243
std::list<Area *>::iterator it2;
245
std::list<Area *> its_children = view->_layout->GetChildren ();
246
for (it2 = its_children.begin(); it2 != its_children.end(); it2++)
248
PanelIndicatorObjectEntryView *entry = static_cast<PanelIndicatorObjectEntryView *> (*it2);
250
geo = entry->GetGeometry ();
251
if (x >= geo.x && x <= (geo.x + geo.width)
252
&& y >= geo.y && y <= (geo.y + geo.height))
254
entry->OnMouseDown (x, y, 0, 0);
262
entry->OnMouseDown (x, y, 0, 0);
282
290
PanelIndicatorObjectEntryView *entry = static_cast<PanelIndicatorObjectEntryView *> (*it2);
284
292
if (g_strcmp0 (entry->GetName (), entry_id) == 0)
294
g_debug ("%s: Activating: %s", G_STRFUNC, entry_id);
303
PanelView::OnEntryActivated (const char *entry_id)
305
if (g_strcmp0 (entry_id, "") == 0)
306
_menu_view->AllMenusClosed ();