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

Akshay Deep akshaydeepiitr at gmail.com
Wed Oct 5 20:08:19 UTC 2016


 include/sfx2/templatedefaultview.hxx        |    2 ++
 sfx2/source/control/templatedefaultview.cxx |   15 +++++++++++++++
 2 files changed, 17 insertions(+)

New commits:
commit 9167f75c87c5a062c39ee63c4071061518f63b49
Author: Akshay Deep <akshaydeepiitr at gmail.com>
Date:   Mon Sep 26 15:42:01 2016 +0530

    tdf#102238 START CENTER: Templates should be activated with single click
    
    Change-Id: If38f8fffd959c50b3befd521d2110e4c54e86be5
    Reviewed-on: https://gerrit.libreoffice.org/29295
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/include/sfx2/templatedefaultview.hxx b/include/sfx2/templatedefaultview.hxx
index c29c2c9..b35ac2f 100644
--- a/include/sfx2/templatedefaultview.hxx
+++ b/include/sfx2/templatedefaultview.hxx
@@ -23,6 +23,8 @@ public:
 
     virtual void KeyInput( const KeyEvent& rKEvt ) override;
 
+    virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
+
     void createContextMenu();
 
     DECL_LINK(ContextMenuSelectHdl, Menu*, void);
diff --git a/sfx2/source/control/templatedefaultview.cxx b/sfx2/source/control/templatedefaultview.cxx
index 5e2d0fc..de3c20e 100644
--- a/sfx2/source/control/templatedefaultview.cxx
+++ b/sfx2/source/control/templatedefaultview.cxx
@@ -61,6 +61,21 @@ void TemplateDefaultView::KeyInput( const KeyEvent& rKEvt )
     ThumbnailView::KeyInput(rKEvt);
 }
 
+void TemplateDefaultView::MouseButtonDown( const MouseEvent& rMEvt )
+{
+    if( rMEvt.IsLeft() && rMEvt.GetClicks() == 1 )
+    {
+        size_t nPos = ImplGetItem(rMEvt.GetPosPixel());
+        ThumbnailViewItem* pItem = ImplGetItem(nPos);
+        TemplateViewItem* pViewItem = dynamic_cast<TemplateViewItem*>(pItem);
+        if(pViewItem)
+            maOpenTemplateHdl.Call(pViewItem);
+        return;
+    }
+
+    TemplateLocalView::MouseButtonDown(rMEvt);
+}
+
 void TemplateDefaultView::createContextMenu()
 {
     ScopedVclPtrInstance<PopupMenu> pItemMenu;


More information about the Libreoffice-commits mailing list