[Libreoffice-commits] core.git: sfx2/source

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 11 09:11:07 UTC 2019


 sfx2/source/dialog/infobar.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit ac11dd8365c9e9de67717d18b7983af1eca17eaf
Author:     Jim Raykowski <raykowj at gmail..com>
AuthorDate: Sun Nov 24 21:29:57 2019 -0900
Commit:     Heiko Tietze <heiko.tietze at documentfoundation.org>
CommitDate: Wed Dec 11 10:10:05 2019 +0100

    tdf#129005 Make Infobar push buttons keyboard accessible
    
    Also indicate infobar has keyboard focus by shading the close button
    when infobar gets focus. And as a bonus shade the close button on
    mouseover.
    
    Change-Id: Ie714f3e6d1f13d44ced94a02af398c5c75607b94
    Reviewed-on: https://gerrit.libreoffice.org/83639
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tietze at documentfoundation.org>

diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index 8dd52ed32a92..3479fe72ad7d 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -135,8 +135,12 @@ void SfxCloseButton::Paint(vcl::RenderContext& rRenderContext, const ::tools::Re
     aPolygon.append(B2DPoint(aRect.Left(), aRect.Bottom()));
     aPolygon.setClosed(true);
 
+    Color aBackgroundColor(m_aBackgroundColor);
+    if (IsMouseOver() || HasFocus())
+        aBackgroundColor.ApplyTintOrShade(-2000);
+
     PolyPolygonColorPrimitive2D* pBack =
-        new PolyPolygonColorPrimitive2D(B2DPolyPolygon(aPolygon), m_aBackgroundColor);
+        new PolyPolygonColorPrimitive2D(B2DPolyPolygon(aPolygon), aBackgroundColor.getBColor());
     aSeq[0] = pBack;
 
     LineAttribute aLineAttribute(m_aForegroundColor, 2.0);
@@ -180,7 +184,7 @@ SfxInfoBarWindow::SfxInfoBarWindow(vcl::Window* pParent, const OUString& sId,
        InfobarType ibType,
        bool bShowCloseButton,
        WinBits nMessageStyle = WB_LEFT|WB_VCENTER) :
-    Window(pParent, 0),
+    Window(pParent, WB_DIALOGCONTROL),
     m_sId(sId),
     m_eType(ibType),
     m_pImage(VclPtr<FixedImage>::Create(this, nMessageStyle)),
@@ -189,6 +193,7 @@ SfxInfoBarWindow::SfxInfoBarWindow(vcl::Window* pParent, const OUString& sId,
     m_pCloseBtn(VclPtr<SfxCloseButton>::Create(this)),
     m_aActionBtns()
 {
+    m_pCloseBtn->SetStyle(WB_DEFBUTTON | WB_TABSTOP);
     SetForeAndBackgroundColors(m_eType);
     float fScaleFactor = GetDPIScaleFactor();
     long nWidth = pParent->GetSizePixel().getWidth();
@@ -363,7 +368,7 @@ IMPL_LINK_NOARG(SfxInfoBarWindow, CloseHandler, Button*, void)
 }
 
 SfxInfoBarContainerWindow::SfxInfoBarContainerWindow(SfxInfoBarContainerChild* pChildWin ) :
-    Window(pChildWin->GetParent(), 0),
+    Window(pChildWin->GetParent(), WB_DIALOGCONTROL),
     m_pChildWin(pChildWin),
     m_pInfoBars()
 {


More information about the Libreoffice-commits mailing list