include/svx/optgrid.hxx                     |    7 +
 svx/source/dialog/optgrid.cxx               |   28 ++++++
 svx/uiconfig/ui/optgridpage.ui              |  115 +++++++++++++++++++++++++---
 sw/uiconfig/swriter/ui/optformataidspage.ui |   14 +--
 4 files changed, 145 insertions(+), 19 deletions(-)

New commits:
commit 6c031c31de72a0eda0a24af52aa041049ef16584
Author:     Balazs Varga <[email protected]>
AuthorDate: Fri Nov 10 11:56:56 2023 +0100
Commit:     Balazs Varga <[email protected]>
CommitDate: Mon Nov 13 09:19:59 2023 +0100

    resave with newer glade version
    
    Change-Id: Iba7a427b98552cb297f0b764473e3750063369b4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159304
    Tested-by: Jenkins
    Reviewed-by: Balazs Varga <[email protected]>

diff --git a/sw/uiconfig/swriter/ui/optformataidspage.ui 
b/sw/uiconfig/swriter/ui/optformataidspage.ui
index c2595de4a362..62074f3160d9 100644
--- a/sw/uiconfig/swriter/ui/optformataidspage.ui
+++ b/sw/uiconfig/swriter/ui/optformataidspage.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.38.1 -->
+<!-- Generated with glade 3.38.2 -->
 <interface domain="sw">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkBox" id="OptFormatAidsPage">
@@ -25,10 +25,10 @@
               <object class="GtkGrid" id="grid2">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
-                <property name="row-spacing">6</property>
-                <property name="column-spacing">6</property>
                 <property name="margin-start">12</property>
                 <property name="margin-top">6</property>
+                <property name="row-spacing">6</property>
+                <property name="column-spacing">6</property>
                 <child>
                   <object class="GtkCheckButton" id="paragraph">
                     <property name="label" translatable="yes" 
context="optformataidspage|paragraph">Pa_ragraph end</property>
@@ -279,9 +279,9 @@
               <object class="GtkGrid" id="grid5">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
-                <property name="row-spacing">6</property>
                 <property name="margin-start">12</property>
                 <property name="margin-top">6</property>
+                <property name="row-spacing">6</property>
                 <child>
                   <object class="GtkCheckButton" id="mathbaseline">
                     <property name="label" translatable="yes" 
context="optformataidspage|mathbaseline">Math baseline alignment</property>
@@ -326,9 +326,9 @@
               <object class="GtkGrid" id="grid6">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
-                <property name="row-spacing">6</property>
                 <property name="margin-start">12</property>
                 <property name="margin-top">6</property>
+                <property name="row-spacing">6</property>
                 <child>
                   <object class="GtkCheckButton" id="cursorinprot">
                     <property name="label" translatable="yes" 
context="optformataidspage|cursorinprot">Enable cursor</property>
@@ -382,9 +382,9 @@
                   <object class="GtkGrid" id="grid3">
                     <property name="visible">True</property>
                     <property name="can-focus">False</property>
-                    <property name="row-spacing">6</property>
                     <property name="margin-start">12</property>
                     <property name="margin-top">6</property>
+                    <property name="row-spacing">6</property>
                     <child>
                       <object class="GtkCheckButton" id="cursoronoff">
                         <property name="label" translatable="yes" 
context="optformataidspage|cursoronoff">_Direct cursor</property>
@@ -479,9 +479,9 @@
                   <object class="GtkBox">
                     <property name="visible">True</property>
                     <property name="can-focus">False</property>
-                    <property name="spacing">6</property>
                     <property name="margin-start">12</property>
                     <property name="margin-top">6</property>
+                    <property name="spacing">6</property>
                     <child>
                       <object class="GtkLabel" id="lbDefaultAnchor">
                         <property name="visible">True</property>
commit d6f174291003f058f7cd0bec6b838e1c94267b32
Author:     Balazs Varga <[email protected]>
AuthorDate: Fri Nov 10 11:19:04 2023 +0100
Commit:     Balazs Varga <[email protected]>
CommitDate: Mon Nov 13 09:19:46 2023 +0100

    tdf#158008 - UI: Part 23 - Unify lockdown behavior of Options dialog
    
    for Writer - Grid Page.
    
    Change-Id: Ia492d0d742050d1ceec3c9ab68bf3378355977e3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159290
    Tested-by: Jenkins
    Reviewed-by: Balazs Varga <[email protected]>

diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx
index 223f2da7d00b..f27a4bf78d29 100644
--- a/include/svx/optgrid.hxx
+++ b/include/svx/optgrid.hxx
@@ -106,12 +106,19 @@ private:
     bool                bAttrModified;
 
     std::unique_ptr<weld::CheckButton> m_xCbxUseGridsnap;
+    std::unique_ptr<weld::Widget> m_xCbxUseGridsnapImg;
     std::unique_ptr<weld::CheckButton> m_xCbxGridVisible;
+    std::unique_ptr<weld::Widget> m_xCbxGridVisibleImg;
     std::unique_ptr<weld::MetricSpinButton> m_xMtrFldDrawX;
+    std::unique_ptr<weld::Widget> m_xMtrFldDrawXImg;
     std::unique_ptr<weld::MetricSpinButton> m_xMtrFldDrawY;
+    std::unique_ptr<weld::Widget> m_xMtrFldDrawYImg;
     std::unique_ptr<weld::SpinButton> m_xNumFldDivisionX;
+    std::unique_ptr<weld::Widget> m_xNumFldDivisionXImg;
     std::unique_ptr<weld::SpinButton> m_xNumFldDivisionY;
+    std::unique_ptr<weld::Widget> m_xNumFldDivisionYImg;
     std::unique_ptr<weld::CheckButton> m_xCbxSynchronize;
+    std::unique_ptr<weld::Widget> m_xCbxSynchronizeImg;
 protected:
     //these controls are used in draw and impress
     std::unique_ptr<weld::Widget> m_xSnapFrames;
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index 736c9c798827..cd73ae223961 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -19,6 +19,7 @@
 
 #include <svl/intitem.hxx>
 #include <svtools/unitconv.hxx>
+#include <officecfg/Office/Writer.hxx>
 
 #include <svx/svxids.hrc>
 #include <svx/optgrid.hxx>
@@ -91,12 +92,19 @@ SvxGridTabPage::SvxGridTabPage(weld::Container* pPage, 
weld::DialogController* p
     : SfxTabPage(pPage, pController, "svx/ui/optgridpage.ui", "OptGridPage", 
&rCoreSet)
     , bAttrModified(false)
     , m_xCbxUseGridsnap(m_xBuilder->weld_check_button("usegridsnap"))
+    , m_xCbxUseGridsnapImg(m_xBuilder->weld_widget("lockusegridsnap"))
     , m_xCbxGridVisible(m_xBuilder->weld_check_button("gridvisible"))
+    , m_xCbxGridVisibleImg(m_xBuilder->weld_widget("lockgridvisible"))
     , m_xMtrFldDrawX(m_xBuilder->weld_metric_spin_button("mtrflddrawx", 
FieldUnit::CM))
+    , m_xMtrFldDrawXImg(m_xBuilder->weld_widget("lockmtrflddrawx"))
     , m_xMtrFldDrawY(m_xBuilder->weld_metric_spin_button("mtrflddrawy", 
FieldUnit::CM))
+    , m_xMtrFldDrawYImg(m_xBuilder->weld_widget("lockmtrflddrawy"))
     , m_xNumFldDivisionX(m_xBuilder->weld_spin_button("numflddivisionx"))
+    , m_xNumFldDivisionXImg(m_xBuilder->weld_widget("locknumflddivisionx"))
     , m_xNumFldDivisionY(m_xBuilder->weld_spin_button("numflddivisiony"))
+    , m_xNumFldDivisionYImg(m_xBuilder->weld_widget("locknumflddivisiony"))
     , m_xCbxSynchronize(m_xBuilder->weld_check_button("synchronize"))
+    , m_xCbxSynchronizeImg(m_xBuilder->weld_widget("locksynchronize"))
     , m_xSnapFrames(m_xBuilder->weld_widget("snapframes"))
     , m_xCbxSnapHelplines(m_xBuilder->weld_check_button("snaphelplines"))
     , m_xCbxSnapBorder(m_xBuilder->weld_check_button("snapborder"))
@@ -206,15 +214,35 @@ void SvxGridTabPage::Reset( const SfxItemSet* rSet )
     if( (pGridAttr = rSet->GetItemIfSet( SID_ATTR_GRID_OPTIONS , false )) )
     {
         m_xCbxUseGridsnap->set_active(pGridAttr->bUseGridsnap);
+        
m_xCbxUseGridsnap->set_sensitive(!officecfg::Office::Writer::Grid::Option::SnapToGrid::isReadOnly());
+        
m_xCbxUseGridsnapImg->set_visible(officecfg::Office::Writer::Grid::Option::SnapToGrid::isReadOnly());
+
         m_xCbxSynchronize->set_active(pGridAttr->bSynchronize);
+        
m_xCbxSynchronize->set_sensitive(!officecfg::Office::Writer::Grid::Option::Synchronize::isReadOnly());
+        
m_xCbxSynchronizeImg->set_visible(officecfg::Office::Writer::Grid::Option::Synchronize::isReadOnly());
+
         m_xCbxGridVisible->set_active(pGridAttr->bGridVisible);
+        
m_xCbxGridVisible->set_sensitive(!officecfg::Office::Writer::Grid::Option::VisibleGrid::isReadOnly());
+        
m_xCbxGridVisibleImg->set_visible(officecfg::Office::Writer::Grid::Option::VisibleGrid::isReadOnly());
 
         MapUnit eUnit = rSet->GetPool()->GetMetric( SID_ATTR_GRID_OPTIONS );
         SetMetricValue( *m_xMtrFldDrawX , pGridAttr->nFldDrawX, eUnit );
         SetMetricValue( *m_xMtrFldDrawY , pGridAttr->nFldDrawY, eUnit );
 
+        
m_xMtrFldDrawX->set_sensitive(!officecfg::Office::Writer::Grid::Resolution::XAxis::isReadOnly());
+        
m_xMtrFldDrawXImg->set_visible(officecfg::Office::Writer::Grid::Resolution::XAxis::isReadOnly());
+
+        
m_xMtrFldDrawY->set_sensitive(!officecfg::Office::Writer::Grid::Resolution::YAxis::isReadOnly());
+        
m_xMtrFldDrawYImg->set_visible(officecfg::Office::Writer::Grid::Resolution::YAxis::isReadOnly());
+
         m_xNumFldDivisionX->set_value(pGridAttr->nFldDivisionX + 1);
         m_xNumFldDivisionY->set_value(pGridAttr->nFldDivisionY + 1);
+
+        
m_xNumFldDivisionX->set_sensitive(!officecfg::Office::Writer::Grid::Subdivision::XAxis::isReadOnly());
+        
m_xNumFldDivisionXImg->set_visible(officecfg::Office::Writer::Grid::Subdivision::XAxis::isReadOnly());
+
+        
m_xNumFldDivisionY->set_sensitive(!officecfg::Office::Writer::Grid::Subdivision::YAxis::isReadOnly());
+        
m_xNumFldDivisionYImg->set_visible(officecfg::Office::Writer::Grid::Subdivision::YAxis::isReadOnly());
     }
 
     ChangeGridsnapHdl_Impl(*m_xCbxUseGridsnap);
diff --git a/svx/uiconfig/ui/optgridpage.ui b/svx/uiconfig/ui/optgridpage.ui
index 3936a092c048..aa65b3e6d9d6 100644
--- a/svx/uiconfig/ui/optgridpage.ui
+++ b/svx/uiconfig/ui/optgridpage.ui
@@ -57,7 +57,7 @@
         <property name="label-xalign">0</property>
         <property name="shadow-type">none</property>
         <child>
-          <!-- n-columns=1 n-rows=2 -->
+          <!-- n-columns=2 n-rows=2 -->
           <object class="GtkGrid" id="grid1">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
@@ -80,7 +80,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">0</property>
               </packing>
             </child>
@@ -98,6 +98,32 @@
                   </object>
                 </child>
               </object>
+              <packing>
+                <property name="left-attach">1</property>
+                <property name="top-attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="lockusegridsnap">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="lockgridvisible">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
               <packing>
                 <property name="left-attach">0</property>
                 <property name="top-attach">1</property>
@@ -135,7 +161,7 @@
             <property name="label-xalign">0</property>
             <property name="shadow-type">none</property>
             <child>
-              <!-- n-columns=2 n-rows=3 -->
+              <!-- n-columns=3 n-rows=3 -->
               <object class="GtkGrid" id="grid3">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
@@ -159,7 +185,7 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left-attach">1</property>
+                    <property name="left-attach">2</property>
                     <property name="top-attach">0</property>
                   </packing>
                 </child>
@@ -178,7 +204,7 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left-attach">1</property>
+                    <property name="left-attach">2</property>
                     <property name="top-attach">1</property>
                   </packing>
                 </child>
@@ -192,7 +218,7 @@
                     <property name="xalign">0</property>
                   </object>
                   <packing>
-                    <property name="left-attach">0</property>
+                    <property name="left-attach">1</property>
                     <property name="top-attach">0</property>
                   </packing>
                 </child>
@@ -206,7 +232,7 @@
                     <property name="xalign">0</property>
                   </object>
                   <packing>
-                    <property name="left-attach">0</property>
+                    <property name="left-attach">1</property>
                     <property name="top-attach">1</property>
                   </packing>
                 </child>
@@ -226,11 +252,50 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left-attach">0</property>
+                    <property name="left-attach">1</property>
                     <property name="top-attach">2</property>
                     <property name="width">2</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkImage" id="lockmtrflddrawx">
+                    <property name="can-focus">False</property>
+                    <property name="no-show-all">True</property>
+                    <property name="halign">center</property>
+                    <property name="valign">center</property>
+                    <property name="icon-name">res/lock.png</property>
+                  </object>
+                  <packing>
+                    <property name="left-attach">0</property>
+                    <property name="top-attach">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkImage" id="lockmtrflddrawy">
+                    <property name="can-focus">False</property>
+                    <property name="no-show-all">True</property>
+                    <property name="halign">center</property>
+                    <property name="valign">center</property>
+                    <property name="icon-name">res/lock.png</property>
+                  </object>
+                  <packing>
+                    <property name="left-attach">0</property>
+                    <property name="top-attach">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkImage" id="locksynchronize">
+                    <property name="can-focus">False</property>
+                    <property name="no-show-all">True</property>
+                    <property name="halign">center</property>
+                    <property name="valign">center</property>
+                    <property name="icon-name">res/lock.png</property>
+                  </object>
+                  <packing>
+                    <property name="left-attach">0</property>
+                    <property name="top-attach">2</property>
+                  </packing>
+                </child>
               </object>
             </child>
             <child type="label">
@@ -258,7 +323,7 @@
             <property name="label-xalign">0</property>
             <property name="shadow-type">none</property>
             <child>
-              <!-- n-columns=2 n-rows=2 -->
+              <!-- n-columns=3 n-rows=2 -->
               <object class="GtkGrid" id="grid4">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
@@ -305,7 +370,7 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left-attach">1</property>
+                    <property name="left-attach">2</property>
                     <property name="top-attach">0</property>
                   </packing>
                 </child>
@@ -347,7 +412,7 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left-attach">1</property>
+                    <property name="left-attach">2</property>
                     <property name="top-attach">1</property>
                   </packing>
                 </child>
@@ -361,7 +426,7 @@
                     <property name="xalign">0</property>
                   </object>
                   <packing>
-                    <property name="left-attach">0</property>
+                    <property name="left-attach">1</property>
                     <property name="top-attach">0</property>
                   </packing>
                 </child>
@@ -374,6 +439,32 @@
                     <property name="mnemonic-widget">numflddivisiony</property>
                     <property name="xalign">0</property>
                   </object>
+                  <packing>
+                    <property name="left-attach">1</property>
+                    <property name="top-attach">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkImage" id="locknumflddivisionx">
+                    <property name="can-focus">False</property>
+                    <property name="no-show-all">True</property>
+                    <property name="halign">center</property>
+                    <property name="valign">center</property>
+                    <property name="icon-name">res/lock.png</property>
+                  </object>
+                  <packing>
+                    <property name="left-attach">0</property>
+                    <property name="top-attach">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkImage" id="locknumflddivisiony">
+                    <property name="can-focus">False</property>
+                    <property name="no-show-all">True</property>
+                    <property name="halign">center</property>
+                    <property name="valign">center</property>
+                    <property name="icon-name">res/lock.png</property>
+                  </object>
                   <packing>
                     <property name="left-attach">0</property>
                     <property name="top-attach">1</property>

Reply via email to