diff options
author | Jim Raykowski <raykowj@gmail..com> | 2019-11-24 21:29:57 -0900 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2019-12-11 10:10:05 +0100 |
commit | ac11dd8365c9e9de67717d18b7983af1eca17eaf (patch) | |
tree | ce9d9337fa92befb0ac1c1495fc3f080b4dee4da /sfx2 | |
parent | c1a0911b99b6c2a4e260c86eab1aa1ee1e173c0a (diff) |
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@documentfoundation.org>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/infobar.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
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() { |