From b1a866caccb322ec6e88eac67710310160e72b58 Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Thu, 23 Nov 2023 11:39:09 +0100 Subject: tdf#158238 - UI: Part 40 - Unify lockdown behavior of Options dialog for Impress - View Page. Change-Id: Icc3c4fc9dd3800ef454cbddb06e569e03c08967a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159856 Tested-by: Jenkins Reviewed-by: Balazs Varga --- sd/source/ui/dlg/tpoption.cxx | 20 +++++++++ sd/source/ui/inc/tpoption.hxx | 4 ++ sd/uiconfig/simpress/ui/sdviewpage.ui | 78 ++++++++++++++++++++++++++++------- 3 files changed, 87 insertions(+), 15 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index b177c8e94064..fabf76255bd7 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -110,9 +110,13 @@ std::unique_ptr SdTpOptionsSnap::Create( weld::Container* pPage, wel SdTpOptionsContents::SdTpOptionsContents(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs) : SfxTabPage(pPage, pController, "modules/simpress/ui/sdviewpage.ui", "SdViewPage", &rInAttrs) , m_xCbxRuler(m_xBuilder->weld_check_button("ruler")) + , m_xCbxRulerImg(m_xBuilder->weld_widget("lockruler")) , m_xCbxDragStripes(m_xBuilder->weld_check_button("dragstripes")) + , m_xCbxDragStripesImg(m_xBuilder->weld_widget("lockdragstripes")) , m_xCbxHandlesBezier(m_xBuilder->weld_check_button("handlesbezier")) + , m_xCbxHandlesBezierImg(m_xBuilder->weld_widget("lockhandlesbezier")) , m_xCbxMoveOutline(m_xBuilder->weld_check_button("moveoutline")) + , m_xCbxMoveOutlineImg(m_xBuilder->weld_widget("lockmoveoutline")) { } @@ -173,6 +177,22 @@ void SdTpOptionsContents::Reset( const SfxItemSet* rAttrs ) m_xCbxDragStripes->set_active( aLayoutItem.GetOptionsLayout().IsDragStripes() ); m_xCbxHandlesBezier->set_active( aLayoutItem.GetOptionsLayout().IsHandlesBezier() ); + bool bReadOnly = officecfg::Office::Impress::Layout::Display::Ruler::isReadOnly(); + m_xCbxRuler->set_sensitive(!bReadOnly); + m_xCbxRulerImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Impress::Layout::Display::Contour::isReadOnly(); + m_xCbxMoveOutline->set_sensitive(!bReadOnly); + m_xCbxMoveOutlineImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Impress::Layout::Display::Guide::isReadOnly(); + m_xCbxDragStripes->set_sensitive(!bReadOnly); + m_xCbxDragStripesImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Impress::Layout::Display::Bezier::isReadOnly(); + m_xCbxHandlesBezier->set_sensitive(!bReadOnly); + m_xCbxHandlesBezierImg->set_visible(bReadOnly); + m_xCbxRuler->save_state(); m_xCbxMoveOutline->save_state(); m_xCbxDragStripes->save_state(); diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx index 4184cd7400d5..79735e6a3f81 100644 --- a/sd/source/ui/inc/tpoption.hxx +++ b/sd/source/ui/inc/tpoption.hxx @@ -43,9 +43,13 @@ class SdTpOptionsContents final : public SfxTabPage { private: std::unique_ptr m_xCbxRuler; + std::unique_ptr m_xCbxRulerImg; std::unique_ptr m_xCbxDragStripes; + std::unique_ptr m_xCbxDragStripesImg; std::unique_ptr m_xCbxHandlesBezier; + std::unique_ptr m_xCbxHandlesBezierImg; std::unique_ptr m_xCbxMoveOutline; + std::unique_ptr m_xCbxMoveOutlineImg; public: SdTpOptionsContents(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); diff --git a/sd/uiconfig/simpress/ui/sdviewpage.ui b/sd/uiconfig/simpress/ui/sdviewpage.ui index 52193b075c1e..608114e88fa9 100644 --- a/sd/uiconfig/simpress/ui/sdviewpage.ui +++ b/sd/uiconfig/simpress/ui/sdviewpage.ui @@ -10,13 +10,13 @@ 0 none - + + True False 12 6 - vertical - 6 + 6 _Rulers visible @@ -32,9 +32,8 @@ - False - True - 0 + 1 + 0 @@ -52,9 +51,8 @@ - False - True - 1 + 1 + 1 @@ -72,9 +70,8 @@ - False - True - 2 + 1 + 2 @@ -92,9 +89,60 @@ - False - True - 3 + 1 + 3 + + + + + False + True + center + center + res/lock.png + + + 0 + 0 + + + + + False + True + center + center + res/lock.png + + + 0 + 1 + + + + + False + True + center + center + res/lock.png + + + 0 + 2 + + + + + False + True + center + center + res/lock.png + + + 0 + 3 -- cgit