diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2024-04-29 15:14:48 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2024-05-31 13:45:24 +0200 |
commit | 68260d7525aeaf38ac09ca9920fa1fa76dc8018a (patch) | |
tree | cc7254138ecd8180133273a34d61fcd55d0d76c5 /vcl/source | |
parent | e00479404af5058b982c447e485af995d552e372 (diff) |
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.mehrbrodt@allotropia.de>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/imivctl1.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/ivctrl.cxx | 14 |
2 files changed, 16 insertions, 2 deletions
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 ); |