summaryrefslogtreecommitdiff
path: root/vcl/source/edit/vclmedit.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/edit/vclmedit.cxx')
-rw-r--r--vcl/source/edit/vclmedit.cxx74
1 files changed, 53 insertions, 21 deletions
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index cc2b52e658b7..0225f79d487e 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -914,8 +914,36 @@ WinBits VclMultiLineEdit::ImplInitStyle( WinBits nStyle )
return nStyle;
}
-void VclMultiLineEdit::ApplyBackgroundSettings(vcl::RenderContext& rRenderContext, const StyleSettings& rStyleSettings)
+void VclMultiLineEdit::ApplySettings(vcl::RenderContext& rRenderContext)
{
+ const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
+
+ // The Font has to be adjusted, as the TextEngine does not take care of
+ // TextColor/Background
+
+ Color aTextColor = rStyleSettings.GetFieldTextColor();
+ if (IsControlForeground())
+ aTextColor = GetControlForeground();
+
+ if (!IsEnabled())
+ aTextColor = rStyleSettings.GetDisableColor();
+
+ vcl::Font aFont = rStyleSettings.GetFieldFont();
+ aFont.SetTransparent(IsPaintTransparent());
+ ApplyControlFont(rRenderContext, aFont);
+
+ vcl::Font theFont = rRenderContext.GetFont();
+ theFont.SetColor(aTextColor);
+ if (IsPaintTransparent())
+ theFont.SetFillColor(COL_TRANSPARENT);
+ else
+ theFont.SetFillColor(IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor());
+
+ pImpVclMEdit->GetTextWindow()->SetFont(theFont);
+ // FIXME: next call causes infinite invalidation loop, rethink how to properly fix this situation
+ // pImpVclMEdit->GetTextWindow()->GetTextEngine()->SetFont(theFont);
+ pImpVclMEdit->GetTextWindow()->SetTextColor(aTextColor);
+
if (IsPaintTransparent())
{
pImpVclMEdit->GetTextWindow()->SetPaintTransparent(true);
@@ -935,8 +963,10 @@ void VclMultiLineEdit::ApplyBackgroundSettings(vcl::RenderContext& rRenderContex
}
}
-void VclMultiLineEdit::ApplyFontSettings(vcl::RenderContext& rRenderContext, const StyleSettings& rStyleSettings)
+void VclMultiLineEdit::ImplInitSettings(bool bBackground)
{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
// The Font has to be adjusted, as the TextEngine does not take care of
// TextColor/Background
@@ -948,36 +978,38 @@ void VclMultiLineEdit::ApplyFontSettings(vcl::RenderContext& rRenderContext, con
vcl::Font aFont = rStyleSettings.GetFieldFont();
aFont.SetTransparent(IsPaintTransparent());
- ApplyControlFont(rRenderContext, aFont);
+ ApplyControlFont(*this, aFont);
- vcl::Font TheFont = rRenderContext.GetFont();
+ vcl::Font TheFont = GetFont();
TheFont.SetColor(aTextColor);
if (IsPaintTransparent())
TheFont.SetFillColor(COL_TRANSPARENT);
else
TheFont.SetFillColor(IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor());
-
pImpVclMEdit->GetTextWindow()->SetFont(TheFont);
pImpVclMEdit->GetTextWindow()->GetTextEngine()->SetFont(TheFont);
pImpVclMEdit->GetTextWindow()->SetTextColor(aTextColor);
-}
-
-void VclMultiLineEdit::ApplySettings(vcl::RenderContext& rRenderContext)
-{
- const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
-
- ApplyFontSettings(rRenderContext, rStyleSettings);
- ApplyBackgroundSettings(rRenderContext, rStyleSettings);
-}
-
-void VclMultiLineEdit::ImplInitSettings(bool bBackground)
-{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- ApplyFontSettings(*this, rStyleSettings);
if (bBackground)
- ApplyBackgroundSettings(*this, rStyleSettings);
+ {
+ if (IsPaintTransparent())
+ {
+ pImpVclMEdit->GetTextWindow()->SetPaintTransparent(true);
+ pImpVclMEdit->GetTextWindow()->SetBackground();
+ pImpVclMEdit->GetTextWindow()->SetControlBackground();
+ SetBackground();
+ SetControlBackground();
+ }
+ else
+ {
+ if (IsControlBackground())
+ pImpVclMEdit->GetTextWindow()->SetBackground(GetControlBackground());
+ else
+ pImpVclMEdit->GetTextWindow()->SetBackground(rStyleSettings.GetFieldColor());
+ // also adjust for VclMultiLineEdit as the TextComponent might hide Scrollbars
+ SetBackground(pImpVclMEdit->GetTextWindow()->GetBackground());
+ }
+ }
}
void VclMultiLineEdit::Modify()