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

« back to all changes in this revision

Viewing changes to src/PlacesView.cpp

adds keynav support to places

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
 
53
53
  _h_spacer= new nux::SpaceLayout (1, 1, 1, nux::AREA_MAX_HEIGHT);
54
54
  _layout->AddLayout (_h_spacer, 0, nux::eCenter, nux::eFull);
55
 
  
 
55
 
56
56
  _search_bar = new PlacesSearchBar ();
57
57
  vlayout->AddView (_search_bar, 0, nux::eCenter, nux::eFull);
58
58
  AddChild (_search_bar);
64
64
 
65
65
  _v_spacer = new nux::SpaceLayout (1, nux::AREA_MAX_WIDTH, 1, 1);
66
66
  vlayout->AddLayout (_v_spacer, 0, nux::eCenter, nux::eFull);
67
 
  
 
67
 
68
68
  _home_view = new PlacesHomeView ();
69
69
  _layered_layout->AddLayer (_home_view);
70
70
  AddChild (_home_view);
80
80
  SetLayout (_layout);
81
81
 
82
82
  {
83
 
    nux::ROPConfig rop; 
 
83
    nux::ROPConfig rop;
84
84
    rop.Blend = true;
85
85
    rop.SrcBlend = GL_ONE;
86
86
    rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
102
102
  _icon_loader = IconLoader::GetDefault ();
103
103
 
104
104
  SetActiveEntry (_home_entry, 0, "");
 
105
 
 
106
  //_layout->SetFocused (true);
105
107
}
106
108
 
107
109
PlacesView::~PlacesView ()
156
158
 
157
159
  GfxContext.GetRenderStates ().SetBlend (true);
158
160
  GfxContext.GetRenderStates ().SetPremultipliedBlend (nux::SRC_OVER);
159
 
 
 
161
 
160
162
  if (_size_mode == SIZE_MODE_HOVER)
161
163
  {
162
164
    nux::BaseTexture *corner = style->GetDashCorner ();
234
236
    _bg_layer->SetGeometry (geo);
235
237
    nux::GetPainter ().RenderSinglePaintLayer (GfxContext, geo, _bg_layer);
236
238
  }
237
 
  
 
239
 
238
240
  GfxContext.GetRenderStates ().SetBlend (false);
239
 
  
 
241
 
240
242
  GfxContext.PopClippingRectangle ();
241
243
}
242
244
 
249
251
  GfxContext.GetRenderStates ().SetPremultipliedBlend (nux::SRC_OVER);
250
252
 
251
253
  nux::GetPainter ().PushLayer (GfxContext, _bg_layer->GetGeometry (), _bg_layer);
252
 
  
 
254
 
253
255
  if (_layout)
254
256
    _layout->ProcessDraw (GfxContext, force_draw);
255
257
 
256
258
  nux::GetPainter ().PopBackground ();
257
 
  
 
259
 
258
260
  GfxContext.GetRenderStates ().SetBlend (false);
259
261
 
260
262
  GfxContext.PopClippingRectangle ();
282
284
 
283
285
    _results_controller->Clear ();
284
286
  }
285
 
  
 
287
 
286
288
  _entry = entry;
287
289
 
288
290
  _entry->SetActive (true);
289
291
  _search_bar->SetActiveEntry (_entry, section_id, search_string, (_entry == _home_entry));
290
292
 
291
293
  _entry->ForeachGroup (sigc::mem_fun (this, &PlacesView::OnGroupAdded));
292
 
  
 
294
 
293
295
  if (_entry != _home_entry)
294
296
    _entry->ForeachResult (sigc::mem_fun (this, &PlacesView::OnResultAdded));
295
297
 
480
482
    SetActiveEntry (_home_entry, section_id, search_string);
481
483
    return;
482
484
  }
483
 
  
 
485
 
484
486
  for (it = places.begin (); it != places.end (); ++it)
485
487
  {
486
488
    Place *place = static_cast<Place *> (*it);
535
537
  g_variant_builder_add (builder, "{sv}", "x", g_variant_new_int32 (geo.x));
536
538
  g_variant_builder_add (builder, "{sv}", "y", g_variant_new_int32 (geo.y));
537
539
  g_variant_builder_add (builder, "{sv}", "width", g_variant_new_int32 (geo.width));
538
 
  g_variant_builder_add (builder, "{sv}", "height", g_variant_new_int32 (geo.height)); 
 
540
  g_variant_builder_add (builder, "{sv}", "height", g_variant_new_int32 (geo.height));
539
541
}
540
542
 
541
543
//