summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail..com>2019-11-24 21:29:57 -0900
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2019-12-16 07:10:28 +0100
commitb26de926aad67b266509e75829061417d7320ec7 (patch)
tree5867d61fb6a0c28ac24dfb331efb510aad94fc67 /sfx2
parentb61ea71d0e1a5045ab589abf6ef3d6c106a84d31 (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> (cherry picked from commit ac11dd8365c9e9de67717d18b7983af1eca17eaf) Reviewed-on: https://gerrit.libreoffice.org/85001 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/infobar.cxx11
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()
{