summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-08-19 20:31:32 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-08-25 10:10:40 +0200
commite8acd00ba910cae2b91ee396048381e3897c6776 (patch)
tree770c7093ad227ecb3d56f3371959f32a0374fadb
parent9877bf5c66ec8cf8d1c9485c3976578e7c5ddcf6 (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>
-rw-r--r--include/sfx2/thumbnailviewitem.hxx1
-rw-r--r--sfx2/source/control/thumbnailviewitem.cxx32
2 files changed, 19 insertions, 14 deletions
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);