diff options
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/hintwin.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 13 |
2 files changed, 17 insertions, 9 deletions
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); |