~unity-team/nux/areas-unqueue-relayout

« back to all changes in this revision

Viewing changes to Nux/ScrollView.cpp

  • Committer: CI bot
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2014-07-31 14:58:05 UTC
  • mfrom: (845.1.2 nux)
  • Revision ID: ps-jenkins@lists.canonical.com-20140731145805-s43i9dbq2bzae6rm
ScrollView: correctly handle vertical and horizontal scrolling Fixes: 1228093
Approved by: Christopher Townsend

Show diffs side-by-side

added added

removed removed

Lines of Context:
712
712
  {
713
713
    // nux can't tell the difference between horizontal and vertical mouse wheel events
714
714
    // so we are only going to support vertical
715
 
    if (wheel_delta < 0)
716
 
    {
717
 
      ScrollDown(abs(wheel_delta / NUX_MOUSEWHEEL_DELTA), m_MouseWheelScrollSize);
718
 
    }
719
 
    else
720
 
    {
721
 
      ScrollUp(abs(wheel_delta / NUX_MOUSEWHEEL_DELTA), m_MouseWheelScrollSize);
722
 
    }
 
715
    if (abs(wheel_delta) == NUX_MOUSEWHEEL_DELTA)
 
716
    {
 
717
      // Vertical Scrolling
 
718
      if (wheel_delta < 0)
 
719
      {
 
720
        ScrollDown(1, m_MouseWheelScrollSize);
 
721
      }
 
722
      else
 
723
      {
 
724
        ScrollUp(1, m_MouseWheelScrollSize);
 
725
      }
 
726
    }
 
727
    else if (abs(wheel_delta) == (NUX_MOUSEWHEEL_DELTA ^ 2))
 
728
    {
 
729
      // Horizontal Scrolling
 
730
      if (wheel_delta < 0)
 
731
      {
 
732
        ScrollRight(1, m_MouseWheelScrollSize);
 
733
      }
 
734
      else
 
735
      {
 
736
        ScrollLeft(1, m_MouseWheelScrollSize);
 
737
      }
 
738
    }
 
739
    
723
740
  }
724
741
 
725
742
  bool ScrollView::AcceptKeyNavFocus()