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

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Tue Jan 31 12:24:07 UTC 2017


 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.Mehrbrodt at 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 <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at 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));


More information about the Libreoffice-commits mailing list