[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 24 06:38:45 UTC 2021


 sw/source/uibase/docvw/AnnotationWin2.cxx |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

New commits:
commit ba3e2c3dc5a70419c2acc109b3af07cf1787b08b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jun 18 12:44:29 2021 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Jun 24 08:38:05 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 <caolanm at redhat.com>
    (cherry picked from commit 0389e2eb50ddc0f83bfa4469861592165ea911de)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117755
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

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()


More information about the Libreoffice-commits mailing list