diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-01-31 09:35:05 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-01-31 12:23:31 +0000 |
commit | 0cd819b68ced2a95a127a246c0558153fbdbcae2 (patch) | |
tree | 1728ef7bf14d13372e7a2d88d410e8d6d26eabbd /sfx2 | |
parent | 2dff5e856ab343b1296f63d645c47382493fe2fe (diff) |
Add helper methods to get common colors to SfxInfoBar
Change-Id: Ic3816b046839636fa0d1b8cb881725bcc80ef011
Reviewed-on: https://gerrit.libreoffice.org/33742
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/infobar.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx index d8fce1f9e202..4d5ba0147fbe 100644 --- a/sfx2/source/dialog/infobar.cxx +++ b/sfx2/source/dialog/infobar.cxx @@ -254,6 +254,24 @@ void SfxInfoBarWindow::Resize() m_pMessage->SetPosSizePixel(aMessagePosition, aMessageSize); } +basegfx::BColor SfxInfoBarWindow::getSuccessColor() +{ + // Green + return basegfx::BColor(0.0, 0.5, 0.0); +} + +basegfx::BColor SfxInfoBarWindow::getWarningColor() +{ + // Orange + return basegfx::BColor(1.0, 0.5, 0.0); +} + +basegfx::BColor SfxInfoBarWindow::getDangerColor() +{ + // Red + return basegfx::BColor(0.5, 0.0, 0.0); +} + IMPL_LINK_NOARG(SfxInfoBarWindow, CloseHandler, Button*, void) { static_cast<SfxInfoBarContainerWindow*>(GetParent())->removeInfoBar(this); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index ffa0d419e6aa..a7f1d6a85448 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1181,7 +1181,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) SignatureState nSignatureState = GetObjectShell()->GetDocumentSignatureState(); if (nSignatureState == SignatureState::BROKEN) { - basegfx::BColor aBackgroundColor = basegfx::BColor(0.5, 0.0, 0.0); + basegfx::BColor aBackgroundColor = SfxInfoBarWindow::getWarningColor(); auto pInfoBar = AppendInfoBar("signature", SfxResId(STR_SIGNATURE_BROKEN), &aBackgroundColor); VclPtrInstance<PushButton> xBtn(&GetWindow()); xBtn->SetText(SfxResId(STR_SIGNATURE_SHOW)); |