~ci-train-bot/unity/unity-ubuntu-xenial-landing-007

« back to all changes in this revision

Viewing changes to launcher/SwitcherView.cpp

  • Committer: CI Train Bot
  • Author(s): handsome_feng, Andrea Azzarone, Marco Trevisan (Treviño)
  • Date: 2016-05-26 00:03:21 UTC
  • mfrom: (4106.1.12 unity-xenial)
  • Revision ID: ci-train-bot@canonical.com-20160526000321-l3pnjxixwy54lf5a
Releasing unity SRU1 for Xenial Fixes: #1525685, #1553165, #1562348, #1562847, #1570843, #1572241, #1573897, #1574689, #1575527, #1580211, #1580212

Show diffs side-by-side

added added

removed removed

Lines of Context:
381
381
  int detail_icon_index = DetailIconIdexAt(mouse_pos.x, mouse_pos.y);
382
382
 
383
383
  last_detail_icon_selected_ = detail_icon_index;
384
 
 
385
 
  switcher_mouse_down.emit(detail_icon_index, button);
386
384
}
387
385
 
388
386
void SwitcherView::HandleMouseDown(int x, int y, int button)
390
388
  int icon_index = IconIndexAt(x,y);
391
389
 
392
390
  last_icon_selected_ = icon_index;
393
 
 
394
 
  switcher_mouse_down.emit(icon_index, button);
395
391
}
396
392
 
397
393
void SwitcherView::RecvMouseUp(int x, int y, unsigned long button_flags, unsigned long /*key_flags*/)
413
409
  nux::Point const& mouse_pos = CalculateMouseMonitorOffset(x, y);
414
410
  int detail_icon_index = DetailIconIdexAt(mouse_pos.x, mouse_pos.y);
415
411
 
416
 
  switcher_mouse_up.emit(detail_icon_index, button);
417
 
 
418
412
  if (button == 1)
419
413
  {
420
414
    if (detail_icon_index >= 0 && detail_icon_index == last_detail_icon_selected_)
437
431
{
438
432
  int icon_index = IconIndexAt(x,y);
439
433
 
440
 
  switcher_mouse_up.emit(icon_index, button);
441
 
 
442
 
  if (button == 1)
 
434
  if (button == 1 || button == 2 || button == 3)
443
435
  {
444
436
    if (icon_index >= 0 && icon_index == last_icon_selected_)
445
437
    {
446
438
      model_->Select(icon_index);
447
 
      hide_request.emit(true);
 
439
 
 
440
      if (button == 1)
 
441
        hide_request.emit(true);
 
442
      else if (button == 2)
 
443
        switcher_close_current.emit();
 
444
      else if (button == 3)
 
445
        switcher_start_detail.emit();
448
446
    }
449
447
  }
450
448
}