summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/contnr/svimpbox.cxx24
-rw-r--r--svtools/source/contnr/treelistbox.cxx12
-rw-r--r--svtools/source/contnr/viewdataentry.cxx2
-rw-r--r--svtools/source/inc/svimpbox.hxx2
4 files changed, 23 insertions, 17 deletions
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 6153f987efd3..2432a74246d9 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -2879,23 +2879,19 @@ IMPL_LINK_NOARG(SvImpLBox, BeginDragHdl, Timer *, void)
pView->StartDrag( 0, aAsyncBeginDragPos );
}
-void SvImpLBox::PaintDDCursor( SvTreeListEntry* pInsertionPos )
+void SvImpLBox::PaintDDCursor(SvTreeListEntry* pEntry, bool bShow)
{
- long nY;
- if( pInsertionPos )
+ if (pEntry)
{
- nY = GetEntryLine( pInsertionPos );
- nY += pView->GetEntryHeight();
+ SvViewDataEntry* pViewData = pView->GetViewData(pEntry);
+ pViewData->SetDragTarget(bShow);
+#ifdef MACOSX
+ // in MacOS we need to draw directly (as we are synchronuous) or no invalidation happens
+ pView->PaintEntry1(*pEntry, GetEntryLine(pEntry), *pView);
+#else
+ InvalidateEntry(pEntry);
+#endif
}
- else
- nY = 1;
- RasterOp eOldOp = pView->GetRasterOp();
- pView->SetRasterOp( RasterOp::Invert );
- Color aOldLineColor = pView->GetLineColor();
- pView->SetLineColor( Color( COL_BLACK ) );
- pView->DrawLine( Point( 0, nY ), Point( aOutputSize.Width(), nY ) );
- pView->SetLineColor( aOldLineColor );
- pView->SetRasterOp( eOldOp );
}
void SvImpLBox::Command( const CommandEvent& rCEvt )
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 45a789633a87..f41e907c11c4 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -701,7 +701,7 @@ void SvTreeListBox::ImplShowTargetEmphasis( SvTreeListEntry* pEntry, bool bShow)
return;
if ( !bShow && !(nImpFlags & SvTreeListBoxFlags::TARGEMPH_VIS) )
return;
- pImpl->PaintDDCursor( pEntry );
+ pImpl->PaintDDCursor( pEntry, bShow);
if( bShow )
nImpFlags |= SvTreeListBoxFlags::TARGEMPH_VIS;
else
@@ -2657,7 +2657,6 @@ void SvTreeListBox::InvalidateEntry(SvTreeListEntry* pEntry)
void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::RenderContext& rRenderContext)
{
-
tools::Rectangle aRect; // multi purpose
bool bHorSBar = pImpl->HasHorScrollBar();
@@ -2850,6 +2849,15 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
nCurTab++;
}
+ if (pViewDataEntry->IsDragTarget())
+ {
+ rRenderContext.Push();
+ rRenderContext.SetLineColor(rSettings.GetDeactiveColor());
+ rRenderContext.SetFillColor(rSettings.GetDeactiveColor());
+ rRenderContext.DrawRect(tools::Rectangle(Point(0, nLine + nTempEntryHeight - 2), Size(nWidth, 2)));
+ rRenderContext.Pop();
+ }
+
if (bCurFontIsSel)
{
rRenderContext.SetTextColor(aBackupTextColor);
diff --git a/svtools/source/contnr/viewdataentry.cxx b/svtools/source/contnr/viewdataentry.cxx
index 53795b414db2..f9fcc630ce79 100644
--- a/svtools/source/contnr/viewdataentry.cxx
+++ b/svtools/source/contnr/viewdataentry.cxx
@@ -26,6 +26,7 @@ SvViewDataEntry::SvViewDataEntry() :
mbExpanded(false),
mbFocused(false),
mbSelectable(true),
+ mbDragTarget(false),
maPaintRectangle()
{
}
@@ -37,6 +38,7 @@ SvViewDataEntry::SvViewDataEntry( const SvViewDataEntry& rData ) :
mbExpanded(rData.mbExpanded),
mbFocused(false),
mbSelectable(rData.mbSelectable),
+ mbDragTarget(false),
maPaintRectangle(rData.maPaintRectangle)
{
}
diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx
index 1c56643c11ee..d14d9129ccdb 100644
--- a/svtools/source/inc/svimpbox.hxx
+++ b/svtools/source/inc/svimpbox.hxx
@@ -288,7 +288,7 @@ public:
void MakeVisible( SvTreeListEntry* pEntry, bool bMoveToTop = false );
void ScrollToAbsPos( long nPos );
- void PaintDDCursor( SvTreeListEntry* );
+ void PaintDDCursor(SvTreeListEntry* pEntry, bool bShow);
// Images
inline Image& implGetImageLocation( const ImageType _eType );