diff options
-rw-r--r-- | guilib/GUIBaseContainer.cpp | 9 | ||||
-rw-r--r-- | guilib/GUIButtonScroller.cpp | 13 | ||||
-rw-r--r-- | guilib/GUIControlGroupList.cpp | 6 | ||||
-rw-r--r-- | guilib/GUIScrollBarControl.cpp | 8 | ||||
-rw-r--r-- | guilib/GUISelectButtonControl.cpp | 12 | ||||
-rw-r--r-- | guilib/GUISliderControl.cpp | 9 | ||||
-rw-r--r-- | guilib/GUISpinControl.cpp | 12 | ||||
-rw-r--r-- | guilib/GUIWindow.cpp | 6 | ||||
-rw-r--r-- | guilib/Key.h | 5 | ||||
-rw-r--r-- | xbmc/GUIWindowFullScreen.cpp | 11 | ||||
-rw-r--r-- | xbmc/GUIWindowOSD.cpp | 11 |
11 files changed, 66 insertions, 36 deletions
diff --git a/guilib/GUIBaseContainer.cpp b/guilib/GUIBaseContainer.cpp index 102a9f3a32..a69c01e454 100644 --- a/guilib/GUIBaseContainer.cpp +++ b/guilib/GUIBaseContainer.cpp @@ -552,9 +552,14 @@ bool CGUIBaseContainer::OnMouseEvent(const CPoint &point, const CMouseEvent &eve return true; } } - else if (event.m_id == ACTION_MOUSE_WHEEL) + else if (event.m_id == ACTION_MOUSE_WHEEL_UP) { - Scroll(-event.m_wheel); + Scroll(-1); + return true; + } + else if (event.m_id == ACTION_MOUSE_WHEEL_DOWN) + { + Scroll(1); return true; } return false; diff --git a/guilib/GUIButtonScroller.cpp b/guilib/GUIButtonScroller.cpp index 2db7e8831f..4091995201 100644 --- a/guilib/GUIButtonScroller.cpp +++ b/guilib/GUIButtonScroller.cpp @@ -902,12 +902,15 @@ bool CGUIButtonScroller::OnMouseEvent(const CPoint &point, const CMouseEvent &ev OnAction(CAction(ACTION_SELECT_ITEM)); return true; } - else if (event.m_id == ACTION_MOUSE_WHEEL) + else if (event.m_id == ACTION_MOUSE_WHEEL_UP) { - if (event.m_wheel > 0) - m_bScrollDown = true; - else - m_bScrollUp = true; + m_bScrollDown = true; + m_fScrollSpeed = SCROLL_SPEED; + return true; + } + else if (event.m_id == ACTION_MOUSE_WHEEL_DOWN) + { + m_bScrollUp = true; m_fScrollSpeed = SCROLL_SPEED; return true; } diff --git a/guilib/GUIControlGroupList.cpp b/guilib/GUIControlGroupList.cpp index 738ab86390..6f5daff21f 100644 --- a/guilib/GUIControlGroupList.cpp +++ b/guilib/GUIControlGroupList.cpp @@ -422,7 +422,7 @@ float CGUIControlGroupList::GetAlignOffset() const bool CGUIControlGroupList::OnMouseEvent(const CPoint &point, const CMouseEvent &event) { - if (event.m_id == ACTION_MOUSE_WHEEL) + if (event.m_id == ACTION_MOUSE_WHEEL_UP || event.m_id == ACTION_MOUSE_WHEEL_DOWN) { // find the current control and move to the next or previous float offset = 0; @@ -431,12 +431,12 @@ bool CGUIControlGroupList::OnMouseEvent(const CPoint &point, const CMouseEvent & CGUIControl *control = *it; if (!control->IsVisible()) continue; float nextOffset = offset + Size(control) + m_itemGap; - if (event.m_wheel < 0 && nextOffset > m_offset) // past our current offset + if (event.m_id == ACTION_MOUSE_WHEEL_DOWN && nextOffset > m_offset) // past our current offset { ScrollTo(nextOffset); return true; } - else if (event.m_wheel > 0 && nextOffset >= m_offset) // at least at our current offset + else if (event.m_id == ACTION_MOUSE_WHEEL_UP && nextOffset >= m_offset) // at least at our current offset { ScrollTo(offset); return true; diff --git a/guilib/GUIScrollBarControl.cpp b/guilib/GUIScrollBarControl.cpp index 201f997b5f..3281674faf 100644 --- a/guilib/GUIScrollBarControl.cpp +++ b/guilib/GUIScrollBarControl.cpp @@ -286,9 +286,13 @@ bool CGUIScrollBar::OnMouseEvent(const CPoint &point, const CMouseEvent &event) SetFromPosition(point); return true; } - else if (event.m_id == ACTION_MOUSE_WHEEL) + else if (event.m_id == ACTION_MOUSE_WHEEL_UP) { - Move(-event.m_wheel); + Move(-1); + } + else if (event.m_id == ACTION_MOUSE_WHEEL_DOWN) + { + Move(1); return true; } return false; diff --git a/guilib/GUISelectButtonControl.cpp b/guilib/GUISelectButtonControl.cpp index e3a73f2f5f..5c8201374f 100644 --- a/guilib/GUISelectButtonControl.cpp +++ b/guilib/GUISelectButtonControl.cpp @@ -370,12 +370,14 @@ bool CGUISelectButtonControl::OnMouseEvent(const CPoint &point, const CMouseEven CGUIButtonControl::OnMouseEvent(point, event); return true; } - else if (event.m_id == ACTION_MOUSE_WHEEL) + else if (event.m_id == ACTION_MOUSE_WHEEL_UP) { - if (event.m_wheel > 0) - OnLeft(); - else - OnRight(); + OnLeft(); + return true; + } + else if (event.m_id == ACTION_MOUSE_WHEEL_DOWN) + { + OnRight(); return true; } return false; diff --git a/guilib/GUISliderControl.cpp b/guilib/GUISliderControl.cpp index eccb346962..ccf2d829c4 100644 --- a/guilib/GUISliderControl.cpp +++ b/guilib/GUISliderControl.cpp @@ -333,9 +333,14 @@ bool CGUISliderControl::OnMouseEvent(const CPoint &point, const CMouseEvent &eve SetFromPosition(point); return true; } - else if (event.m_id == ACTION_MOUSE_WHEEL) + else if (event.m_id == ACTION_MOUSE_WHEEL_UP) { - Move(event.m_wheel*10); + Move(10); + return true; + } + else if (event.m_id == ACTION_MOUSE_WHEEL_DOWN) + { + Move(-10); return true; } return false; diff --git a/guilib/GUISpinControl.cpp b/guilib/GUISpinControl.cpp index 59676da085..10751ee124 100644 --- a/guilib/GUISpinControl.cpp +++ b/guilib/GUISpinControl.cpp @@ -871,12 +871,14 @@ bool CGUISpinControl::OnMouseEvent(const CPoint &point, const CMouseEvent &event MoveDown(); return true; } - else if (event.m_id == ACTION_MOUSE_WHEEL) + else if (event.m_id == ACTION_MOUSE_WHEEL_UP) { - if (event.m_wheel > 0) - MoveUp(); - else - MoveDown(); + MoveUp(); + return true; + } + else if (event.m_id == ACTION_MOUSE_WHEEL_DOWN) + { + MoveDown(); return true; } return false; diff --git a/guilib/GUIWindow.cpp b/guilib/GUIWindow.cpp index a16050a1a9..7eab33fb39 100644 --- a/guilib/GUIWindow.cpp +++ b/guilib/GUIWindow.cpp @@ -382,8 +382,10 @@ bool CGUIWindow::OnMouseAction() event = CMouseEvent(ACTION_MOUSE_DOUBLE_CLICK); else if (g_Mouse.bHold[MOUSE_LEFT_BUTTON]) event = CMouseEvent(ACTION_MOUSE_DRAG, g_Mouse.bHold[MOUSE_LEFT_BUTTON], 0, g_Mouse.GetLastMove().x, g_Mouse.GetLastMove().y); - else if (g_Mouse.GetWheel()) - event = CMouseEvent(ACTION_MOUSE_WHEEL, 0, g_Mouse.GetWheel()); + else if (g_Mouse.GetWheel() > 0) + event = CMouseEvent(ACTION_MOUSE_WHEEL_UP); + else if (g_Mouse.GetWheel() < 0) + event = CMouseEvent(ACTION_MOUSE_WHEEL_DOWN); if (m_exclusiveMouseControl) { diff --git a/guilib/Key.h b/guilib/Key.h index 3cdfdcae4a..f0d342edf9 100644 --- a/guilib/Key.h +++ b/guilib/Key.h @@ -184,8 +184,9 @@ #define ACTION_MOUSE_RIGHT_CLICK 101 #define ACTION_MOUSE_MIDDLE_CLICK 102 #define ACTION_MOUSE_DOUBLE_CLICK 103 -#define ACTION_MOUSE_WHEEL 104 -#define ACTION_MOUSE_DRAG 105 +#define ACTION_MOUSE_WHEEL_UP 104 +#define ACTION_MOUSE_WHEEL_DOWN 105 +#define ACTION_MOUSE_DRAG 106 #define ACTION_BACKSPACE 110 #define ACTION_SCROLL_UP 111 diff --git a/xbmc/GUIWindowFullScreen.cpp b/xbmc/GUIWindowFullScreen.cpp index 3db365357b..bc4eeec026 100644 --- a/xbmc/GUIWindowFullScreen.cpp +++ b/xbmc/GUIWindowFullScreen.cpp @@ -604,10 +604,13 @@ bool CGUIWindowFullScreen::OnMouseEvent(const CPoint &point, const CMouseEvent & { // no control found to absorb this click - pause video return g_application.OnAction(CAction(ACTION_PAUSE)); } - if (event.m_id == ACTION_MOUSE_WHEEL) - { // Mouse wheel - CAction action(event.m_wheel > 0 ? ACTION_ANALOG_SEEK_FORWARD : ACTION_ANALOG_SEEK_BACK, 0.5f * abs(event.m_wheel)); - return g_application.OnAction(action); + if (event.m_id == ACTION_MOUSE_WHEEL_UP) + { + return g_application.OnAction(CAction(ACTION_ANALOG_SEEK_FORWARD, 0.5f)); + } + if (event.m_id == ACTION_MOUSE_WHEEL_DOWN) + { + return g_application.OnAction(CAction(ACTION_ANALOG_SEEK_FORWARD, 0.5f)); } if (event.m_id || event.m_offsetX || event.m_offsetY) { // some other mouse action has occurred - bring up the OSD diff --git a/xbmc/GUIWindowOSD.cpp b/xbmc/GUIWindowOSD.cpp index 75e8c67f91..a3651150b6 100644 --- a/xbmc/GUIWindowOSD.cpp +++ b/xbmc/GUIWindowOSD.cpp @@ -72,10 +72,13 @@ bool CGUIWindowOSD::OnAction(const CAction &action) bool CGUIWindowOSD::OnMouseEvent(const CPoint &point, const CMouseEvent &event) { - if (event.m_id == ACTION_MOUSE_WHEEL) - { // Mouse wheel - CAction action(event.m_wheel > 0 ? ACTION_ANALOG_SEEK_FORWARD : ACTION_ANALOG_SEEK_BACK, 0.5f * abs(event.m_wheel)); - return g_application.OnAction(action); + if (event.m_id == ACTION_MOUSE_WHEEL_UP) + { + return g_application.OnAction(CAction(ACTION_ANALOG_SEEK_FORWARD, 0.5f)); + } + if (event.m_id == ACTION_MOUSE_WHEEL_DOWN) + { + return g_application.OnAction(CAction(ACTION_ANALOG_SEEK_FORWARD, 0.5f)); } if (event.m_id == ACTION_MOUSE_LEFT_CLICK) { // pause |