cui/source/options/optcolor.cxx                        |    1 
 cui/uiconfig/ui/colorconfigwin.ui                      |   71 ++++++++++++-----
 include/svtools/colorcfg.hxx                           |    1 
 officecfg/registry/data/org/openoffice/Office/UI.xcu   |    5 +
 officecfg/registry/schema/org/openoffice/Office/UI.xcs |   10 ++
 sc/source/ui/view/output.cxx                           |   23 ++---
 svtools/source/config/colorcfg.cxx                     |    2 
 7 files changed, 84 insertions(+), 29 deletions(-)

New commits:
commit 07f87f20c8af71faeda500b6b1d7775743bbf646
Author:     Heiko Tietze <tietze.he...@gmail.com>
AuthorDate: Tue Apr 25 14:52:02 2023 +0200
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Tue Apr 25 18:13:57 2023 +0200

    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.tie...@documentfoundation.org>

diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 29d5c5b6d8c6..6daa39b37f1f 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -131,6 +131,7 @@ const vEntryInfo[] =
     { Group_Calc,    IDS(brkauto) },
     { Group_Calc,    IDS_CB(hiddencolrow) },
     { Group_Calc,    IDS_CB(textoverflow) },
+    { Group_Calc,    IDS(comments) },
     { Group_Calc,    IDS(det) },
     { Group_Calc,    IDS(deterror) },
     { Group_Calc,    IDS(ref) },
diff --git a/cui/uiconfig/ui/colorconfigwin.ui 
b/cui/uiconfig/ui/colorconfigwin.ui
index 8b778c236f3c..7b8521b92e30 100644
--- a/cui/uiconfig/ui/colorconfigwin.ui
+++ b/cui/uiconfig/ui/colorconfigwin.ui
@@ -827,7 +827,7 @@
         <property name="label-xalign">0</property>
         <property name="shadow-type">none</property>
         <child>
-          <!-- n-columns=2 n-rows=14 -->
+          <!-- n-columns=2 n-rows=15 -->
           <object class="GtkGrid" id="gdCalc">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
@@ -976,7 +976,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">6</property>
+                <property name="top-attach">7</property>
               </packing>
             </child>
             <child>
@@ -993,7 +993,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">6</property>
+                <property name="top-attach">7</property>
               </packing>
             </child>
             <child>
@@ -1010,7 +1010,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">7</property>
+                <property name="top-attach">8</property>
               </packing>
             </child>
             <child>
@@ -1025,7 +1025,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">7</property>
+                <property name="top-attach">8</property>
               </packing>
             </child>
             <child>
@@ -1042,7 +1042,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">8</property>
+                <property name="top-attach">9</property>
               </packing>
             </child>
             <child>
@@ -1057,7 +1057,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">8</property>
+                <property name="top-attach">9</property>
               </packing>
             </child>
             <child>
@@ -1074,7 +1074,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">9</property>
+                <property name="top-attach">10</property>
               </packing>
             </child>
             <child>
@@ -1089,7 +1089,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">9</property>
+                <property name="top-attach">10</property>
               </packing>
             </child>
             <child>
@@ -1106,7 +1106,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">10</property>
+                <property name="top-attach">11</property>
               </packing>
             </child>
             <child>
@@ -1121,7 +1121,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">10</property>
+                <property name="top-attach">11</property>
               </packing>
             </child>
             <child>
@@ -1138,7 +1138,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">11</property>
+                <property name="top-attach">12</property>
               </packing>
             </child>
             <child>
@@ -1153,7 +1153,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">11</property>
+                <property name="top-attach">12</property>
               </packing>
             </child>
             <child>
@@ -1170,7 +1170,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">12</property>
+                <property name="top-attach">13</property>
               </packing>
             </child>
             <child>
@@ -1185,7 +1185,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">12</property>
+                <property name="top-attach">13</property>
               </packing>
             </child>
             <child>
@@ -1202,7 +1202,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">13</property>
+                <property name="top-attach">14</property>
               </packing>
             </child>
             <child>
@@ -1217,7 +1217,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">13</property>
+                <property name="top-attach">14</property>
               </packing>
             </child>
             <child>
@@ -1306,6 +1306,43 @@
                 <property name="top-attach">5</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkMenuButton" id="comments_lb">
+                <property name="visible">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">False</property>
+                <property name="halign">end</property>
+                <property name="xalign">0</property>
+                <property name="draw-indicator">True</property>
+                <child>
+                  <placeholder/>
+                </child>
+                <child internal-child="accessible">
+                  <object class="AtkObject" id="comments_lb-atkobject">
+                    <property name="AtkObject::accessible-name" 
translatable="yes" context="colorconfigwin|comments_lb">Comments 
color</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="left-attach">1</property>
+                <property name="top-attach">6</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="comments">
+                <property name="visible">True</property>
+                <property name="can-focus">False</property>
+                <property name="halign">start</property>
+                <property name="valign">center</property>
+                <property name="label" translatable="yes" 
context="colorconfigwin|comments">Comments</property>
+                <property name="use-underline">True</property>
+                <property name="mnemonic-widget">comments_lb</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">6</property>
+              </packing>
+            </child>
           </object>
         </child>
         <child type="label">
diff --git a/include/svtools/colorcfg.hxx b/include/svtools/colorcfg.hxx
index 1a6550767abb..97193f4e77ef 100644
--- a/include/svtools/colorcfg.hxx
+++ b/include/svtools/colorcfg.hxx
@@ -59,6 +59,7 @@ enum ColorConfigEntry
     CALCPAGEBREAKAUTOMATIC,
     CALCHIDDENROWCOL    ,
     CALCTEXTOVERFLOW    ,
+    CALCCOMMENTS        ,
     CALCDETECTIVE       ,
     CALCDETECTIVEERROR       ,
     CALCREFERENCE       ,
diff --git a/officecfg/registry/data/org/openoffice/Office/UI.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI.xcu
index d458ee3447a4..f7919aa37c9f 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI.xcu
@@ -324,6 +324,11 @@
             <value xsi:nil="true"/>
           </prop>
         </node>
+        <node oor:name="CalcComments">
+          <prop oor:name="Color">
+            <value xsi:nil="true"/>
+          </prop>
+        </node>
         <node oor:name="CalcDetective">
           <prop oor:name="Color">
             <value xsi:nil="true"/>
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI.xcs 
b/officecfg/registry/schema/org/openoffice/Office/UI.xcs
index d955e8993347..0a87d153674c 100644
--- a/officecfg/registry/schema/org/openoffice/Office/UI.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/UI.xcs
@@ -412,6 +412,16 @@
           </info>
         </prop>
       </group>
+      <group oor:name="CalcComments">
+        <info>
+          <desc>Specifies the settings used for the comments indicator in 
Calc.</desc>
+        </info>
+        <prop oor:name="Color" oor:type="xs:int">
+          <info>
+            <desc>Specifies the color used for the comments indicator.</desc>
+          </info>
+        </prop>
+      </group>
       <group oor:name="CalcDetective">
         <info>
           <desc>Specifies the settings used for audition arrows in Calc.</desc>
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 )
diff --git a/svtools/source/config/colorcfg.cxx 
b/svtools/source/config/colorcfg.cxx
index 4847aeb6bd7d..80c092d892d2 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -139,6 +139,7 @@ uno::Sequence< OUString> 
GetPropertyNames(std::u16string_view rScheme)
         { std::u16string_view(u"/CalcPageBreakAutomatic"), false },
         { std::u16string_view(u"/CalcHiddenColRow"), true },
         { std::u16string_view(u"/CalcTextOverflow"), true },
+        { std::u16string_view(u"/CalcComments"), false },
         { std::u16string_view(u"/CalcDetective")   ,false },
         { std::u16string_view(u"/CalcDetectiveError")   ,false },
         { std::u16string_view(u"/CalcReference")   ,false },
@@ -401,6 +402,7 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry)
         { COL_GRAY7,        COL_GRAY7       }, // CALCPAGEBREAKAUTOMATIC
         { Color(0x2300dc),  Color(0x2300DC) }, // CALCHIDDENCOLROW
         { COL_LIGHTRED,     COL_LIGHTRED    }, // CALCTEXTOVERFLOW
+        { COL_LIGHTMAGENTA, COL_LIGHTMAGENTA}, // CALCCOMMENT
         { COL_LIGHTBLUE,    Color(0x355269) }, // CALCDETECTIVE
         { COL_LIGHTRED,     Color(0xC9211E) }, // CALCDETECTIVEERROR
         { Color(0xef0fff),  Color(0x0D23D5) }, // CALCREFERENCE

Reply via email to