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 <fitojb@ubuntu.com>
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 14249fe..f035eb0 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 ac96062..e8e6385 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;