summaryrefslogtreecommitdiff
path: root/sd/source/ui/animations
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2024-08-08 21:31:23 -0800
committerJim Raykowski <raykowj@gmail.com>2024-08-10 23:09:08 +0200
commitcee67dd7d7348f853066a160eed4618dc4ab52ff (patch)
treeaeccbbe828326a3c6a0e777deded9e8d51525f12 /sd/source/ui/animations
parentccf764aaaabd03cf183149838b5573a680d27d22 (diff)
Resolves: tdf#162392 Impress Sidebar 'Animation' deck text overlaps
by reworking the custom animation list entry item custom rendering layout a bit. Change-Id: I1c71dd5ef40de5369890b0b9aea1294baa3be120 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171659 Tested-by: Jenkins Reviewed-by: Vernon, Stuart Foote <vsfoote@libreoffice.org> Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sd/source/ui/animations')
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx33
1 files changed, 23 insertions, 10 deletions
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 23ab28669174..3d233e39322d 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -298,7 +298,7 @@ Size CustomAnimationListEntryItem::GetSize(const vcl::RenderContext& rRenderCont
if (width < (rRenderContext.GetTextWidth( msEffectName ) + 2*nIconWidth))
width = rRenderContext.GetTextWidth( msEffectName ) + 2*nIconWidth;
- Size aSize(width, rRenderContext.GetTextHeight());
+ Size aSize(width, rRenderContext.GetTextHeight() * 2);
if (aSize.Height() < nItemMinHeight)
aSize.setHeight(nItemMinHeight);
return aSize;
@@ -351,27 +351,34 @@ void CustomAnimationListEntryItem::PaintEffect(vcl::RenderContext& rRenderContex
Point aPos(rRect.TopLeft());
int nItemHeight = rRect.GetHeight();
+ Size nImageSize = Image(StockImage::Yes, BMP_CUSTOMANIMATION_AFTER_PREVIOUS).GetSizePixel();
+
sal_Int16 nNodeType = mpEffect->getNodeType();
- if (nNodeType == EffectNodeType::ON_CLICK )
+ if (nNodeType == EffectNodeType::ON_CLICK)
{
- rRenderContext.DrawImage(aPos, Image(StockImage::Yes, BMP_CUSTOMANIMATION_ON_CLICK));
+ Image aImage(Image(StockImage::Yes, BMP_CUSTOMANIMATION_ON_CLICK));
+ nImageSize = aImage.GetSizePixel();
+ aPos.AdjustY(nItemHeight / 4 - nImageSize.Height() / 2);
+ rRenderContext.DrawImage(aPos, aImage);
}
else if (nNodeType == EffectNodeType::AFTER_PREVIOUS)
{
- rRenderContext.DrawImage(aPos, Image(StockImage::Yes, BMP_CUSTOMANIMATION_AFTER_PREVIOUS));
+ Image aImage(Image(StockImage::Yes, BMP_CUSTOMANIMATION_AFTER_PREVIOUS));
+ nImageSize = aImage.GetSizePixel();
+ aPos.AdjustY(nItemHeight / 4 - nImageSize.Height() / 2);
+ rRenderContext.DrawImage(aPos, aImage);
}
else if (nNodeType == EffectNodeType::WITH_PREVIOUS)
{
//FIXME With previous image not defined in CustomAnimation.src
}
- aPos.AdjustX(nIconWidth);
+ aPos = rRect.TopLeft();
+ aPos.AdjustX(nImageSize.Width() + 5);
//TODO, full width of widget ?
rRenderContext.DrawText(aPos, rRenderContext.GetEllipsisString(msDescription, rRect.GetWidth()));
- aPos.AdjustY(nIconWidth);
-
OUString sImage;
switch (mpEffect->getPresetClass())
{
@@ -404,13 +411,19 @@ void CustomAnimationListEntryItem::PaintEffect(vcl::RenderContext& rRenderContex
if (!sImage.isEmpty())
{
Image aImage(StockImage::Yes, sImage);
+ nImageSize = aImage.GetSizePixel();
Point aImagePos(aPos);
- aImagePos.AdjustY((nItemHeight/2 - aImage.GetSizePixel().Height()) >> 1 );
+ aImagePos.AdjustY(nItemHeight * 3 / 4 - nImageSize.Height() / 2);
rRenderContext.DrawImage(aImagePos, aImage);
}
+ else
+ {
+ Image aImage(StockImage::Yes, BMP_CUSTOMANIMATION_ENTRANCE_EFFECT);
+ nImageSize = aImage.GetSizePixel();
+ }
- aPos.AdjustX(nIconWidth );
- aPos.AdjustY((nItemHeight/2 - rRenderContext.GetTextHeight()) >> 1 );
+ aPos.AdjustX(nImageSize.Width() + 5);
+ aPos.AdjustY(nItemHeight / 2);
rRenderContext.DrawText(aPos, rRenderContext.GetEllipsisString(msEffectName, rRect.GetWidth()));
rRenderContext.Pop();