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

Szymon Kłos eszkadev at gmail.com
Thu Mar 16 07:47:27 UTC 2017


 include/vcl/notebookbar.hxx        |    5 +++++
 vcl/source/control/notebookbar.cxx |   21 +++++++++++++++++++++
 2 files changed, 26 insertions(+)

New commits:
commit 3b7d751ad4f950aae0641a75b2ea993025629c9d
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed Mar 15 13:42:03 2017 +0100

    tdf#103235 Notebookbar: use persona theme
    
    Change-Id: I043f184ccd21c782c16d4ae1bc1c939b5e31acc2
    Reviewed-on: https://gerrit.libreoffice.org/35234
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/include/vcl/notebookbar.hxx b/include/vcl/notebookbar.hxx
index f16b3ed..4273edc 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 f23e2d5..f338426 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: */


More information about the Libreoffice-commits mailing list