~unity-team/unity/5.0

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/HudView.cpp

Fixes closing the shurnk Hud when clicking outside it's geometry.. Fixes: https://bugs.launchpad.net/bugs/962651. Approved by Thomi Richards.

Show diffs side-by-side

added added

removed removed

Lines of Context:
357
357
{
358
358
  dash::Style& style = dash::Style::Instance();
359
359
 
360
 
  nux::VLayout* super_layout = new nux::VLayout(); 
 
360
  nux::VLayout* super_layout = new nux::VLayout();
361
361
  layout_ = new nux::HLayout();
362
362
  {
363
363
    // fill layout with icon
405
405
  {
406
406
    button->fake_focused = false;
407
407
  }
408
 
  
 
408
 
409
409
  if (!buttons_.empty())
410
410
    buttons_.back()->fake_focused = true;
411
411
}
424
424
 
425
425
void View::OnMouseButtonDown(int x, int y, unsigned long button, unsigned long key)
426
426
{
427
 
  if (!content_geo_.IsPointInside(x, y))
 
427
  nux::Geometry current_geo(content_geo_);
 
428
  current_geo.height = current_height_;
 
429
  if (!current_geo.IsPointInside(x, y))
428
430
  {
429
431
    ubus.SendMessage(UBUS_HUD_CLOSE_REQUEST);
430
432
  }
464
466
      x += content_width - 1;
465
467
      nux::GetPainter().Draw2DLine(gfx_context, x, y, x, y + height, nux::color::White * 0.13);
466
468
    }
467
 
 
 
469
 
468
470
    GetLayout()->ProcessDraw(gfx_context, force_draw);
469
471
    nux::GetPainter().PopBackgroundStack();
470
472
  }
504
506
{
505
507
  unsigned num_buttons = buttons_.size();
506
508
  variant::BuilderWrapper(builder)
507
 
    .add(GetGeometry())
 
509
    .add(content_geo_)
508
510
    .add("selected_button", selected_button_)
509
511
    .add("num_buttons", num_buttons);
510
512
}