summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-12-17 21:00:02 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-12-18 09:20:41 +0100
commit7777f13cae57833b85627edb98060f97d5ffb053 (patch)
treea9a38f7e541cce6f6df2f580b9124da8d2b3230c
parent60667f8fd9f316c68433f2d304e6c726b79f17b3 (diff)
Resolves: tdf#156398 use same color combination as used in tdf#51300
so we don't get white text on yellow background Change-Id: I346decaab293e2bb15c1110dfa61df5838607d79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178695 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
-rw-r--r--sc/source/ui/inc/overlayobject.hxx3
-rw-r--r--sc/source/ui/view/hintwin.cxx13
-rw-r--r--sc/source/ui/view/tabview3.cxx13
3 files changed, 19 insertions, 10 deletions
diff --git a/sc/source/ui/inc/overlayobject.hxx b/sc/source/ui/inc/overlayobject.hxx
index 35ea695edaf0..525a1bde30f2 100644
--- a/sc/source/ui/inc/overlayobject.hxx
+++ b/sc/source/ui/inc/overlayobject.hxx
@@ -44,7 +44,7 @@ private:
class ScOverlayHint : public sdr::overlay::OverlayObject
{
public:
- ScOverlayHint(OUString aTit, const OUString& rMsg, const Color& rColor, vcl::Font aFont);
+ ScOverlayHint(OUString aTit, const OUString& rMsg, const Color& rBack, const Color& rText, vcl::Font aFont);
Size GetSizePixel() const;
void SetPos(const Point& rPos, const MapMode& rMode);
@@ -57,6 +57,7 @@ private:
const OUString m_aTitle;
const OUString m_aMessage;
const vcl::Font m_aTextFont;
+ const Color m_aTextColor;
MapMode m_aMapMode;
sal_Int32 m_nLeft;
sal_Int32 m_nTop;
diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx
index fbc0b17596b3..a322cc324a4b 100644
--- a/sc/source/ui/view/hintwin.cxx
+++ b/sc/source/ui/view/hintwin.cxx
@@ -38,11 +38,14 @@
#define HINT_INDENT 3
#define HINT_MARGIN 4
-ScOverlayHint::ScOverlayHint(OUString aTit, const OUString& rMsg, const Color& rColor, vcl::Font aFont)
- : OverlayObject(rColor)
+ScOverlayHint::ScOverlayHint(OUString aTit, const OUString& rMsg,
+ const Color& rBackColor, const Color& rTextColor,
+ vcl::Font aFont)
+ : OverlayObject(rBackColor)
, m_aTitle(std::move(aTit))
, m_aMessage(convertLineEnd(rMsg, LINEEND_CR))
, m_aTextFont(std::move(aFont))
+ , m_aTextColor(rTextColor)
, m_aMapMode(MapUnit::MapPixel)
, m_nLeft(0)
, m_nTop(0)
@@ -57,8 +60,6 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlaySequ
MapMode aOld = pDefaultDev->GetMapMode();
pDefaultDev->SetMapMode(rMapMode);
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- const Color& rColor = rStyleSettings.GetLabelTextColor();
vcl::Font aTextFont = m_aTextFont;
aTextFont.SetFontSize(pDefaultDev->PixelToLogic(aTextFont.GetFontSize(), rMapMode));
vcl::Font aHeadFont = aTextFont;
@@ -84,7 +85,7 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlaySequ
new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
aTextMatrix, m_aTitle, 0, m_aTitle.getLength(),
std::vector<double>(), {}, std::move(aFontAttr), css::lang::Locale(),
- rColor.getBColor());
+ m_aTextColor.getBColor());
Point aTextStart(nLeft + aHintMargin.Width() + aIndent.Width(),
nTop + aHintMargin.Height() + aFontMetric.GetLineHeight() + aIndent.Height());
@@ -125,7 +126,7 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlaySequ
new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
aTextMatrix, aLine, 0, aLine.getLength(),
std::vector<double>(), {}, aFontAttr, css::lang::Locale(),
- rColor.getBColor());
+ m_aTextColor.getBColor());
rRange.expand(pMessage->getB2DRange(aDummy));
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 68642aee1c24..f9e534d55cd2 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -835,9 +835,13 @@ void ScTabView::TestHintWindow()
aPos.X() < aWinSize.Width() && aPos.Y() < aWinSize.Height() )
{
const svtools::ColorConfig& rColorCfg = ScModule::get()->GetColorConfig();
- Color aCommentColor = rColorCfg.GetColorValue(svtools::CALCNOTESBACKGROUND).nColor;
+ // tdf#156398 use same color combination as used in XclDefaultPalette
+ Color aCommentText = rColorCfg.GetColorValue(svtools::FONTCOLOR).nColor;
+ Color aCommentBack = rColorCfg.GetColorValue(svtools::CALCNOTESBACKGROUND).nColor;
// create HintWindow, determines its size by itself
- ScOverlayHint* pOverlay = new ScOverlayHint(aTitle, aMessage, aCommentColor, pFrameWin->GetFont());
+ ScOverlayHint* pOverlay = new ScOverlayHint(aTitle, aMessage,
+ aCommentBack, aCommentText,
+ pFrameWin->GetFont());
mxInputHintOO.reset(new sdr::overlay::OverlayObjectList);
mxInputHintOO->append(std::unique_ptr<sdr::overlay::OverlayObject>(pOverlay));
@@ -872,7 +876,10 @@ void ScTabView::TestHintWindow()
//missing portions will be displayed in the other split windows to form an apparent
//single tip, albeit "under" the split lines
Point aOtherPos(pWindow->ScreenToOutputPixel(pWin->OutputToScreenPixel(aHintPos)));
- std::unique_ptr<ScOverlayHint> pOtherOverlay(new ScOverlayHint(aTitle, aMessage, aCommentColor, pFrameWin->GetFont()));
+ std::unique_ptr<ScOverlayHint> pOtherOverlay(new ScOverlayHint(aTitle, aMessage,
+ aCommentBack,
+ aCommentText,
+ pFrameWin->GetFont()));
Point aFooPos(pWindow->PixelToLogic(aOtherPos, pWindow->GetDrawMapMode()));
pOtherOverlay->SetPos(aFooPos, pWindow->GetDrawMapMode());
xOverlayManager->add(*pOtherOverlay);