diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-08-19 20:31:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-08-25 10:10:40 +0200 |
commit | e8acd00ba910cae2b91ee396048381e3897c6776 (patch) | |
tree | 770c7093ad227ecb3d56f3371959f32a0374fadb /sfx2 | |
parent | 9877bf5c66ec8cf8d1c9485c3976578e7c5ddcf6 (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/thumbnailviewitem.cxx | 32 |
1 files changed, 18 insertions, 14 deletions
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); |