sc/source/ui/app/inputwin.cxx | 27 ++++++++++++++++++++------- sc/source/ui/inc/inputwin.hxx | 2 ++ 2 files changed, 22 insertions(+), 7 deletions(-)
New commits: commit 462bbf692e41897552b4f4e1f9e4f033e5f76643 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Feb 3 16:18:35 2023 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Feb 4 07:38:17 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/+/146545 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 7b9e208aec14..a9b5a54367b9 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -853,14 +853,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)); @@ -881,6 +875,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;