diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2012-08-12 20:20:34 -0430 |
---|---|---|
committer | Rafael Dominguez <venccsralph@gmail.com> | 2012-08-12 22:14:26 -0430 |
commit | a8b2083877894ffb19be0c95ae2aeb4373c0161a (patch) | |
tree | 7d18b7871370fe0dc4c20cbe36179c98a24acc35 /sfx2/source/control/templateviewitem.cxx | |
parent | 74d2421afc86c72d07a4f9d1f9824f41461900bb (diff) |
Improve thumbnail items position calculation and size.
Change-Id: I7b22d4d858d82bd1e12ead3b723aad43118cf938
Diffstat (limited to 'sfx2/source/control/templateviewitem.cxx')
-rw-r--r-- | sfx2/source/control/templateviewitem.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx index 4b559d315877..a3f835e12f14 100644 --- a/sfx2/source/control/templateviewitem.cxx +++ b/sfx2/source/control/templateviewitem.cxx @@ -35,27 +35,26 @@ TemplateViewItem::~TemplateViewItem () { } -void TemplateViewItem::calculateItemsPosition(sal_uInt32 nMaxTextLength) +void TemplateViewItem::calculateItemsPosition(const long nThumbnailHeight, const long nDisplayHeight, + const long nPadding, sal_uInt32 nMaxTextLenght) { - ThumbnailViewItem::calculateItemsPosition(nMaxTextLength); + ThumbnailViewItem::calculateItemsPosition(nThumbnailHeight,nDisplayHeight,nPadding,nMaxTextLenght); if (!maSubTitle.isEmpty()) { Size aRectSize = maDrawArea.GetSize(); - Size aImageSize = maPreview1.GetSizePixel(); - aRectSize.Height() -= aImageSize.getHeight(); drawinglayer::primitive2d::TextLayouterDevice aTextDev; - long nSpace = (aRectSize.getHeight() - 2*aTextDev.getTextHeight()) / 3; + long nSpace = (nDisplayHeight + nPadding - 2*aTextDev.getTextHeight()) / 3; // Set title position - maTextPos.setY(maPrev1Pos.getY() + aImageSize.getHeight() + nSpace); + maTextPos.setY(maDrawArea.getY() + nThumbnailHeight + nPadding + nSpace + aTextDev.getTextHeight()); // Set subtitle position - maSubTitlePos.setY(maTextPos.getY() + nSpace); + maSubTitlePos.setY(maTextPos.getY() + nSpace + aTextDev.getTextHeight()); maSubTitlePos.setX(maDrawArea.Left() + - (aRectSize.Width() - aTextDev.getTextWidth(maSubTitle,0,nMaxTextLength)*SUBTITLE_SCALE_FACTOR)/2); + (aRectSize.Width() - aTextDev.getTextWidth(maSubTitle,0,nMaxTextLenght)*SUBTITLE_SCALE_FACTOR)/2); } } |