summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2014-12-28 23:52:39 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2014-12-28 23:54:59 +0900
commit9bfeeee0aac88d8215525a2a18280b5183b03b7f (patch)
treee6e9ea70b093748f7331eb54a6c8b5ba265fe9ca /svtools
parent37fa4e781dd0a0edccb59eaf5d8b624f15ef469a (diff)
Rework TabBar D&D tab move triangles and make them HiDPI aware
Change-Id: Ia4165880b0b08b5ca26fe7004f961cd17b3d3e27
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/tabbar.cxx37
1 files changed, 27 insertions, 10 deletions
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 0cdd4944f863..d55a3cbbee66 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -2577,9 +2577,13 @@ sal_uInt16 TabBar::ShowDropPos( const Point& rPos )
long nY = (maWinSize.Height()/2)-1;
sal_uInt16 nCurPos = GetPagePos( mnCurPageId );
- SetLineColor( aBlackColor );
+ sal_Int32 nTriangleWidth = 3 * GetDPIScaleFactor();
+
if ( mnDropPos < nItemCount )
{
+ SetLineColor(aBlackColor);
+ SetFillColor(aBlackColor);
+
pItem = (*mpItemList)[ mnDropPos ];
nX = pItem->maRect.Left();
if ( mnDropPos == nCurPos )
@@ -2587,23 +2591,36 @@ sal_uInt16 TabBar::ShowDropPos( const Point& rPos )
else
nX++;
if ( !pItem->IsDefaultTabBgColor() && !pItem->mbSelect)
- SetLineColor( pItem->maTabTextColor );
- DrawLine( Point( nX, nY ), Point( nX, nY ) );
- DrawLine( Point( nX+1, nY-1 ), Point( nX+1, nY+1 ) );
- DrawLine( Point( nX+2, nY-2 ), Point( nX+2, nY+2 ) );
- SetLineColor( aBlackColor );
+ {
+ SetLineColor(pItem->maTabTextColor);
+ SetFillColor(pItem->maTabTextColor);
+ }
+
+ Polygon aPoly(3);
+ aPoly.SetPoint(Point(nX, nY), 0);
+ aPoly.SetPoint(Point(nX + nTriangleWidth, nY - nTriangleWidth), 1);
+ aPoly.SetPoint(Point(nX + nTriangleWidth, nY + nTriangleWidth), 2);
+ DrawPolygon(aPoly);
}
if ( (mnDropPos > 0) && (mnDropPos < nItemCount+1) )
{
+ SetLineColor(aBlackColor);
+ SetFillColor(aBlackColor);
+
pItem = (*mpItemList)[ mnDropPos-1 ];
nX = pItem->maRect.Right();
if ( mnDropPos == nCurPos )
nX++;
if ( !pItem->IsDefaultTabBgColor() && !pItem->mbSelect)
- SetLineColor( pItem->maTabTextColor );
- DrawLine( Point( nX, nY ), Point( nX, nY ) );
- DrawLine( Point( nX-1, nY-1 ), Point( nX-1, nY+1 ) );
- DrawLine( Point( nX-2, nY-2 ), Point( nX-2, nY+2 ) );
+ {
+ SetLineColor(pItem->maTabTextColor);
+ SetFillColor(pItem->maTabTextColor);
+ }
+ Polygon aPoly(3);
+ aPoly.SetPoint(Point(nX, nY ), 0);
+ aPoly.SetPoint(Point(nX - nTriangleWidth, nY - nTriangleWidth), 1);
+ aPoly.SetPoint(Point(nX - nTriangleWidth, nY + nTriangleWidth), 2);
+ DrawPolygon(aPoly);
}
return mnDropPos;