diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2012-06-19 16:04:54 -0430 |
---|---|---|
committer | Rafael Dominguez <venccsralph@gmail.com> | 2012-06-19 16:04:54 -0430 |
commit | f822c18c546d6262c46d30b532a1f2b4186ccfa5 (patch) | |
tree | 97fbc4cc9a638233aad8df26a09f743f4bc08ec3 /sfx2/source/control/thumbnailviewitem.cxx | |
parent | 9b8a9a7d116ac06b7f8a402e17546460fcde641e (diff) |
Subclass ThumbnailViewItem for TemplateFolderView specific.
- Let ThumbnailViewItem a basic structure for displaying a thumbnail,
name and a selection box.
Change-Id: I00fffcb0c1cb17017cfe7adfde152e640ee01c82
Diffstat (limited to 'sfx2/source/control/thumbnailviewitem.cxx')
-rw-r--r-- | sfx2/source/control/thumbnailviewitem.cxx | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx index 76d3bb2b6aaa..a23fcb203e17 100644 --- a/sfx2/source/control/thumbnailviewitem.cxx +++ b/sfx2/source/control/thumbnailviewitem.cxx @@ -166,20 +166,14 @@ bool ThumbnailViewItem::isInsideTitle (const Point &pt) const void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor, const ThumbnailItemAttributes *pAttrs) { - int nCount = 0; - int nSeqSize = 3; - - if (!maPreview2.IsEmpty()) - ++nSeqSize; - BColor aFillColor = pAttrs->aFillColor; - Primitive2DSequence aSeq(nSeqSize); + Primitive2DSequence aSeq(3); // Draw background if ( mbSelected || mbHover ) aFillColor = pAttrs->aHighlightColor; - aSeq[nCount++] = Primitive2DReference( new PolyPolygonColorPrimitive2D( + aSeq[0] = Primitive2DReference( new PolyPolygonColorPrimitive2D( B2DPolyPolygon(Polygon(maDrawArea,5,5).getB2DPolygon()), aFillColor)); @@ -187,25 +181,8 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc Point aPos = maPrev1Pos; Size aImageSize = maPreview1.GetSizePixel(); - float fScaleX = 1.0f; - float fScaleY = 1.0f; - - if (!maPreview2.IsEmpty()) - { - fScaleX = 0.8; - fScaleY = 0.8; - - aSeq[nCount++] = Primitive2DReference( new FillBitmapPrimitive2D( - createScaleTranslateB2DHomMatrix(fScaleX,fScaleY,aPos.X(),aPos.Y()), - FillBitmapAttribute(maPreview2, - B2DPoint(35,20), - B2DVector(aImageSize.Width(),aImageSize.Height()), - false) - )); - } - - aSeq[nCount++] = Primitive2DReference( new FillBitmapPrimitive2D( - createScaleTranslateB2DHomMatrix(fScaleX,fScaleY,aPos.X(),aPos.Y()), + aSeq[1] = Primitive2DReference( new FillBitmapPrimitive2D( + createTranslateB2DHomMatrix(aPos.X(),aPos.Y()), FillBitmapAttribute(maPreview1, B2DPoint(0,0), B2DVector(aImageSize.Width(),aImageSize.Height()), @@ -220,7 +197,7 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(), double( aPos.X() ), double( aPos.Y() ) ) ); - aSeq[nCount++] = Primitive2DReference( + aSeq[2] = Primitive2DReference( new TextSimplePortionPrimitive2D(aTextMatrix, maText,0,maText.getLength(), std::vector< double >( ), |