summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-06-15 15:44:33 +0900
committerAndras Timar <andras.timar@collabora.com>2019-06-17 15:08:37 +0200
commit74456219dc5c5716c023d69abc7ad6f7d90b4a33 (patch)
tree61f201bd0627079315c18339c67334b6abf62251
parent49943f9930e1794063f1e7353d37bc98b79c39e7 (diff)
tdf#124907 vcl: react to pan gesture for listbox and other widgetscd-6.0-29
Reviewed-on: https://gerrit.libreoffice.org/74087 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 08f485c6e92bd56c8c26171316b842cd213a8a09) Change-Id: I4579f8edd2bf24506b1d55a7291cd86e276f30a4 Reviewed-on: https://gerrit.libreoffice.org/74164 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--vcl/source/control/listctrl.cxx10
-rw-r--r--vcl/source/edit/vclmedit.cxx8
-rw-r--r--vcl/source/treelist/svimpbox.cxx10
3 files changed, 19 insertions, 9 deletions
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)
{