sw/source/uibase/docvw/AnnotationWin2.cxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
New commits: commit 0389e2eb50ddc0f83bfa4469861592165ea911de Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Jun 18 12:44:29 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Jun 18 16:49:24 2021 +0200 tdf#142925 render the button arrow like it used to be in 7.1 Change-Id: Ibbe4b7dd2212d1bc28bad7588672bb37c8259605 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117417 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index b2604377e2e0..71a78d6fae0e 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -461,11 +461,27 @@ void SwAnnotationWin::SetMenuButtonColors() ColorFromAlphaColor(80, mColorAnchor, mColorDark)); xVirDev->DrawGradient(aRect, aGradient); + //draw rect around button + xVirDev->SetFillColor(); + xVirDev->SetLineColor(ColorFromAlphaColor(90, mColorAnchor, mColorDark)); + xVirDev->DrawRect(aRect); + + tools::Rectangle aSymbolRect(aRect); + // 25% distance to the left and right button border + const tools::Long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth() * 250) + 500) / 1000; + aSymbolRect.AdjustLeft(nBorderDistanceLeftAndRight ); + aSymbolRect.AdjustRight( -nBorderDistanceLeftAndRight ); + // 40% distance to the top button border + const tools::Long nBorderDistanceTop = ((aSymbolRect.GetHeight() * 400) + 500) / 1000; + aSymbolRect.AdjustTop(nBorderDistanceTop ); + // 15% distance to the bottom button border + const tools::Long nBorderDistanceBottom = ((aSymbolRect.GetHeight() * 150) + 500) / 1000; + aSymbolRect.AdjustBottom( -nBorderDistanceBottom ); DecorationView aDecoView(xVirDev.get()); - aDecoView.DrawSymbol(aRect, SymbolType::SPIN_DOWN, GetTextColor(), + aDecoView.DrawSymbol(aSymbolRect, SymbolType::SPIN_DOWN, GetTextColor(), DrawSymbolFlags::NONE); mxMenuButton->set_image(xVirDev); - mxMenuButton->set_size_request(aSize.Width() + 4, aSize.Height()); + mxMenuButton->set_size_request(aSize.Width() + 4, aSize.Height() + 4); } void SwAnnotationWin::Rescale() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits