summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2013-12-13 11:35:57 +0100
committerJan Holesovsky <kendy@collabora.com>2013-12-13 13:03:48 +0100
commitcb144fefc4910414b95ca2fcbb90b5863e2fc996 (patch)
tree320e808ce25662a685e91ab15ac25083afa82282 /sfx2
parenta18d38c7900528082d197a93bc9517223f4c4288 (diff)
startcenter: Implement mouse over effect.
Change-Id: I9beea6119dbb1c12ff053e5776f15d40a3389a8b
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/thumbnailview.cxx35
-rw-r--r--sfx2/source/control/thumbnailviewitem.cxx17
2 files changed, 37 insertions, 15 deletions
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 592c8b64daed..6886fac7bc4c 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -83,27 +83,38 @@ ThumbnailView::~ThumbnailView()
ImplDeleteItems();
}
-void ThumbnailView::MouseMove( const MouseEvent& rMEvt )
+void ThumbnailView::MouseMove(const MouseEvent& rMEvt)
{
- if ( !mbShowTooltips )
- return;
-
- (void) rMEvt; // unused parameter
- size_t nItemCount = mFilteredItemList.size();
- Point aPoint = GetPointerState().maPos;
- OUString aHelp;
+ size_t nItemCount = mFilteredItemList.size();
+ Point aPoint = GetPointerState().maPos;
+ OUString aHelp;
- for ( size_t i = 0; i < nItemCount; i++ )
+ for (size_t i = 0; i < nItemCount; i++)
{
+ bool bNeedsPaint = false;
ThumbnailViewItem *pItem = mFilteredItemList[i];
- if ( pItem->mbVisible && pItem->getDrawArea().IsInside(aPoint) )
+
+ if (pItem->mbVisible && !rMEvt.IsLeaveWindow() && pItem->getDrawArea().IsInside(aPoint))
{
aHelp = pItem->maTitle;
- break;
+
+ if (!pItem->isHighlighted())
+ bNeedsPaint = true;
+ pItem->setHighlight(true);
}
+ else
+ {
+ if (pItem->isHighlighted())
+ bNeedsPaint = true;
+ pItem->setHighlight(false);
+ }
+
+ if (bNeedsPaint && IsReallyVisible() && IsUpdateMode())
+ Invalidate(pItem->getDrawArea());
}
- SetQuickHelpText(aHelp);
+ if (mbShowTooltips)
+ SetQuickHelpText(aHelp);
}
void ThumbnailView::AppendItem(ThumbnailViewItem *pItem)
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index 791d981f157d..097aae7885a5 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -37,6 +37,7 @@
#include <vcl/graph.hxx>
#include <vcl/svapp.hxx>
#include <vcl/texteng.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
using namespace basegfx;
using namespace basegfx::tools;
@@ -245,15 +246,25 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
{
BColor aFillColor = pAttrs->aFillColor;
drawinglayer::primitive2d::Primitive2DSequence aSeq(4);
+ double fTransparence = 0.0;
// Draw background
- if ( mbSelected || mbHover )
+ if (mbSelected || mbHover)
aFillColor = pAttrs->aHighlightColor;
+ if (mbHover)
+ {
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ fTransparence = aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01;
+ }
+
sal_uInt32 nPrimitive = 0;
- aSeq[nPrimitive++] = drawinglayer::primitive2d::Primitive2DReference( new PolyPolygonColorPrimitive2D(
+ aSeq[nPrimitive++] = drawinglayer::primitive2d::Primitive2DReference( new PolyPolygonSelectionPrimitive2D(
B2DPolyPolygon(Polygon(maDrawArea,5,5).getB2DPolygon()),
- aFillColor));
+ aFillColor,
+ fTransparence,
+ 0.0,
+ true));
// Draw thumbnail
Point aPos = maPrev1Pos;