sc/source/ui/app/inputwin.cxx |   27 ++++++++++++++++++++-------
 sc/source/ui/inc/inputwin.hxx |    2 ++
 2 files changed, 22 insertions(+), 7 deletions(-)

New commits:
commit ff14364441c3f7bc0c3bc4981c9395658f9079f3
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Feb 3 16:18:35 2023 +0000
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Sat Feb 4 08:21:46 2023 +0000

    Resolves: tdf#153353 formula bar border area bg didn't change on theme 
change
    
    Change-Id: I720054d540a6352b8248aa59e231878c1832d998
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146521
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 14249fe2eb04..f035eb0b7314 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -850,14 +850,8 @@ ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, 
ScTabViewShell* pViewSh)
 {
     InitControlBase(m_xContainer.get());
 
-    const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
-
     SetPaintTransparent(false);
-    SetBackground(rStyleSettings.GetFaceColor());
-
-    // match to bg used in ScTextWnd::SetDrawingArea to the margin area is 
drawn with the
-    // same desired bg
-    mxBackground->set_background(rStyleSettings.GetWindowColor());
+    SetBackgrounds();
 
     mxButtonUp->connect_clicked(LINK(this, ScInputBarGroup, ClickHdl));
     mxButtonDown->connect_clicked(LINK(this, ScInputBarGroup, ClickHdl));
@@ -878,6 +872,25 @@ ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, 
ScTabViewShell* pViewSh)
         mxButtonDown->show();
 }
 
+void ScInputBarGroup::SetBackgrounds()
+{
+    const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
+    SetBackground(rStyleSettings.GetFaceColor());
+    // match to bg used in ScTextWnd::SetDrawingArea to the margin area is 
drawn with the
+    // same desired bg
+    mxBackground->set_background(rStyleSettings.GetWindowColor());
+}
+
+void ScInputBarGroup::DataChanged(const DataChangedEvent& rDCEvt)
+{
+    InterimItemWindow::DataChanged(rDCEvt);
+    if ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) && 
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE))
+    {
+        SetBackgrounds();
+        Invalidate();
+    }
+}
+
 Point ScInputBarGroup::GetCursorScreenPixelPos(bool bBelow)
 {
     return mxTextWndGroup->GetCursorScreenPixelPos(bBelow);
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index ac96062af137..e8e63855ffd6 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -252,6 +252,7 @@ public:
     virtual bool            HasEditView() const override;
     Point                   GetCursorScreenPixelPos(bool bBelowLine);
     virtual void            Resize() override;
+    virtual void            DataChanged(const DataChangedEvent& rDCEvt) 
override;
     virtual const OUString& GetTextString() const override;
     virtual void            StopEditEngine(bool bAll) override;
     virtual void            TextGrabFocus() override;
@@ -272,6 +273,7 @@ public:
 
 private:
     void            TriggerToolboxLayout();
+    void            SetBackgrounds();
 
     std::unique_ptr<weld::Container> mxBackground;
     std::unique_ptr<ScTextWndGroup> mxTextWndGroup;

Reply via email to