[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Akshay Deep akshaydeepiitr at gmail.com
Fri Jun 3 15:08:26 UTC 2016


 include/sfx2/templateabstractview.hxx        |    2 ++
 include/sfx2/templatedefaultview.hxx         |    2 ++
 sfx2/source/control/templateabstractview.cxx |   23 +++++++++++++++++++++++
 sfx2/source/control/templatedefaultview.cxx  |    5 +++++
 4 files changed, 32 insertions(+)

New commits:
commit 74f6f03f55eb6d641d2b26aae883943c69683563
Author: Akshay Deep <akshaydeepiitr at gmail.com>
Date:   Fri Jun 3 16:51:05 2016 +0530

    Template Manager: Ctrl + A to select all templates
    
    Change-Id: I8398268752c78a30d5fc076d6f2b6249cbf89ec2
    Reviewed-on: https://gerrit.libreoffice.org/25860
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/include/sfx2/templateabstractview.hxx b/include/sfx2/templateabstractview.hxx
index 5b70fe1..5a7dddd 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 24157a1..6d2fcdf 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 7bfd0a2..cf0f497 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 76e08ea..d6ffb63 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);


More information about the Libreoffice-commits mailing list