summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-10-13 10:41:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-10-13 14:52:51 +0200
commit2734d2e058182a34c576e558138d84358c69ca5a (patch)
treed2f9ac6bc945c6aa1d3cc6e2e3b540a828d0e8f7 /vcl
parentee0d5e7bb8614c50e71dd074b8440f412eb62ff3 (diff)
tdf#150622 use high contrast selection fg/bg colors for text selection
with SettingsForSelection SettingsText -> HighlightTextColor SettingsFill -> HighlightColor SettingsLine -> HighlightColor Change-Id: Iaac5834ce0f8b3f1b89376711b564773cfd0bfe3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141287 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/outdev/gradient.cxx7
-rw-r--r--vcl/source/rendercontext/drawmode.cxx30
2 files changed, 30 insertions, 7 deletions
diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx
index bd19cd50a40c..707ca47d960a 100644
--- a/vcl/source/outdev/gradient.cxx
+++ b/vcl/source/outdev/gradient.cxx
@@ -617,7 +617,12 @@ Color OutputDevice::GetSingleColorGradientFill()
else if ( mnDrawMode & DrawModeFlags::WhiteGradient )
aColor = COL_WHITE;
else if ( mnDrawMode & DrawModeFlags::SettingsGradient )
- aColor = GetSettings().GetStyleSettings().GetWindowColor();
+ {
+ if (mnDrawMode & DrawModeFlags::SettingsForSelection)
+ aColor = GetSettings().GetStyleSettings().GetHighlightColor();
+ else
+ aColor = GetSettings().GetStyleSettings().GetWindowColor();
+ }
return aColor;
}
diff --git a/vcl/source/rendercontext/drawmode.cxx b/vcl/source/rendercontext/drawmode.cxx
index fe0a1660acd5..9819be3fa866 100644
--- a/vcl/source/rendercontext/drawmode.cxx
+++ b/vcl/source/rendercontext/drawmode.cxx
@@ -53,7 +53,10 @@ Color GetLineColor(Color const& rColor, DrawModeFlags nDrawMode,
}
else if (nDrawMode & DrawModeFlags::SettingsLine)
{
- aColor = rStyleSettings.GetWindowTextColor();
+ if (nDrawMode & DrawModeFlags::SettingsForSelection)
+ aColor = rStyleSettings.GetHighlightColor();
+ else
+ aColor = rStyleSettings.GetWindowTextColor();
}
}
}
@@ -91,7 +94,10 @@ Color GetFillColor(Color const& rColor, DrawModeFlags nDrawMode,
}
else if (nDrawMode & DrawModeFlags::SettingsFill)
{
- aColor = rStyleSettings.GetWindowColor();
+ if (nDrawMode & DrawModeFlags::SettingsForSelection)
+ aColor = rStyleSettings.GetHighlightColor();
+ else
+ aColor = rStyleSettings.GetWindowColor();
}
}
}
@@ -119,7 +125,10 @@ Color GetHatchColor(Color const& rColor, DrawModeFlags nDrawMode,
}
else if (nDrawMode & DrawModeFlags::SettingsLine)
{
- aColor = rStyleSettings.GetWindowTextColor();
+ if (nDrawMode & DrawModeFlags::SettingsForSelection)
+ aColor = rStyleSettings.GetHighlightColor();
+ else
+ aColor = rStyleSettings.GetWindowTextColor();
}
return aColor;
@@ -149,7 +158,10 @@ Color GetTextColor(Color const& rColor, DrawModeFlags nDrawMode,
}
else if (nDrawMode & DrawModeFlags::SettingsText)
{
- aColor = rStyleSettings.GetWindowTextColor();
+ if (nDrawMode & DrawModeFlags::SettingsForSelection)
+ aColor = rStyleSettings.GetHighlightTextColor();
+ else
+ aColor = rStyleSettings.GetWindowTextColor();
}
}
@@ -183,7 +195,10 @@ vcl::Font GetFont(vcl::Font const& rFont, DrawModeFlags nDrawMode,
}
else if (nDrawMode & DrawModeFlags::SettingsText)
{
- aTextColor = rStyleSettings.GetWindowTextColor();
+ if (nDrawMode & DrawModeFlags::SettingsForSelection)
+ aTextColor = rStyleSettings.GetHighlightTextColor();
+ else
+ aTextColor = rStyleSettings.GetWindowTextColor();
}
aFont.SetColor(aTextColor);
@@ -207,7 +222,10 @@ vcl::Font GetFont(vcl::Font const& rFont, DrawModeFlags nDrawMode,
}
else if (nDrawMode & DrawModeFlags::SettingsFill)
{
- aTextFillColor = rStyleSettings.GetWindowColor();
+ if (nDrawMode & DrawModeFlags::SettingsForSelection)
+ aTextFillColor = rStyleSettings.GetHighlightColor();
+ else
+ aTextFillColor = rStyleSettings.GetWindowColor();
}
else if (nDrawMode & DrawModeFlags::NoFill)
{