diff options
author | Akshay Deep <akshaydeepiitr@gmail.com> | 2016-06-03 16:51:05 +0530 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-06-03 15:07:54 +0000 |
commit | 74f6f03f55eb6d641d2b26aae883943c69683563 (patch) | |
tree | 453c43e82fe0f6fd64241a67ba1fe003cd628774 | |
parent | 9b7bf60536bfab26445c0165f50392c1258c4cda (diff) |
Template Manager: Ctrl + A to select all templates
Change-Id: I8398268752c78a30d5fc076d6f2b6249cbf89ec2
Reviewed-on: https://gerrit.libreoffice.org/25860
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r-- | include/sfx2/templateabstractview.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/templatedefaultview.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/templateabstractview.cxx | 23 | ||||
-rw-r--r-- | sfx2/source/control/templatedefaultview.cxx | 5 |
4 files changed, 32 insertions, 0 deletions
diff --git a/include/sfx2/templateabstractview.hxx b/include/sfx2/templateabstractview.hxx index 5b70fe1710ba..5a7ddddb9e83 100644 --- a/include/sfx2/templateabstractview.hxx +++ b/include/sfx2/templateabstractview.hxx @@ -83,6 +83,8 @@ public: virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; + virtual void KeyInput( const KeyEvent& rKEvt ) override; + virtual void showAllTemplates () = 0; virtual void showRegion (TemplateContainerItem *pItem) = 0; diff --git a/include/sfx2/templatedefaultview.hxx b/include/sfx2/templatedefaultview.hxx index 24157a1facec..6d2fcdfab0e2 100644 --- a/include/sfx2/templatedefaultview.hxx +++ b/include/sfx2/templatedefaultview.hxx @@ -19,6 +19,8 @@ public: virtual void reload() override; + virtual void KeyInput( const KeyEvent& rKEvt ) override; + void createContextMenu(); DECL_LINK_TYPED(ContextMenuSelectHdl, Menu*, void); diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index 7bfd0a272b38..cf0f497b89ef 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -168,6 +168,29 @@ void TemplateAbstractView::MouseButtonDown( const MouseEvent& rMEvt ) ThumbnailView::MouseButtonDown(rMEvt); } +void TemplateAbstractView::KeyInput( const KeyEvent& rKEvt ) +{ + vcl::KeyCode aKeyCode = rKEvt.GetKeyCode(); + + if(aKeyCode == ( KEY_MOD1 | KEY_A ) ) + { + for (ThumbnailViewItem* pItem : mItemList) + { + if (!pItem->isSelected()) + { + pItem->setSelection(true); + maItemStateHdl.Call(pItem); + } + } + + if (IsReallyVisible() && IsUpdateMode()) + Invalidate(); + return; + } + + ThumbnailView::KeyInput(rKEvt); +} + void TemplateAbstractView::setOpenRegionHdl(const Link<void*,void> &rLink) { diff --git a/sfx2/source/control/templatedefaultview.cxx b/sfx2/source/control/templatedefaultview.cxx index 76e08eaecba9..d6ffb632f727 100644 --- a/sfx2/source/control/templatedefaultview.cxx +++ b/sfx2/source/control/templatedefaultview.cxx @@ -48,6 +48,11 @@ void TemplateDefaultView::reload() set_width_request(mnTextHeight + mnItemMaxSize + 2*mnItemPadding); } +void TemplateDefaultView::KeyInput( const KeyEvent& rKEvt ) +{ + ThumbnailView::KeyInput(rKEvt); +} + void TemplateDefaultView::createContextMenu() { std::unique_ptr<PopupMenu> pItemMenu(new PopupMenu); |