include/sfx2/infobar.hxx | 5 +++++ sfx2/source/dialog/infobar.cxx | 18 ++++++++++++++++++ sfx2/source/view/viewfrm.cxx | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-)
New commits: commit 0cd819b68ced2a95a127a246c0558153fbdbcae2 Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Date: Tue Jan 31 09:35:05 2017 +0100 Add helper methods to get common colors to SfxInfoBar Change-Id: Ic3816b046839636fa0d1b8cb881725bcc80ef011 Reviewed-on: https://gerrit.libreoffice.org/33742 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> diff --git a/include/sfx2/infobar.hxx b/include/sfx2/infobar.hxx index 8cd6d6c..97671a9 100644 --- a/include/sfx2/infobar.hxx +++ b/include/sfx2/infobar.hxx @@ -69,6 +69,11 @@ class SfxInfoBarWindow : public vcl::Window */ void addButton(PushButton* pButton); + // Colors + static basegfx::BColor getSuccessColor(); + static basegfx::BColor getDangerColor(); + static basegfx::BColor getWarningColor(); + private: DECL_LINK( CloseHandler, Button*, void ); }; diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx index d8fce1f..4d5ba01 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 ffa0d41..a7f1d6a 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)); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits