summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-02-17 15:08:48 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-17 16:47:36 +0100
commit9da5675de3ca8a047bf45fd601522a6337efb78e (patch)
treed0325e2a0974ebdb9fb6b8829b931215d7913947
parent03f20846eb4219947e93cf48a5e0c46398bd8a04 (diff)
sfx2 infobar: allow setting the message color
Change-Id: I32bb73dfd8ecb78bb2eb9907b0c008e84fd2233a
-rw-r--r--include/sfx2/infobar.hxx9
-rw-r--r--include/sfx2/viewfrm.hxx6
-rw-r--r--sfx2/source/dialog/infobar.cxx13
-rw-r--r--sfx2/source/view/viewfrm.cxx8
4 files changed, 28 insertions, 8 deletions
diff --git a/include/sfx2/infobar.hxx b/include/sfx2/infobar.hxx
index 483c0f8750ca..8d0fcbce97fc 100644
--- a/include/sfx2/infobar.hxx
+++ b/include/sfx2/infobar.hxx
@@ -53,7 +53,8 @@ class SfxInfoBarWindow : public vcl::Window
SfxInfoBarWindow( vcl::Window* parent, const OUString& sId,
const OUString& sMessage,
const basegfx::BColor* pBackgroundColor,
- const basegfx::BColor* pForegroundColor );
+ const basegfx::BColor* pForegroundColor,
+ const basegfx::BColor* pMessageColor );
virtual ~SfxInfoBarWindow( );
virtual void dispose() override;
@@ -82,7 +83,11 @@ class SfxInfoBarContainerWindow : public vcl::Window
virtual ~SfxInfoBarContainerWindow( );
virtual void dispose() override;
- SfxInfoBarWindow* appendInfoBar(const OUString& sId, const OUString& sMessage, const basegfx::BColor* pBackgroundColor, const basegfx::BColor* pForegroundColor);
+ SfxInfoBarWindow* appendInfoBar(const OUString& sId,
+ const OUString& sMessage,
+ const basegfx::BColor* pBackgroundColor,
+ const basegfx::BColor* pForegroundColor,
+ const basegfx::BColor* pMessageColor);
SfxInfoBarWindow* getInfoBar(const OUString& sId);
void removeInfoBar(SfxInfoBarWindow* pInfoBar);
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index e960aec5b783..0c11c0c1f8f1 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -180,7 +180,11 @@ public:
The buttons will be added from Right to Left at the right of the info bar. The parent, size
and position of each button will be changed: only the width will remain unchanged.
*/
- SfxInfoBarWindow* AppendInfoBar(const OUString& sId, const OUString& sMessage, const basegfx::BColor* pBackgroundColor = nullptr, const basegfx::BColor* pForegroundColor = nullptr);
+ SfxInfoBarWindow* AppendInfoBar(const OUString& sId,
+ const OUString& sMessage,
+ const basegfx::BColor* pBackgroundColor = nullptr,
+ const basegfx::BColor* pForegroundColor = nullptr,
+ const basegfx::BColor* pMessageColor = nullptr);
void RemoveInfoBar(const OUString& sId);
SAL_DLLPRIVATE void SetDowning_Impl();
diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index f34f23cfcfa5..b108d3bb1444 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -131,7 +131,8 @@ void SfxCloseButton::setForegroundColor(const basegfx::BColor& rColor)
SfxInfoBarWindow::SfxInfoBarWindow(vcl::Window* pParent, const OUString& sId,
const OUString& sMessage,
const basegfx::BColor* pBackgroundColor,
- const basegfx::BColor* pForegroundColor ) :
+ const basegfx::BColor* pForegroundColor,
+ const basegfx::BColor* pMessageColor ) :
Window(pParent, 0),
m_sId(sId),
m_pMessage(VclPtr<FixedText>::Create(this, 0)),
@@ -149,6 +150,8 @@ SfxInfoBarWindow::SfxInfoBarWindow(vcl::Window* pParent, const OUString& sId,
m_aForegroundColor = *pForegroundColor;
static_cast<SfxCloseButton*>(m_pCloseBtn.get())->setForegroundColor(m_aForegroundColor);
}
+ if (pMessageColor)
+ m_pMessage->SetControlForeground(Color(*pMessageColor));
sal_Int32 nScaleFactor = GetDPIScaleFactor();
long nWidth = pParent->GetSizePixel().getWidth();
@@ -277,11 +280,15 @@ void SfxInfoBarContainerWindow::dispose()
Window::dispose();
}
-SfxInfoBarWindow* SfxInfoBarContainerWindow::appendInfoBar(const OUString& sId, const OUString& sMessage, const basegfx::BColor* pBackgroundColor, const basegfx::BColor* pForegroundColor)
+SfxInfoBarWindow* SfxInfoBarContainerWindow::appendInfoBar(const OUString& sId,
+ const OUString& sMessage,
+ const basegfx::BColor* pBackgroundColor,
+ const basegfx::BColor* pForegroundColor,
+ const basegfx::BColor* pMessageColor)
{
Size aSize = GetSizePixel();
- VclPtrInstance<SfxInfoBarWindow> pInfoBar(this, sId, sMessage, pBackgroundColor, pForegroundColor);
+ VclPtrInstance<SfxInfoBarWindow> pInfoBar(this, sId, sMessage, pBackgroundColor, pForegroundColor, pMessageColor);
pInfoBar->SetPosPixel(Point(0, aSize.getHeight()));
pInfoBar->Show();
m_pInfoBars.push_back(pInfoBar);
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 068bbcd891bb..65b8b0cc9fd1 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -3191,7 +3191,11 @@ void SfxViewFrame::SetViewFrame( SfxViewFrame* pFrame )
SfxGetpApp()->SetViewFrame_Impl( pFrame );
}
-SfxInfoBarWindow* SfxViewFrame::AppendInfoBar( const OUString& sId, const OUString& sMessage, const basegfx::BColor* pBackgroundColor, const basegfx::BColor* pForegroundColor )
+SfxInfoBarWindow* SfxViewFrame::AppendInfoBar( const OUString& sId,
+ const OUString& sMessage,
+ const basegfx::BColor* pBackgroundColor,
+ const basegfx::BColor* pForegroundColor,
+ const basegfx::BColor* pMessageColor )
{
const sal_uInt16 nId = SfxInfoBarContainerChild::GetChildWindowId();
@@ -3203,7 +3207,7 @@ SfxInfoBarWindow* SfxViewFrame::AppendInfoBar( const OUString& sId, const OUStri
if (pChild)
{
SfxInfoBarContainerWindow* pInfoBarContainer = static_cast<SfxInfoBarContainerWindow*>(pChild->GetWindow());
- SfxInfoBarWindow* pInfoBar = pInfoBarContainer->appendInfoBar(sId, sMessage, pBackgroundColor, pForegroundColor);
+ SfxInfoBarWindow* pInfoBar = pInfoBarContainer->appendInfoBar(sId, sMessage, pBackgroundColor, pForegroundColor, pMessageColor);
ShowChildWindow(nId);
return pInfoBar;
}