~unity-team/unity/trunk

« back to all changes in this revision

Viewing changes to dash/ResultViewGrid.cpp

  • Committer: Tarmac
  • Author(s): Nick Dedekind
  • Date: 2012-09-24 16:47:33 UTC
  • mfrom: (2720.1.4 unity.other)
  • Revision ID: tarmac-20120924164733-gtapoh3enb4z53ik
Menu key opens preview for selected item in dash lens.. Fixes: https://bugs.launchpad.net/bugs/1045831. Approved by Brandon Schaefer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
347
347
    case NUX_KP_ENTER:
348
348
      direction = nux::KeyNavDirection::KEY_NAV_ENTER;
349
349
      break;
 
350
    case XK_Menu:
 
351
      return true;
350
352
    default:
351
353
      direction = nux::KeyNavDirection::KEY_NAV_NONE;
352
354
      break;
478
480
  ubus_.SendMessage(UBUS_RESULT_VIEW_KEYNAV_CHANGED,
479
481
                    g_variant_new("(iiii)", focused_x, focused_y, renderer_->width(), renderer_->height()));
480
482
  selection_change.emit();
 
483
 
 
484
  if (event_type == nux::NUX_KEYDOWN && event_keysym == XK_Menu)
 
485
  {
 
486
    UriActivated.emit (focused_uri_, ResultView::ActivateType::PREVIEW);
 
487
    int left_results = selected_index_;
 
488
    int right_results = (num_results - selected_index_) - 1;
 
489
    //FIXME - just uses y right now, needs to use the absolute position of the bottom of the result 
 
490
    ubus_.SendMessage(UBUS_DASH_PREVIEW_INFO_PAYLOAD, 
 
491
                              g_variant_new("(iii)", mouse_last_y_, left_results, right_results)); 
 
492
  }
481
493
}
482
494
 
483
495
nux::Area* ResultViewGrid::KeyNavIteration(nux::KeyNavDirection direction)