diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2017-03-15 13:42:03 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-03-16 07:47:00 +0000 |
commit | 3b7d751ad4f950aae0641a75b2ea993025629c9d (patch) | |
tree | 1cf0934defe528db39246188e6b643573a0d17af /vcl | |
parent | d5f48aecd8f61979e98bfbbdbc0b2ee43eb792a6 (diff) |
tdf#103235 Notebookbar: use persona theme
Change-Id: I043f184ccd21c782c16d4ae1bc1c939b5e31acc2
Reviewed-on: https://gerrit.libreoffice.org/35234
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/notebookbar.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index f23e2d57d21a..f338426aa23a 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -40,6 +40,8 @@ NotebookBar::NotebookBar(Window* pParent, const OString& rID, const OUString& rU // In the Notebookbar's .ui file must exist control handling context // - implementing NotebookbarContextControl interface with id "ContextContainer" m_pContextContainer = dynamic_cast<NotebookbarContextControl*>(m_pUIBuilder->get<Window>("ContextContainer")); + + UpdateBackground(); } NotebookBar::~NotebookBar() @@ -139,4 +141,23 @@ void SAL_CALL NotebookBarContextChangeEventListener::disposing(const ::css::lang mpParent.clear(); } +void NotebookBar::DataChanged(const DataChangedEvent& rDCEvt) +{ + UpdateBackground(); + Control::DataChanged(rDCEvt); +} + +void NotebookBar::UpdateBackground() +{ + const StyleSettings& rStyleSettings = this->GetSettings().GetStyleSettings(); + const BitmapEx aPersona = rStyleSettings.GetPersonaHeader(); + + if (!aPersona.IsEmpty()) + SetBackground(Wallpaper(aPersona)); + else + SetBackground(rStyleSettings.GetMenuBarColor()); + + Invalidate(Rectangle(Point(0,0), GetSizePixel())); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |