summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-03-29 16:22:10 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-03-29 20:30:29 +0100
commit26f6145b9af5738d5d3b8fe641b99b3908d81e55 (patch)
treeed1576016060a9f053368eae33534e2db65fe7e2 /cui
parent2cc99a2550eac39b9241dec307e66bfdcc005388 (diff)
Resolves: tdf#160159 update spellchecking area colors when style changes
so for the case of using "automatic" for the document background the spelling checking textbox background area updates to match Change-Id: I8723afb946176596b0a5fa43aa3bb3c036dee12c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165554 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/SpellDialog.cxx13
-rw-r--r--cui/source/inc/SpellDialog.hxx3
2 files changed, 16 insertions, 0 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index dfdad984ec41..9dd877f80cf9 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1152,6 +1152,13 @@ void SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
m_xEditEngine->SetStatusEventHdl(LINK(this, SentenceEditWindow_Impl, EditStatusHdl));
+ SetDocumentColor(pDrawingArea);
+}
+
+void SentenceEditWindow_Impl::SetDocumentColor(weld::DrawingArea* pDrawingArea)
+{
+ if (!pDrawingArea || !m_xEditView || !m_xEditEngine)
+ return;
// tdf#142631 use document background color in this widget
Color aBgColor = svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
OutputDevice& rDevice = pDrawingArea->get_ref_device();
@@ -1160,6 +1167,12 @@ void SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
m_xEditEngine->SetBackgroundColor(aBgColor);
}
+void SentenceEditWindow_Impl::StyleUpdated()
+{
+ SetDocumentColor(GetDrawingArea());
+ WeldEditView::StyleUpdated();
+}
+
IMPL_LINK_NOARG(SentenceEditWindow_Impl, EditStatusHdl, EditStatus&, void)
{
SetScrollBarRange();
diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx
index fdf5e81bcdf3..81d68e214314 100644
--- a/cui/source/inc/SpellDialog.hxx
+++ b/cui/source/inc/SpellDialog.hxx
@@ -71,6 +71,7 @@ private:
protected:
virtual bool KeyInput( const KeyEvent& rKEvt ) override;
+ virtual void StyleUpdated() override;
public:
SentenceEditWindow_Impl(std::unique_ptr<weld::ScrolledWindow> xScrolledWindow);
@@ -120,6 +121,8 @@ public:
void MoveErrorEnd(tools::Long nOffset);
void ResetIgnoreErrorsAt() { m_aIgnoreErrorsAt.clear(); }
+
+ void SetDocumentColor(weld::DrawingArea* pDrawingArea);
};
// class SvxSpellDialog ---------------------------------------------