sw/source/ui/config/optpage.cxx | 57 +++++ sw/source/uibase/inc/optpage.hxx | 13 + sw/uiconfig/swriter/ui/optformataidspage.ui | 267 +++++++++++++++++++++++++--- 3 files changed, 316 insertions(+), 21 deletions(-)
New commits: commit a598de5b6ed6f161844e01f7be7164a65927caee Author: Balazs Varga <balazs.varga.ext...@allotropia.de> AuthorDate: Fri Nov 10 15:57:57 2023 +0100 Commit: Balazs Varga <balazs.varga.ext...@allotropia.de> CommitDate: Mon Nov 13 09:20:27 2023 +0100 tdf#158009 - UI: Part 24 - Unify lockdown behavior of Options dialog for Writer - Format Aids Page. Change-Id: Ia51094f86c47d154ec6e8b4d961a9db6a5005a03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159305 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de> diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 6fb499f455ad..5628f2b1570a 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1379,23 +1379,36 @@ SwShdwCursorOptionsTabPage::SwShdwCursorOptionsTabPage(weld::Container* pPage, w : SfxTabPage(pPage, pController, "modules/swriter/ui/optformataidspage.ui", "OptFormatAidsPage", &rSet) , m_pWrtShell(nullptr) , m_xParaCB(m_xBuilder->weld_check_button("paragraph")) + , m_xParaImg(m_xBuilder->weld_widget("lockparagraph")) , m_xSHyphCB(m_xBuilder->weld_check_button("hyphens")) + , m_xSHyphImg(m_xBuilder->weld_widget("lockhyphens")) , m_xSpacesCB(m_xBuilder->weld_check_button("spaces")) + , m_xSpacesImg(m_xBuilder->weld_widget("lockspaces")) , m_xHSpacesCB(m_xBuilder->weld_check_button("nonbreak")) + , m_xHSpacesImg(m_xBuilder->weld_widget("locknonbreak")) , m_xTabCB(m_xBuilder->weld_check_button("tabs")) + , m_xTabImg(m_xBuilder->weld_widget("locktabs")) , m_xTabLabel(m_xBuilder->weld_label("tabs_label")) , m_xBreakCB(m_xBuilder->weld_check_button("break")) + , m_xBreakImg(m_xBuilder->weld_widget("lockbreak")) , m_xCharHiddenCB(m_xBuilder->weld_check_button("hiddentext")) + , m_xCharHiddenImg(m_xBuilder->weld_widget("lockhiddentext")) , m_xBookmarkCB(m_xBuilder->weld_check_button("bookmarks")) + , m_xBookmarkImg(m_xBuilder->weld_widget("lockbookmarks")) , m_xBookmarkLabel(m_xBuilder->weld_label("bookmarks_label")) , m_xDirectCursorFrame(m_xBuilder->weld_frame("directcrsrframe")) , m_xOnOffCB(m_xBuilder->weld_check_button("cursoronoff")) + , m_xOnOffImg(m_xBuilder->weld_widget("lockcursoronoff")) , m_xDirectCursorFillMode(m_xBuilder->weld_combo_box("cxDirectCursorFillMode")) + , m_xDirectCursorFillModeImg(m_xBuilder->weld_widget("lockfillmode")) , m_xCursorProtFrame(m_xBuilder->weld_frame("crsrprotframe")) , m_xImageFrame(m_xBuilder->weld_frame("frmImage")) , m_xCursorInProtCB(m_xBuilder->weld_check_button("cursorinprot")) + , m_xCursorInProtImg(m_xBuilder->weld_widget("lockcursorinprot")) , m_xDefaultAnchorType(m_xBuilder->weld_combo_box("cxDefaultAnchor")) + , m_xDefaultAnchorTypeImg(m_xBuilder->weld_widget("lockAnchor")) , m_xMathBaselineAlignmentCB(m_xBuilder->weld_check_button("mathbaseline")) + , m_xMathBaselineAlignmentImg(m_xBuilder->weld_widget("lockmathbaseline")) { SwFillMode eMode = SwFillMode::Tab; bool bIsOn = false; @@ -1527,10 +1540,17 @@ void SwShdwCursorOptionsTabPage::Reset( const SfxItemSet* rSet ) bIsOn = pItem->IsOn(); } m_xOnOffCB->set_active( bIsOn ); + m_xOnOffCB->set_sensitive(!officecfg::Office::Writer::Cursor::DirectCursor::UseDirectCursor::isReadOnly()); + m_xOnOffImg->set_visible(officecfg::Office::Writer::Cursor::DirectCursor::UseDirectCursor::isReadOnly()); m_xDirectCursorFillMode->set_active( static_cast<int>(eMode) ); + m_xDirectCursorFillMode->set_sensitive(!officecfg::Office::Writer::Cursor::DirectCursor::Insert::isReadOnly()); + m_xDirectCursorFillModeImg->set_visible(officecfg::Office::Writer::Cursor::DirectCursor::Insert::isReadOnly()); + if (m_pWrtShell) { m_xMathBaselineAlignmentCB->set_active( m_pWrtShell->GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT ) ); + m_xMathBaselineAlignmentCB->set_sensitive(!officecfg::Office::Writer::Layout::Other::IsAlignMathObjectsToBaseline::isReadOnly()); + m_xMathBaselineAlignmentImg->set_visible(officecfg::Office::Writer::Layout::Other::IsAlignMathObjectsToBaseline::isReadOnly()); m_xMathBaselineAlignmentCB->save_state(); } else { m_xMathBaselineAlignmentCB->hide(); @@ -1538,20 +1558,57 @@ void SwShdwCursorOptionsTabPage::Reset( const SfxItemSet* rSet ) if( const SfxBoolItem* pItem = rSet->GetItemIfSet( FN_PARAM_CRSR_IN_PROTECTED, false ) ) m_xCursorInProtCB->set_active(pItem->GetValue()); + m_xCursorInProtCB->set_sensitive(!officecfg::Office::Writer::Cursor::Option::ProtectedArea::isReadOnly()); + m_xCursorInProtImg->set_visible(officecfg::Office::Writer::Cursor::Option::ProtectedArea::isReadOnly()); m_xCursorInProtCB->save_state(); const SwDocDisplayItem* pDocDisplayAttr = rSet->GetItemIfSet( FN_PARAM_DOCDISP, false ); if(pDocDisplayAttr) { + bool bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::ParagraphEnd::isReadOnly(); m_xParaCB->set_active( pDocDisplayAttr->m_bParagraphEnd ); + m_xParaCB->set_sensitive(!bReadOnly); + m_xParaImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::Tab::isReadOnly(); m_xTabCB->set_active( pDocDisplayAttr->m_bTab ); + m_xTabCB->set_sensitive(!bReadOnly); + m_xTabImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::Space::isReadOnly(); m_xSpacesCB->set_active( pDocDisplayAttr->m_bSpace ); + m_xSpacesCB->set_sensitive(!bReadOnly); + m_xSpacesImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::ProtectedSpace::isReadOnly(); m_xHSpacesCB->set_active( pDocDisplayAttr->m_bNonbreakingSpace ); + m_xHSpacesCB->set_sensitive(!bReadOnly); + m_xHSpacesImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::OptionalHyphen::isReadOnly(); m_xSHyphCB->set_active( pDocDisplayAttr->m_bSoftHyphen ); + m_xSHyphCB->set_sensitive(!bReadOnly); + m_xSHyphImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::HiddenCharacter::isReadOnly(); m_xCharHiddenCB->set_active( pDocDisplayAttr->m_bCharHiddenText ); + m_xCharHiddenCB->set_sensitive(!bReadOnly); + m_xCharHiddenImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::Bookmarks::isReadOnly(); m_xBookmarkCB->set_active(pDocDisplayAttr->m_bBookmarks); + m_xBookmarkCB->set_sensitive(!bReadOnly); + m_xBookmarkImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::Break::isReadOnly(); m_xBreakCB->set_active( pDocDisplayAttr->m_bManualBreak ); + m_xBreakCB->set_sensitive(!bReadOnly); + m_xBreakImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Writer::Content::Display::DefaultAnchor::isReadOnly(); m_xDefaultAnchorType->set_active( pDocDisplayAttr->m_xDefaultAnchor ); + m_xDefaultAnchorType->set_sensitive(!bReadOnly); + m_xDefaultAnchorTypeImg->set_visible(bReadOnly); } } diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx index a49c22f23232..89a4c150f2e8 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -246,27 +246,40 @@ class SwShdwCursorOptionsTabPage final : public SfxTabPage //nonprinting characters std::unique_ptr<weld::CheckButton> m_xParaCB; + std::unique_ptr<weld::Widget> m_xParaImg; std::unique_ptr<weld::CheckButton> m_xSHyphCB; + std::unique_ptr<weld::Widget> m_xSHyphImg; std::unique_ptr<weld::CheckButton> m_xSpacesCB; + std::unique_ptr<weld::Widget> m_xSpacesImg; std::unique_ptr<weld::CheckButton> m_xHSpacesCB; + std::unique_ptr<weld::Widget> m_xHSpacesImg; std::unique_ptr<weld::CheckButton> m_xTabCB; + std::unique_ptr<weld::Widget> m_xTabImg; std::unique_ptr<weld::Label> m_xTabLabel; std::unique_ptr<weld::CheckButton> m_xBreakCB; + std::unique_ptr<weld::Widget> m_xBreakImg; std::unique_ptr<weld::CheckButton> m_xCharHiddenCB; + std::unique_ptr<weld::Widget> m_xCharHiddenImg; std::unique_ptr<weld::CheckButton> m_xBookmarkCB; + std::unique_ptr<weld::Widget> m_xBookmarkImg; std::unique_ptr<weld::Label> m_xBookmarkLabel; std::unique_ptr<weld::Frame> m_xDirectCursorFrame; std::unique_ptr<weld::CheckButton> m_xOnOffCB; + std::unique_ptr<weld::Widget> m_xOnOffImg; std::unique_ptr<weld::ComboBox> m_xDirectCursorFillMode; + std::unique_ptr<weld::Widget> m_xDirectCursorFillModeImg; std::unique_ptr<weld::Frame> m_xCursorProtFrame; std::unique_ptr<weld::Frame> m_xImageFrame; std::unique_ptr<weld::CheckButton> m_xCursorInProtCB; + std::unique_ptr<weld::Widget> m_xCursorInProtImg; std::unique_ptr<weld::ComboBox> m_xDefaultAnchorType; + std::unique_ptr<weld::Widget> m_xDefaultAnchorTypeImg; std::unique_ptr<weld::CheckButton> m_xMathBaselineAlignmentCB; + std::unique_ptr<weld::Widget> m_xMathBaselineAlignmentImg; public: SwShdwCursorOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); diff --git a/sw/uiconfig/swriter/ui/optformataidspage.ui b/sw/uiconfig/swriter/ui/optformataidspage.ui index 62074f3160d9..4825b51a356e 100644 --- a/sw/uiconfig/swriter/ui/optformataidspage.ui +++ b/sw/uiconfig/swriter/ui/optformataidspage.ui @@ -21,7 +21,7 @@ <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=2 n-rows=8 --> + <!-- n-columns=3 n-rows=8 --> <object class="GtkGrid" id="grid2"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -44,7 +44,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">0</property> </packing> </child> @@ -63,7 +63,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">1</property> </packing> </child> @@ -82,7 +82,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">2</property> </packing> </child> @@ -101,7 +101,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">3</property> </packing> </child> @@ -120,7 +120,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">4</property> </packing> </child> @@ -139,7 +139,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">5</property> </packing> </child> @@ -158,7 +158,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">6</property> </packing> </child> @@ -170,9 +170,14 @@ <property name="receives-default">False</property> <property name="use-underline">True</property> <property name="draw-indicator">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="bookmarks-atkobject"> + <property name="AtkObject::accessible-description">Specifies whether bookmark positions are displayed on the screen.</property> + </object> + </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">7</property> </packing> </child> @@ -183,7 +188,7 @@ <property name="label">¶</property> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">0</property> </packing> </child> @@ -194,7 +199,7 @@ <property name="label">-</property> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">1</property> </packing> </child> @@ -205,7 +210,7 @@ <property name="label">·</property> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">2</property> </packing> </child> @@ -216,7 +221,7 @@ <property name="label">→</property> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">4</property> </packing> </child> @@ -227,7 +232,7 @@ <property name="label">↵</property> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">5</property> </packing> </child> @@ -240,7 +245,151 @@ <property name="label">⌶ […]</property> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> + <property name="top-attach">7</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockparagraph"> + <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> + <child internal-child="accessible"> + <object class="AtkObject" id="lockparagraph-atkobject"> + <property name="AtkObject::accessible-description">Specifies whether paragraph delimiter option is readonly.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockhyphens"> + <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> + <child internal-child="accessible"> + <object class="AtkObject" id="lockhyphens-atkobject"> + <property name="AtkObject::accessible-description">Specifies whether soft hyphens (called also as optional or discretionary hyphens) option is readonly.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockspaces"> + <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> + <child internal-child="accessible"> + <object class="AtkObject" id="lockspaces-atkobject"> + <property name="AtkObject::accessible-description">Specifies whether to represent every space in the text option is readonly.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">2</property> + </packing> + </child> + <child> + <object class="GtkImage" id="locknonbreak"> + <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> + <child internal-child="accessible"> + <object class="AtkObject" id="locknonbreak-atkobject"> + <property name="AtkObject::accessible-description">Specifies that non-breaking spaces option is readonly.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">3</property> + </packing> + </child> + <child> + <object class="GtkImage" id="locktabs"> + <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> + <child internal-child="accessible"> + <object class="AtkObject" id="locktabs-atkobject"> + <property name="AtkObject::accessible-description">Specifies that tab stops option is readonly.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">4</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockbreak"> + <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> + <child internal-child="accessible"> + <object class="AtkObject" id="lockbreak-atkobject"> + <property name="AtkObject::accessible-description">Specifies that all line breaks inserted with the Shift+Enter shortcut option is readonly.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">5</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockhiddentext"> + <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> + <child internal-child="accessible"> + <object class="AtkObject" id="lockhiddentext-atkobject"> + <property name="AtkObject::accessible-description">Specifies that the hidden characters option is readonly.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">6</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockbookmarks"> + <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> + <child internal-child="accessible"> + <object class="AtkObject" id="lockbookmarks-atkobject"> + <property name="AtkObject::accessible-description">Specifies whether bookmark positions are displayed on the screen option is readonly.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> <property name="top-attach">7</property> </packing> </child> @@ -275,7 +424,7 @@ <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=2 n-rows=1 --> <object class="GtkGrid" id="grid5"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -291,6 +440,19 @@ <property name="use-underline">True</property> <property name="draw-indicator">True</property> </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockmathbaseline"> + <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> @@ -322,7 +484,7 @@ <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=2 n-rows=1 --> <object class="GtkGrid" id="grid6"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -343,6 +505,24 @@ </object> </child> </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockcursorinprot"> + <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> + <child internal-child="accessible"> + <object class="AtkObject" id="lockcursorinprot-atkobject"> + <property name="AtkObject::accessible-description">Specifies that you can set the cursor in a protected area option is readonly.</property> + </object> + </child> + </object> <packing> <property name="left-attach">0</property> <property name="top-attach">0</property> @@ -378,7 +558,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="grid3"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -400,7 +580,7 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">0</property> </packing> </child> @@ -444,6 +624,37 @@ </packing> </child> </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockcursoronoff"> + <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> + <child internal-child="accessible"> + <object class="AtkObject" id="lockcursoronoff-atkobject"> + <property name="AtkObject::accessible-description">Specifies that the direct cursor option is readonly.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockfillmode"> + <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> @@ -482,6 +693,20 @@ <property name="margin-start">12</property> <property name="margin-top">6</property> <property name="spacing">6</property> + <child> + <object class="GtkImage" id="lockAnchor"> + <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="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> <child> <object class="GtkLabel" id="lbDefaultAnchor"> <property name="visible">True</property> @@ -494,7 +719,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">0</property> + <property name="position">1</property> </packing> </child> <child> @@ -511,7 +736,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> </object>