summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2019-05-05 17:22:59 -0800
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2019-05-23 10:08:04 +0200
commitcf4c1bcc2c309ce3dcf1fceda8133a9a8f6a9556 (patch)
tree23352398d02fe8f6003b2beda62aa5119367746c /sfx2
parent9fbc8648c23398a7f70890162178ad833c735934 (diff)
tdf#123793 Add kb tab navigation to special chars popup window
...and keep the 'More Characters...' button as first focused Change-Id: Iab4cb00aaed9250f0cc7f35f27af48eb326f2a48 Reviewed-on: https://gerrit.libreoffice.org/71834 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com> (cherry picked from commit caa6de6c97b0c2fc82c6a2699a1e84b9d2eb9dbd) Reviewed-on: https://gerrit.libreoffice.org/72772 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/charmapcontrol.cxx40
1 files changed, 34 insertions, 6 deletions
diff --git a/sfx2/source/control/charmapcontrol.cxx b/sfx2/source/control/charmapcontrol.cxx
index 8bb684b8e9c1..7f757a7eb4df 100644
--- a/sfx2/source/control/charmapcontrol.cxx
+++ b/sfx2/source/control/charmapcontrol.cxx
@@ -20,6 +20,7 @@
#include <comphelper/dispatchcommand.hxx>
#include <officecfg/Office/Common.hxx>
#include <sfx2/charmapcontrol.hxx>
+#include <vcl/event.hxx>
using namespace css;
@@ -64,10 +65,14 @@ SfxCharmapCtrl::SfxCharmapCtrl(sal_uInt16 nId, vcl::Window* pParent, const css::
for(int i = 0; i < 16; i++)
{
+ m_pRecentCharView[i]->SetStyle(m_pRecentCharView[i]->GetStyle() | WB_GROUP);
m_pRecentCharView[i]->setMouseClickHdl(LINK(this,SfxCharmapCtrl, CharClickHdl));
- m_pRecentCharView[i]->SetLoseFocusHdl(LINK(this,SfxCharmapCtrl, LoseFocusHdl));
+ m_pRecentCharView[i]->SetGetFocusHdl(LINK(this,SfxCharmapCtrl, FocusHdl));
+ m_pRecentCharView[i]->SetLoseFocusHdl(LINK(this,SfxCharmapCtrl, FocusHdl));
+ m_pFavCharView[i]->SetStyle(m_pFavCharView[i]->GetStyle() | WB_GROUP);
m_pFavCharView[i]->setMouseClickHdl(LINK(this,SfxCharmapCtrl, CharClickHdl));
- m_pFavCharView[i]->SetLoseFocusHdl(LINK(this,SfxCharmapCtrl, LoseFocusHdl));
+ m_pFavCharView[i]->SetGetFocusHdl(LINK(this,SfxCharmapCtrl, FocusHdl));
+ m_pFavCharView[i]->SetLoseFocusHdl(LINK(this,SfxCharmapCtrl, FocusHdl));
}
maDlgBtn->SetClickHdl(LINK(this, SfxCharmapCtrl, OpenDlgHdl));
@@ -177,7 +182,32 @@ void SfxCharmapCtrl::updateRecentCharControl()
}
-IMPL_STATIC_LINK(SfxCharmapCtrl, LoseFocusHdl, Control&, pItem, void)
+bool SfxCharmapCtrl::EventNotify( NotifyEvent& rNEvt )
+{
+ static bool bNeedsInit = true;
+ if ( maDlgBtn->HasFocus() && rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
+ {
+ const vcl::KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
+ const sal_uInt16 nCode = rKey.GetCode();
+ if ( nCode != KEY_TAB && nCode != KEY_RETURN && nCode != KEY_SPACE && nCode != KEY_ESCAPE )
+ {
+ return true;
+ }
+ if ( bNeedsInit && nCode == KEY_TAB )
+ {
+ for(int i = 0; i < 16; i++)
+ {
+ m_pRecentCharView[i]->set_property( "can-focus", "true" );
+ m_pFavCharView[i]->set_property( "can-focus", "true" );
+ }
+ bNeedsInit = false;
+ }
+ }
+ return SfxPopupWindow::EventNotify( rNEvt );
+}
+
+
+IMPL_STATIC_LINK(SfxCharmapCtrl, FocusHdl, Control&, pItem, void)
{
pItem.Invalidate();
}
@@ -185,10 +215,8 @@ IMPL_STATIC_LINK(SfxCharmapCtrl, LoseFocusHdl, Control&, pItem, void)
IMPL_LINK(SfxCharmapCtrl, CharClickHdl, SvxCharViewControl*, rView, void)
{
- rView->GrabFocus();
- rView->Invalidate();
rView->InsertCharToDoc();
-
+ GrabFocusToDocument();
Close();
}