summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2017-03-15 13:42:03 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-03-16 07:47:00 +0000
commit3b7d751ad4f950aae0641a75b2ea993025629c9d (patch)
tree1cf0934defe528db39246188e6b643573a0d17af
parentd5f48aecd8f61979e98bfbbdbc0b2ee43eb792a6 (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>
-rw-r--r--include/vcl/notebookbar.hxx5
-rw-r--r--vcl/source/control/notebookbar.cxx21
2 files changed, 26 insertions, 0 deletions
diff --git a/include/vcl/notebookbar.hxx b/include/vcl/notebookbar.hxx
index f16b3ed38976..4273edc9fabf 100644
--- a/include/vcl/notebookbar.hxx
+++ b/include/vcl/notebookbar.hxx
@@ -35,10 +35,15 @@ public:
void SetSystemWindow(SystemWindow* pSystemWindow);
const css::uno::Reference<css::ui::XContextChangeEventListener>& getContextChangeEventListener() const { return m_pEventListener; }
+
+ void DataChanged(const DataChangedEvent& rDCEvt) override;
+
private:
VclPtr<SystemWindow> m_pSystemWindow;
css::uno::Reference<css::ui::XContextChangeEventListener> m_pEventListener;
NotebookbarContextControl* m_pContextContainer;
+
+ void UpdateBackground();
};
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: */