[Libreoffice-commits] core.git: include/sfx2 sfx2/source
Maxim Monastirsky
momonasmon at gmail.com
Wed May 14 06:31:29 PDT 2014
include/sfx2/recentdocsview.hxx | 2 ++
include/sfx2/recentdocsviewitem.hxx | 2 +-
include/sfx2/thumbnailviewitem.hxx | 2 +-
sfx2/source/control/recentdocsview.cxx | 16 ++++++++++++----
sfx2/source/control/recentdocsviewitem.cxx | 2 +-
5 files changed, 17 insertions(+), 7 deletions(-)
New commits:
commit 4a902e0c59b0dd01e6459c226268bdee4f15489a
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Wed May 14 16:06:42 2014 +0300
Revert "startcenter: react on mouse down instead"
This reverts commit 1a2a961c1e7cdef648c28e211433e8de6e8a831b.
As suggested by Kendy, opening with a single click
by mouse up is more natural. We need to find a better
solution for the bug mentioned in the above commit.
diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx
index 0ebf30e..c1ba062 100644
--- a/include/sfx2/recentdocsview.hxx
+++ b/include/sfx2/recentdocsview.hxx
@@ -63,6 +63,8 @@ public:
protected:
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+ virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
+
virtual void OnItemDblClicked(ThumbnailViewItem *pItem) SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
diff --git a/include/sfx2/recentdocsviewitem.hxx b/include/sfx2/recentdocsviewitem.hxx
index 71b6474..b1a51fe 100644
--- a/include/sfx2/recentdocsviewitem.hxx
+++ b/include/sfx2/recentdocsviewitem.hxx
@@ -33,7 +33,7 @@ public:
virtual void Paint(drawinglayer::processor2d::BaseProcessor2D *pProcessor,
const ThumbnailItemAttributes *pAttrs) SAL_OVERRIDE;
- virtual void MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE;
+ virtual void MouseButtonUp(const MouseEvent& rMEvt) SAL_OVERRIDE;
/// Called when the user clicks a document - it will open it.
void OpenDocument();
diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx
index cf3e860..ee4fd7f 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -129,7 +129,7 @@ public:
static drawinglayer::primitive2d::PolygonHairlinePrimitive2D*
createBorderLine (const basegfx::B2DPolygon &rPolygon);
- virtual void MouseButtonDown(const MouseEvent&) {}
+ virtual void MouseButtonUp(const MouseEvent&) {}
protected:
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index b4be9c8..0564e8b 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -213,19 +213,27 @@ void RecentDocsView::MouseButtonDown( const MouseEvent& rMEvt )
{
if (rMEvt.IsLeft())
{
- if (rMEvt.GetClicks() > 1)
- return;
+ // ignore to avoid stuff done in ThumbnailView; we don't do selections etc.
+ return;
+ }
+
+ ThumbnailView::MouseButtonDown(rMEvt);
+}
+void RecentDocsView::MouseButtonUp(const MouseEvent& rMEvt)
+{
+ if (rMEvt.IsLeft())
+ {
size_t nPos = ImplGetItem(rMEvt.GetPosPixel());
ThumbnailViewItem* pItem = ImplGetItem(nPos);
if (pItem)
{
- pItem->MouseButtonDown(rMEvt);
+ pItem->MouseButtonUp(rMEvt);
return;
}
}
- ThumbnailView::MouseButtonDown(rMEvt);
+ ThumbnailView::MouseButtonUp(rMEvt);
}
void RecentDocsView::OnItemDblClicked(ThumbnailViewItem *)
diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx
index 0dfef15..aa2a7e0 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -182,7 +182,7 @@ void RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc
}
}
-void RecentDocsViewItem::MouseButtonDown(const MouseEvent& rMEvt)
+void RecentDocsViewItem::MouseButtonUp(const MouseEvent& rMEvt)
{
if (rMEvt.IsLeft())
{
More information about the Libreoffice-commits
mailing list