diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2023-04-25 14:52:02 +0200 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2023-04-25 18:13:57 +0200 |
commit | 07f87f20c8af71faeda500b6b1d7775743bbf646 (patch) | |
tree | 472e29431516db2e4cb89748c6ecae345c6c19f2 /sc | |
parent | bb0e041a237a1c4ad4f5c0bd092fc3da5c18b7f1 (diff) |
Resolves tdf#154080 - Allow customization of comment indicator color
* New application color added
* Border color depending on cell/sheet background
* Comments color set to light magenta to align with similar tools
Change-Id: I782e8359632c5a319e61f5d5ac3deb4614bd7e79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150970
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/output.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 025151e40501..8608817b6099 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -2377,8 +2377,6 @@ void ScOutputData::DrawSparklines(vcl::RenderContext& rRenderContext) void ScOutputData::DrawNoteMarks(vcl::RenderContext& rRenderContext) { - bool bFirst = true; - tools::Long nInitPosX = nScrX; if ( bLayoutRTL ) nInitPosX += nMirrorW - 1; // always in pixels @@ -2409,18 +2407,19 @@ void ScOutputData::DrawNoteMarks(vcl::RenderContext& rRenderContext) if (!mpDoc->ColHidden(nX, nTab) && mpDoc->GetNote(nX, pRowInfo[nArrY].nRowNo, nTab) && (bIsMerged || (!pInfo->bHOverlapped && !pInfo->bVOverlapped))) { - if (bFirst) - { - rRenderContext.SetLineColor(COL_WHITE); - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - if ( mbUseStyleColor && rStyleSettings.GetHighContrastMode() ) - rRenderContext.SetFillColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor ); - else - rRenderContext.SetFillColor(COL_LIGHTRED); + const bool bIsDarkBackground = SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor.IsDark(); + const Color aColor = pInfo->pBackground->GetColor(); + if ( aColor == COL_AUTO ? bIsDarkBackground : aColor.IsDark() ) + rRenderContext.SetLineColor(COL_WHITE); + else + rRenderContext.SetLineColor(COL_BLACK); - bFirst = false; - } + const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + if ( mbUseStyleColor && rStyleSettings.GetHighContrastMode() ) + rRenderContext.SetFillColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor ); + else + rRenderContext.SetFillColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCCOMMENTS).nColor ); tools::Long nMarkX = nPosX + ( pRowInfo[0].basicCellInfo(nX).nWidth - 2 ) * nLayoutSign; if ( bIsMerged || pInfo->bMerged ) |