summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorHeiko Tietze <tietze.heiko@gmail.com>2020-10-29 15:03:44 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-11-03 22:02:24 +0100
commit6f3899b27156591e65f62649a92c727eb6f5dd03 (patch)
tree742b41745e770fbf73ada4d5cea395a262219813 /cui
parent2a7a62c09582ec24247022a94e929610d141a4c9 (diff)
Resolves tdf#137059 - Use application colors for font preview
Background is set to document's application color now (options > application colors > document) to provide a true WYSIWYG experience (except for modifications to the page background color). Change-Id: Ifd78e667f3eeff3573ff09bcb4d2a9634dd49c99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105011 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/FontFeaturesDialog.cxx3
-rw-r--r--cui/source/tabpages/chardlg.cxx23
2 files changed, 8 insertions, 18 deletions
diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx
index a34912d5d0f2..c1e79b4515d7 100644
--- a/cui/source/dialogs/FontFeaturesDialog.cxx
+++ b/cui/source/dialogs/FontFeaturesDialog.cxx
@@ -26,9 +26,6 @@ FontFeaturesDialog::FontFeaturesDialog(weld::Window* pParent, OUString const& rF
, m_xContentGrid(m_xBuilder->weld_container("contentGrid"))
, m_xPreviewWindow(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWindow))
{
- svtools::ColorConfig aColorConfig;
- Color aFillColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
- m_aPreviewWindow.SetBackColor(aFillColor);
initialize();
}
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 4ec72e217772..1000dbf0983e 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1346,15 +1346,6 @@ void SvxCharEffectsPage::EnableNoneFontColor()
m_bEnableNoneFontColor = true;
}
-Color SvxCharEffectsPage::GetPreviewFontColor(const Color& rColor) const
-{
- if (rColor == COL_AUTO)
- return COL_BLACK;
- if (m_bEnableNoneFontColor && rColor == COL_NONE_COLOR)
- return COL_BLACK;
- return rColor;
-}
-
SvxCharEffectsPage::~SvxCharEffectsPage()
{
m_xUnderlineColorLB.reset();
@@ -1431,9 +1422,10 @@ void SvxCharEffectsPage::UpdatePreview_Impl()
SvxFont& rCTLFont = GetPreviewCTLFont();
const Color& rSelectedColor = m_xFontColorLB->GetSelectEntryColor();
- rFont.SetColor(GetPreviewFontColor(rSelectedColor));
- rCJKFont.SetColor(GetPreviewFontColor(rSelectedColor));
- rCTLFont.SetColor(GetPreviewFontColor(rSelectedColor));
+ rFont.SetColor(rSelectedColor);
+ rCJKFont.SetColor(rSelectedColor);
+ rCTLFont.SetColor(rSelectedColor);
+ m_aPreviewWin.AutoCorrectFontColor(); // handle color COL_AUTO
FontLineStyle eUnderline = static_cast<FontLineStyle>(m_xUnderlineLB->get_active_id().toInt32());
FontLineStyle eOverline = static_cast<FontLineStyle>(m_xOverlineLB->get_active_id().toInt32());
@@ -1544,9 +1536,10 @@ void SvxCharEffectsPage::ResetColor_Impl( const SfxItemSet& rSet )
const SvxColorItem& rItem = static_cast<const SvxColorItem&>(rSet.Get( nWhich ));
Color aColor = rItem.GetValue();
- rFont.SetColor(GetPreviewFontColor(aColor));
- rCJKFont.SetColor(GetPreviewFontColor(aColor));
- rCTLFont.SetColor(GetPreviewFontColor(aColor));
+ rFont.SetColor(aColor);
+ rCJKFont.SetColor(aColor);
+ rCTLFont.SetColor(aColor);
+ m_aPreviewWin.AutoCorrectFontColor(); // handle color COL_AUTO
m_aPreviewWin.Invalidate();