basctl/source/basicide/baside2.cxx                     |    2 
 cui/source/options/optcolor.cxx                        |    1 
 cui/uiconfig/ui/colorconfigwin.ui                      |   65 ++++++++++++-----
 include/svtools/colorcfg.hxx                           |    1 
 officecfg/registry/data/org/openoffice/Office/UI.xcu   |   10 ++
 officecfg/registry/schema/org/openoffice/Office/UI.xcs |   10 ++
 svtools/source/config/colorcfg.cxx                     |    2 
 7 files changed, 74 insertions(+), 17 deletions(-)

New commits:
commit 413bd0a96b010feb10dc3d76efa266ea082de006
Author:     Rafael Lima <rafael.palma.l...@gmail.com>
AuthorDate: Tue Jan 17 19:47:45 2023 +0000
Commit:     Rafael Lima <rafael.palma.l...@gmail.com>
CommitDate: Tue Jan 24 15:37:10 2023 +0000

    tdf#153076 Make Basic editor background color independent from document 
color
    
    This patch creates a separate color configuration entry for the background 
of the Basic Editor (svtools::BASICEDITOR). This allows the user to set the 
color of the Basic Editor independently from the color used as document 
background.
    
    Currently the color used is DOCCOLOR, which means that if the user wants to 
use a different color in the Basic Editor, they must change the document color 
as well. However, the user may want to use f.i. a dark background in the Basic 
editor while maintaining a white color for documents, which is currently not 
possible.
    
    By default, both color schemes "LibreOffice" and "LibreOffice Dark" use the 
same color for DOCCOLOR and BASICEDITOR to replicate the existing behavior. But 
now, if the user wants to use a different color for the Basic Editor, than it's 
possible to change it without affecting the color of documents.
    
    Change-Id: I2f33b1ccb497d7e22faab7fa48cb96841785ce99
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145590
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/basctl/source/basicide/baside2.cxx 
b/basctl/source/basicide/baside2.cxx
index 3c184850d76b..31fee2eeccb4 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -1564,7 +1564,7 @@ void ModulWindowLayout::SyntaxColors::NewConfig (bool 
bFirst)
         { TokenType::Keywords,    svtools::BASICKEYWORD },
     };
 
-    Color aDocColor = aConfig.GetColorValue(svtools::DOCCOLOR).nColor;
+    Color aDocColor = aConfig.GetColorValue(svtools::BASICEDITOR).nColor;
     if (bFirst || aDocColor != m_aBackgroundColor)
     {
         m_aBackgroundColor = aDocColor;
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 70345fc5e40f..3c66f4ba49d5 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -140,6 +140,7 @@ const vEntryInfo[] =
 
     { Group_Draw,    IDS(drawgrid) },
 
+    { Group_Basic,   IDS(basiceditor) },
     { Group_Basic,   IDS(basicid) },
     { Group_Basic,   IDS(basiccomment) },
     { Group_Basic,   IDS(basicnumber) },
diff --git a/cui/uiconfig/ui/colorconfigwin.ui 
b/cui/uiconfig/ui/colorconfigwin.ui
index 824628763b04..3094a66d0c59 100644
--- a/cui/uiconfig/ui/colorconfigwin.ui
+++ b/cui/uiconfig/ui/colorconfigwin.ui
@@ -1390,7 +1390,7 @@
         <property name="label-xalign">0</property>
         <property name="shadow-type">none</property>
         <child>
-          <!-- n-columns=2 n-rows=7 -->
+          <!-- n-columns=2 n-rows=8 -->
           <object class="GtkGrid" id="gdBasic">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
@@ -1414,7 +1414,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">0</property>
+                <property name="top-attach">1</property>
               </packing>
             </child>
             <child>
@@ -1429,7 +1429,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">0</property>
+                <property name="top-attach">1</property>
               </packing>
             </child>
             <child>
@@ -1447,7 +1447,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">1</property>
+                <property name="top-attach">2</property>
               </packing>
             </child>
             <child>
@@ -1462,7 +1462,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">1</property>
+                <property name="top-attach">2</property>
               </packing>
             </child>
             <child>
@@ -1480,7 +1480,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">2</property>
+                <property name="top-attach">3</property>
               </packing>
             </child>
             <child>
@@ -1495,7 +1495,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">2</property>
+                <property name="top-attach">3</property>
               </packing>
             </child>
             <child>
@@ -1513,7 +1513,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">3</property>
+                <property name="top-attach">4</property>
               </packing>
             </child>
             <child>
@@ -1528,7 +1528,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">3</property>
+                <property name="top-attach">4</property>
               </packing>
             </child>
             <child>
@@ -1546,7 +1546,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">4</property>
+                <property name="top-attach">5</property>
               </packing>
             </child>
             <child>
@@ -1554,14 +1554,14 @@
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
                 <property name="halign">start</property>
-                <property name="valign">end</property>
+                <property name="valign">center</property>
                 <property name="label" translatable="yes" 
context="colorconfigwin|basicop">Operator</property>
                 <property name="use-underline">True</property>
                 <property name="mnemonic-widget">basicop_lb</property>
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">4</property>
+                <property name="top-attach">5</property>
               </packing>
             </child>
             <child>
@@ -1579,7 +1579,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">5</property>
+                <property name="top-attach">6</property>
               </packing>
             </child>
             <child>
@@ -1594,7 +1594,7 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">5</property>
+                <property name="top-attach">6</property>
               </packing>
             </child>
             <child>
@@ -1612,7 +1612,7 @@
               </object>
               <packing>
                 <property name="left-attach">1</property>
-                <property name="top-attach">6</property>
+                <property name="top-attach">7</property>
               </packing>
             </child>
             <child>
@@ -1627,7 +1627,40 @@
               </object>
               <packing>
                 <property name="left-attach">0</property>
-                <property name="top-attach">6</property>
+                <property name="top-attach">7</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkMenuButton" id="basiceditor_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>
+                <property name="label" translatable="no"></property>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="left-attach">1</property>
+                <property name="top-attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="basiceditor">
+                <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|basiceditor">Editor background</property>
+                <property name="use-underline">True</property>
+                <property name="mnemonic-widget">basiceditor_lb</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">0</property>
               </packing>
             </child>
           </object>
diff --git a/include/svtools/colorcfg.hxx b/include/svtools/colorcfg.hxx
index 300625cf14a7..f0c0fea5393d 100644
--- a/include/svtools/colorcfg.hxx
+++ b/include/svtools/colorcfg.hxx
@@ -67,6 +67,7 @@ enum ColorConfigEntry
     CALCTEXT,
     CALCPROTECTEDBACKGROUND,
     DRAWGRID            ,
+    BASICEDITOR,
     BASICIDENTIFIER,
     BASICCOMMENT   ,
     BASICNUMBER    ,
diff --git a/officecfg/registry/data/org/openoffice/Office/UI.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI.xcu
index ec29706fd030..18aa40bbfa8b 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI.xcu
@@ -364,6 +364,11 @@
             <value xsi:nil="true"/>
           </prop>
         </node>
+        <node oor:name="BASICEditor">
+          <prop oor:name="Color" oor:type="xs:int">
+            <value xsi:nil="true"/>
+          </prop>
+        </node>
         <node oor:name="BASICIdentifier">
           <prop oor:name="Color" oor:type="xs:int">
             <value xsi:nil="true"/>
@@ -662,6 +667,11 @@
             <value xsi:nil="true"/>
           </prop>
         </node>
+        <node oor:name="BASICEditor">
+          <prop oor:name="Color" oor:type="xs:int">
+            <value>1842204</value>
+          </prop>
+        </node>
         <node oor:name="BASICIdentifier">
           <prop oor:name="Color" oor:type="xs:int">
             <value>14543051</value>
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI.xcs 
b/officecfg/registry/schema/org/openoffice/Office/UI.xcs
index 9afbbc4116d0..303b99b666ef 100644
--- a/officecfg/registry/schema/org/openoffice/Office/UI.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/UI.xcs
@@ -492,6 +492,16 @@
           </info>
         </prop>
       </group>
+      <group oor:name="BASICEditor">
+        <info>
+          <desc>Specifies the settings of the BASIC code editor.</desc>
+        </info>
+        <prop oor:name="Color" oor:type="xs:int">
+          <info>
+            <desc>Specifies the color used as background in the Basic code 
editor.</desc>
+          </info>
+        </prop>
+      </group>
       <group oor:name="BASICIdentifier">
         <info>
           <desc>Specifies the settings for identifiers in BASIC source 
code.</desc>
diff --git a/svtools/source/config/colorcfg.cxx 
b/svtools/source/config/colorcfg.cxx
index ad3170b430ab..2d584d9c5d95 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -146,6 +146,7 @@ uno::Sequence< OUString> 
GetPropertyNames(std::u16string_view rScheme)
         { std::u16string_view(u"/CalcText") ,false },
         { std::u16string_view(u"/CalcProtectedBackground") ,false },
         { std::u16string_view(u"/DrawGrid")        ,true },
+        { std::u16string_view(u"/BASICEditor"),  false },
         { std::u16string_view(u"/BASICIdentifier"),  false },
         { std::u16string_view(u"/BASICComment")   ,  false },
         { std::u16string_view(u"/BASICNumber")    ,  false },
@@ -402,6 +403,7 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry)
         COL_BLACK, // CALCTEXT
         COL_LIGHTGRAY, // CALCPROTECTEDBACKGROUND
         COL_GRAY7, // DRAWGRID
+        COL_WHITE, // BASICIEDITOR,
         COL_GREEN, // BASICIDENTIFIER,
         COL_GRAY, // BASICCOMMENT,
         COL_LIGHTRED, // BASICNUMBER,

Reply via email to