From 74456219dc5c5716c023d69abc7ad6f7d90b4a33 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sat, 15 Jun 2019 15:44:33 +0900 Subject: tdf#124907 vcl: react to pan gesture for listbox and other widgets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://gerrit.libreoffice.org/74087 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 08f485c6e92bd56c8c26171316b842cd213a8a09) Change-Id: I4579f8edd2bf24506b1d55a7291cd86e276f30a4 Reviewed-on: https://gerrit.libreoffice.org/74164 Reviewed-by: Andras Timar Tested-by: Andras Timar --- vcl/source/control/listctrl.cxx | 10 ++++++++-- vcl/source/edit/vclmedit.cxx | 8 +++++--- vcl/source/treelist/svimpbox.cxx | 10 ++++++---- 3 files changed, 19 insertions(+), 9 deletions(-) (limited to 'vcl/source') diff --git a/vcl/source/control/listctrl.cxx b/vcl/source/control/listctrl.cxx index 50b03eddc918..62f6a1dbc90a 100644 --- a/vcl/source/control/listctrl.cxx +++ b/vcl/source/control/listctrl.cxx @@ -158,9 +158,15 @@ bool ListControl::EventNotify( NotifyEvent& rNEvt ) if (rNEvt.GetType() == MouseNotifyEvent::COMMAND) { const CommandEvent* pEvent = rNEvt.GetCommandEvent(); - if (pEvent && pEvent->GetCommand() == CommandEventId::Wheel) + if (pEvent) { - HandleScrollCommand(*pEvent, nullptr, mpScrollBar.get()); + CommandEventId nCommand = pEvent->GetCommand(); + + if (nCommand == CommandEventId::Wheel || + nCommand == CommandEventId::Gesture) + { + HandleScrollCommand(*pEvent, nullptr, mpScrollBar.get()); + } } } return true; diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index 759bef4e6a68..66eadf02c28d 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -693,9 +693,11 @@ void ImpVclMEdit::Enable( bool bEnable ) bool ImpVclMEdit::HandleCommand( const CommandEvent& rCEvt ) { bool bDone = false; - if ( ( rCEvt.GetCommand() == CommandEventId::Wheel ) || - ( rCEvt.GetCommand() == CommandEventId::StartAutoScroll ) || - ( rCEvt.GetCommand() == CommandEventId::AutoScroll ) ) + CommandEventId nCommand = rCEvt.GetCommand(); + if (nCommand == CommandEventId::Wheel || + nCommand == CommandEventId::StartAutoScroll || + nCommand == CommandEventId::AutoScroll || + nCommand == CommandEventId::Gesture) { (void)mpTextWindow->HandleScrollCommand( rCEvt, mpHScrollBar, mpVScrollBar ); bDone = true; diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index be0ccf735446..e7d4370c7365 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -2850,10 +2850,12 @@ void SvImpLBox::Command(const CommandEvent& rCEvt) aEditIdle.Stop(); // scroll mouse event? - if (((nCommand == CommandEventId::Wheel) || (nCommand == CommandEventId::StartAutoScroll) - || (nCommand == CommandEventId::AutoScroll)) - && pView->HandleScrollCommand(rCEvt, aHorSBar.get(), aVerSBar.get())) - return; + if (nCommand == CommandEventId::Wheel || nCommand == CommandEventId::StartAutoScroll + || nCommand == CommandEventId::AutoScroll || nCommand == CommandEventId::Gesture) + { + if (pView->HandleScrollCommand(rCEvt, aHorSBar.get(), aVerSBar.get())) + return; + } if (bContextMenuHandling && nCommand == CommandEventId::ContextMenu) { -- cgit