[Libreoffice-commits] core.git: vcl/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 17 10:19:27 UTC 2019


 vcl/source/control/listctrl.cxx  |   10 ++++++++--
 vcl/source/edit/vclmedit.cxx     |    8 +++++---
 vcl/source/treelist/svimpbox.cxx |   11 ++++++++---
 3 files changed, 21 insertions(+), 8 deletions(-)

New commits:
commit 08f485c6e92bd56c8c26171316b842cd213a8a09
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Jun 15 15:44:33 2019 +0900
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Jun 17 12:18:41 2019 +0200

    tdf#124907 vcl: react to pan gesture for listbox and other widgets
    
    Change-Id: I4579f8edd2bf24506b1d55a7291cd86e276f30a4
    Reviewed-on: https://gerrit.libreoffice.org/74087
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/source/control/listctrl.cxx b/vcl/source/control/listctrl.cxx
index b3b4a1a2ca20..7ac9ee0f6773 100644
--- a/vcl/source/control/listctrl.cxx
+++ b/vcl/source/control/listctrl.cxx
@@ -161,9 +161,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 1419602fa34b..df9e23683d62 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -625,9 +625,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)
     {
         ScrollBar* pHScrollBar = mpHScrollBar->IsVisible() ? mpHScrollBar.get() : nullptr;
         ScrollBar* pVScrollBar = mpVScrollBar->IsVisible() ? mpVScrollBar.get() : nullptr;
diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index e9b88fdf92b6..41bc706bab17 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -2895,15 +2895,20 @@ void SvImpLBox::PaintDDCursor(SvTreeListEntry* pEntry, bool bShow)
 
 void SvImpLBox::Command( const CommandEvent& rCEvt )
 {
-    CommandEventId   nCommand = rCEvt.GetCommand();
+    CommandEventId nCommand = rCEvt.GetCommand();
 
     if( nCommand == CommandEventId::ContextMenu )
         m_aEditIdle.Stop();
 
     // scroll mouse event?
-    if( ( ( nCommand == CommandEventId::Wheel ) || ( nCommand == CommandEventId::StartAutoScroll ) || ( nCommand == CommandEventId::AutoScroll ) )
-        && m_pView->HandleScrollCommand( rCEvt, m_aHorSBar.get(), m_aVerSBar.get() ) )
+    if (nCommand == CommandEventId::Wheel ||
+        nCommand == CommandEventId::StartAutoScroll ||
+        nCommand == CommandEventId::AutoScroll ||
+        nCommand == CommandEventId::Gesture)
+    {
+        if (m_pView->HandleScrollCommand(rCEvt, m_aHorSBar.get(), m_aVerSBar.get()))
             return;
+    }
 
     if( m_bContextMenuHandling && nCommand == CommandEventId::ContextMenu )
     {


More information about the Libreoffice-commits mailing list