vcl/inc/verticaltabctrl.hxx     |    2 ++
 vcl/source/control/imivctl1.cxx |    4 ++--
 vcl/source/control/ivctrl.cxx   |   14 ++++++++++++++
 3 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 68260d7525aeaf38ac09ca9920fa1fa76dc8018a
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Mon Apr 29 15:14:48 2024 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Fri May 31 13:45:24 2024 +0200

    tdf#99528 Move through tabs with Ctrl-PageUp/Down keys
    
    As required by test_tab_navigation unit test
    
    Change-Id: Ia77aa57de420574922b4fd4a0759f18c2dc778f3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166856
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/vcl/inc/verticaltabctrl.hxx b/vcl/inc/verticaltabctrl.hxx
index e00770b8d1f8..99c6cfeceeb0 100644
--- a/vcl/inc/verticaltabctrl.hxx
+++ b/vcl/inc/verticaltabctrl.hxx
@@ -53,6 +53,8 @@ public:
     virtual ~VerticalTabControl() override;
     virtual void dispose() override;
 
+    virtual bool EventNotify(NotifyEvent& rNEvt) override;
+
     sal_uInt16 GetPageCount() const { return m_xChooser->GetEntryCount(); }
 
     const OUString& GetCurPageId() const { return m_sCurrentPageId; }
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 3071083494e1..ea69fbcfb99b 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -879,7 +879,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& 
rKEvt )
             if( pCursor )
             {
                 MakeEntryVisible( pCursor );
-                if( nCode == KEY_UP )
+                if( nCode == KEY_UP || (rKEvt.GetKeyCode().IsMod1() && nCode 
== KEY_PAGEUP))
                     pNewCursor = pImpCursor->GoUpDown(pCursor,false);
                 else
                     pNewCursor = pImpCursor->GoPageUpDown(pCursor,false);
@@ -901,7 +901,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& 
rKEvt )
         case KEY_PAGEDOWN:
             if( pCursor )
             {
-                if( nCode == KEY_DOWN )
+                if( nCode == KEY_DOWN || (rKEvt.GetKeyCode().IsMod1() && nCode 
== KEY_PAGEDOWN) )
                     pNewCursor=pImpCursor->GoUpDown( pCursor,true );
                 else
                     pNewCursor=pImpCursor->GoPageUpDown( pCursor,true );
diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx
index c7e76a75eab0..cb0c4e33d0c3 100644
--- a/vcl/source/control/ivctrl.cxx
+++ b/vcl/source/control/ivctrl.cxx
@@ -481,6 +481,20 @@ IMPL_LINK_NOARG(VerticalTabControl, ChosePageHdl_Impl, 
SvtIconChoiceCtrl*, void)
         SetCurPageId(pData->sId);
 }
 
+bool VerticalTabControl::EventNotify(NotifyEvent& rNEvt)
+{
+    if (rNEvt.GetType() == NotifyEventType::KEYINPUT)
+    {
+        sal_uInt16 nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode();
+        if (nCode == KEY_PAGEUP || nCode == KEY_PAGEDOWN)
+        {
+            m_xChooser->DoKeyInput(*(rNEvt.GetKeyEvent()));
+            return true;
+        }
+    }
+    return VclHBox::EventNotify(rNEvt);
+}
+
 void VerticalTabControl::ActivatePage()
 {
     m_aActivateHdl.Call( this );

Reply via email to