include/sfx2/thumbnailviewitem.hxx | 1 sfx2/source/control/thumbnailviewitem.cxx | 32 ++++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-)
New commits: commit e8acd00ba910cae2b91ee396048381e3897c6776 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Aug 19 20:31:32 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Aug 25 10:10:40 2020 +0200 make drawing item border optional Change-Id: I8310f77c9e90f3f95a519069709a9d465268eb55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101026 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx index d10bdbb14dc6..d1e1a7a97089 100644 --- a/include/sfx2/thumbnailviewitem.hxx +++ b/include/sfx2/thumbnailviewitem.hxx @@ -68,6 +68,7 @@ public: ThumbnailViewBase &mrParent; sal_uInt16 mnId; bool mbVisible; + bool mbBorder; bool mbSelected; bool mbHover; BitmapEx maPreview1; diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx index 0830689498e8..444d4c3387a5 100644 --- a/sfx2/source/control/thumbnailviewitem.cxx +++ b/sfx2/source/control/thumbnailviewitem.cxx @@ -43,6 +43,7 @@ ThumbnailViewItem::ThumbnailViewItem(ThumbnailViewBase &rView, sal_uInt16 nId) : mrParent(rView) , mnId(nId) , mbVisible(true) + , mbBorder(true) , mbSelected(false) , mbHover(false) , mxAcc() @@ -176,20 +177,23 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc false) )); - // draw thumbnail borders - float fWidth = aImageSize.Width() - 1; - float fHeight = aImageSize.Height() - 1; - float fPosX = maPrev1Pos.getX(); - float fPosY = maPrev1Pos.getY(); - - B2DPolygon aBounds; - aBounds.append(B2DPoint(fPosX,fPosY)); - aBounds.append(B2DPoint(fPosX+fWidth,fPosY)); - aBounds.append(B2DPoint(fPosX+fWidth,fPosY+fHeight)); - aBounds.append(B2DPoint(fPosX,fPosY+fHeight)); - aBounds.setClosed(true); - - aSeq[nPrimitive++] = drawinglayer::primitive2d::Primitive2DReference(createBorderLine(aBounds)); + if (mbBorder) + { + // draw thumbnail borders + float fWidth = aImageSize.Width() - 1; + float fHeight = aImageSize.Height() - 1; + float fPosX = maPrev1Pos.getX(); + float fPosY = maPrev1Pos.getY(); + + B2DPolygon aBounds; + aBounds.append(B2DPoint(fPosX,fPosY)); + aBounds.append(B2DPoint(fPosX+fWidth,fPosY)); + aBounds.append(B2DPoint(fPosX+fWidth,fPosY+fHeight)); + aBounds.append(B2DPoint(fPosX,fPosY+fHeight)); + aBounds.setClosed(true); + + aSeq[nPrimitive++] = drawinglayer::primitive2d::Primitive2DReference(createBorderLine(aBounds)); + } // Draw text below thumbnail addTextPrimitives(maTitle, pAttrs, maTextPos, aSeq); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits