summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-06-18 12:44:29 +0100
committerAndras Timar <andras.timar@collabora.com>2021-06-24 08:38:05 +0200
commitba3e2c3dc5a70419c2acc109b3af07cf1787b08b (patch)
treed45e9563f71ff13f8f4fe4e0c20e5e57383fd04c
parent02be0382798dc221d32c0a72d95b05b4562a1bde (diff)
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 <caolanm@redhat.com> (cherry picked from commit 0389e2eb50ddc0f83bfa4469861592165ea911de) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117755 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--sw/source/uibase/docvw/AnnotationWin2.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 1eb8009127c0..46c9ff24915e 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -463,11 +463,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()