summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorRafael Lima <rafael.palma.lima@gmail.com>2022-11-02 18:54:24 +0200
committerCaolán McNamara <caolanm@redhat.com>2022-11-03 16:05:17 +0100
commit1de8308d40fad8e9281d2b491f8c5c919fda82f4 (patch)
tree9f6886ab4178806f615782cde5ece845d6f262f3 /cui
parentbc456bac0ffdefd37164ca5d5b123ed8df72f4f1 (diff)
tdf#116566 Make Spellcheck dialog respect dark background
This patch makes the sentence in the spellcheck dialog respect the colors in the selected color scheme. More specifically, it uses the AutoSpellcheck color and the Font Color in the Edit Engine. Change-Id: I0f8e842417645250c9145d1e37d8cf52c290379e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/SpellDialog.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 49e1415e744e..21f7f2b4da80 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1140,6 +1140,7 @@ void SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
OutputDevice& rDevice = pDrawingArea->get_ref_device();
rDevice.SetBackground(aBgColor);
m_xEditView->SetBackgroundColor(aBgColor);
+ m_xEditEngine->SetBackgroundColor(aBgColor);
}
SentenceEditWindow_Impl::~SentenceEditWindow_Impl()
@@ -1671,8 +1672,13 @@ void SentenceEditWindow_Impl::MoveErrorMarkTo(sal_Int32 nStart, sal_Int32 nEnd,
m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT_CJK);
m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT_CTL);
+ // tdf#116566 Use color defined in the current Color Scheme
+ Color aSpellErrorCollor = svtools::ColorConfig().GetColorValue(svtools::SPELL).nColor;
+
+ // TODO: Create a new Color Scheme entry for grammar mistakes and use it below
+ // instead of using hardcoded COL_LIGHTBLUE
SfxItemSet aSet(m_xEditEngine->GetEmptyItemSet());
- aSet.Put(SvxColorItem(bGrammarError ? COL_LIGHTBLUE : COL_LIGHTRED, EE_CHAR_COLOR));
+ aSet.Put(SvxColorItem(bGrammarError ? COL_LIGHTBLUE : aSpellErrorCollor, EE_CHAR_COLOR));
aSet.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT));
aSet.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT_CJK));
aSet.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT_CTL));