Skip to content

Commit

Permalink
Template Manager: Ctrl + A to select all templates
Browse files Browse the repository at this point in the history
Change-Id: I8398268752c78a30d5fc076d6f2b6249cbf89ec2
Reviewed-on: https://gerrit.libreoffice.org/25860
Reviewed-by: Samuel Mehrbrodt <[email protected]>
Tested-by: Samuel Mehrbrodt <[email protected]>
  • Loading branch information
akkisna authored and smehrbrodt committed Jun 3, 2016
1 parent 9b7bf60 commit 74f6f03
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/sfx2/templateabstractview.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions include/sfx2/templatedefaultview.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public:

virtual void reload() override;

virtual void KeyInput( const KeyEvent& rKEvt ) override;

void createContextMenu();

DECL_LINK_TYPED(ContextMenuSelectHdl, Menu*, void);
Expand Down
23 changes: 23 additions & 0 deletions sfx2/source/control/templateabstractview.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 5 additions & 0 deletions sfx2/source/control/templatedefaultview.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 74f6f03

Please sign in to comment.