From 278c5d22928a05cbfe887e38bc93a5051d0f59d4 Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Wed, 22 Nov 2023 14:21:00 +0100 Subject: tdf#158147 - UI: Part 38 - Unify lockdown behavior of Options dialog for Math - Settings Page. Change-Id: I05170a6c7edb6160e0e7804fa04325d329499854 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159819 Tested-by: Jenkins Reviewed-by: Balazs Varga --- starmath/inc/dialog.hxx | 9 + starmath/source/dialog.cxx | 53 +++- starmath/uiconfig/smath/ui/smathsettings.ui | 455 ++++++++++++++++++++-------- 3 files changed, 393 insertions(+), 124 deletions(-) (limited to 'starmath') diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 66db01d295f4..3b4f80b8e61c 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -40,17 +40,26 @@ void SetFontStyle(std::u16string_view rStyleName, vcl::Font &rFont); class SmPrintOptionsTabPage final : public SfxTabPage { std::unique_ptr m_xTitle; + std::unique_ptr m_xTitleImg; std::unique_ptr m_xText; + std::unique_ptr m_xTextImg; std::unique_ptr m_xFrame; + std::unique_ptr m_xFrameImg; std::unique_ptr m_xSizeNormal; std::unique_ptr m_xSizeScaled; std::unique_ptr m_xSizeZoomed; + std::unique_ptr m_xLockPrintImg; std::unique_ptr m_xZoom; std::unique_ptr m_xEnableInlineEdit; + std::unique_ptr m_xEnableInlineEditImg; std::unique_ptr m_xNoRightSpaces; + std::unique_ptr m_xNoRightSpacesImg; std::unique_ptr m_xSaveOnlyUsedSymbols; + std::unique_ptr m_xSaveOnlyUsedSymbolsImg; std::unique_ptr m_xAutoCloseBrackets; + std::unique_ptr m_xAutoCloseBracketsImg; std::unique_ptr m_xSmZoom; + std::unique_ptr m_xSmZoomImg; DECL_LINK(SizeButtonClickHdl, weld::Toggleable&, void); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index f96f43cfebba..1ad8376e5a7f 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -179,17 +180,26 @@ IMPL_LINK_NOARG(SmPrintOptionsTabPage, SizeButtonClickHdl, weld::Toggleable&, vo SmPrintOptionsTabPage::SmPrintOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rOptions) : SfxTabPage(pPage, pController, "modules/smath/ui/smathsettings.ui", "SmathSettings", &rOptions) , m_xTitle(m_xBuilder->weld_check_button("title")) + , m_xTitleImg(m_xBuilder->weld_widget("locktitle")) , m_xText(m_xBuilder->weld_check_button("text")) + , m_xTextImg(m_xBuilder->weld_widget("locktext")) , m_xFrame(m_xBuilder->weld_check_button("frame")) + , m_xFrameImg(m_xBuilder->weld_widget("lockframe")) , m_xSizeNormal(m_xBuilder->weld_radio_button("sizenormal")) , m_xSizeScaled(m_xBuilder->weld_radio_button("sizescaled")) , m_xSizeZoomed(m_xBuilder->weld_radio_button("sizezoomed")) + , m_xLockPrintImg(m_xBuilder->weld_widget("lockprintformat")) , m_xZoom(m_xBuilder->weld_metric_spin_button("zoom", FieldUnit::PERCENT)) , m_xEnableInlineEdit(m_xBuilder->weld_check_button("enableinlineedit")) + , m_xEnableInlineEditImg(m_xBuilder->weld_widget("lockenableinlineedit")) , m_xNoRightSpaces(m_xBuilder->weld_check_button("norightspaces")) + , m_xNoRightSpacesImg(m_xBuilder->weld_widget("locknorightspaces")) , m_xSaveOnlyUsedSymbols(m_xBuilder->weld_check_button("saveonlyusedsymbols")) + , m_xSaveOnlyUsedSymbolsImg(m_xBuilder->weld_widget("locksaveonlyusedsymbols")) , m_xAutoCloseBrackets(m_xBuilder->weld_check_button("autoclosebrackets")) + , m_xAutoCloseBracketsImg(m_xBuilder->weld_widget("lockautoclosebrackets")) , m_xSmZoom(m_xBuilder->weld_metric_spin_button("smzoom", FieldUnit::PERCENT)) + , m_xSmZoomImg(m_xBuilder->weld_widget("locksmzoom")) { m_xSizeNormal->connect_toggled(LINK(this, SmPrintOptionsTabPage, SizeButtonClickHdl)); m_xSizeScaled->connect_toggled(LINK(this, SmPrintOptionsTabPage, SizeButtonClickHdl)); @@ -271,21 +281,58 @@ void SmPrintOptionsTabPage::Reset(const SfxItemSet* rSet) m_xSizeNormal->set_active(ePrintSize == PRINT_SIZE_NORMAL); m_xSizeScaled->set_active(ePrintSize == PRINT_SIZE_SCALED); m_xSizeZoomed->set_active(ePrintSize == PRINT_SIZE_ZOOMED); + bool bReadOnly = officecfg::Office::Math::Print::Size::isReadOnly(); + if (bReadOnly) + { + m_xSizeNormal->set_sensitive(false); + m_xSizeScaled->set_sensitive(false); + m_xSizeZoomed->set_sensitive(false); + m_xLockPrintImg->set_visible(true); + } - m_xZoom->set_sensitive(m_xSizeZoomed->get_active()); - + bReadOnly = officecfg::Office::Math::Print::ZoomFactor::isReadOnly(); m_xZoom->set_value(rSet->Get(SID_PRINTZOOM).GetValue(), FieldUnit::PERCENT); + m_xZoom->set_sensitive(m_xSizeZoomed->get_active() && !bReadOnly); - m_xSmZoom->set_sensitive(true); + bReadOnly = officecfg::Office::Math::Misc::SmEditWindowZoomFactor::isReadOnly(); m_xSmZoom->set_value(rSet->Get(SID_SMEDITWINDOWZOOM).GetValue(), FieldUnit::PERCENT); + m_xSmZoom->set_sensitive(!bReadOnly); + m_xSmZoomImg->set_visible(bReadOnly); + bReadOnly = officecfg::Office::Math::Print::Title::isReadOnly(); m_xTitle->set_active(rSet->Get(SID_PRINTTITLE).GetValue()); + m_xTitle->set_sensitive(!bReadOnly); + m_xTitleImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Math::Print::FormulaText::isReadOnly(); m_xText->set_active(rSet->Get(GetWhich(SID_PRINTTEXT)).GetValue()); + m_xText->set_sensitive(!bReadOnly); + m_xTextImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Math::Print::Frame::isReadOnly(); m_xFrame->set_active(rSet->Get(GetWhich(SID_PRINTFRAME)).GetValue()); + m_xFrame->set_sensitive(!bReadOnly); + m_xFrameImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Math::Misc::InlineEditEnable::isReadOnly(); m_xEnableInlineEdit->set_active(rSet->Get(SID_INLINE_EDIT_ENABLE).GetValue()); + m_xEnableInlineEdit->set_sensitive(!bReadOnly); + m_xEnableInlineEditImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Math::Misc::IgnoreSpacesRight::isReadOnly(); m_xNoRightSpaces->set_active(rSet->Get(SID_NO_RIGHT_SPACES).GetValue()); + m_xNoRightSpaces->set_sensitive(!bReadOnly); + m_xNoRightSpacesImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Math::LoadSave::IsSaveOnlyUsedSymbols::isReadOnly(); m_xSaveOnlyUsedSymbols->set_active(rSet->Get(SID_SAVE_ONLY_USED_SYMBOLS).GetValue()); + m_xSaveOnlyUsedSymbols->set_sensitive(!bReadOnly); + m_xSaveOnlyUsedSymbolsImg->set_visible(bReadOnly); + + bReadOnly = officecfg::Office::Math::Misc::AutoCloseBrackets::isReadOnly(); m_xAutoCloseBrackets->set_active(rSet->Get(SID_AUTO_CLOSE_BRACKETS).GetValue()); + m_xAutoCloseBrackets->set_sensitive(!bReadOnly); + m_xAutoCloseBracketsImg->set_visible(bReadOnly); } std::unique_ptr SmPrintOptionsTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet) diff --git a/starmath/uiconfig/smath/ui/smathsettings.ui b/starmath/uiconfig/smath/ui/smathsettings.ui index ae9adb655e93..823c949bc21a 100644 --- a/starmath/uiconfig/smath/ui/smathsettings.ui +++ b/starmath/uiconfig/smath/ui/smathsettings.ui @@ -37,17 +37,42 @@ vertical 6 - - _Title row + True - True - False - True - True - - - Specifies whether you want the name of the document to be included in the printout. + False + + + False + True + center + center + res/lock.png + + + False + True + 0 + + + + + _Title row + True + True + False + True + True + + + Specifies whether you want the name of the document to be included in the printout. + + + + False + True + 1 + @@ -57,17 +82,42 @@ - - _Formula text + True - True - False - True - True - - - Specifies whether to include the contents of the Commands window at the bottom of the printout. + False + + + False + True + center + center + res/lock.png + + + False + True + 0 + + + + + _Formula text + True + True + False + True + True + + + Specifies whether to include the contents of the Commands window at the bottom of the printout. + + + + False + True + 1 + @@ -77,17 +127,42 @@ - - B_order + True - True - False - True - True - - - Applies a thin border to the formula area in the printout. + False + + + False + True + center + center + res/lock.png + + False + True + 0 + + + + + B_order + True + True + False + True + True + + + Applies a thin border to the formula area in the printout. + + + + + False + True + 1 + @@ -122,70 +197,33 @@ 0 none - + + True False - 12 - 6 - vertical - 6 - True - - O_riginal size - True - True - False - True - True - True - - - Prints the formula without adjusting the current font size. - - - - - False - True - 0 - - - - - Fit to _page - True - True - False - True - True - sizenormal - - - Adjusts the formula to the page format used in the printout. - - - - - False - True - 1 - - - - + True False - 12 + 12 + 6 + vertical + 6 + True - - _Scaling: + + O_riginal size True True False True + True True - sizenormal + + + Prints the formula without adjusting the current font size. + + False @@ -194,15 +232,17 @@ - + + Fit to _page True True - True - True - adjustment1 + False + True + True + sizenormal - - Reduces or enlarges the size of the printed formula by a specified enlargement factor. + + Adjusts the formula to the page format used in the printout. @@ -212,11 +252,70 @@ 1 + + + True + False + 12 + + + _Scaling: + True + True + False + True + True + sizenormal + + + False + True + 0 + + + + + True + True + True + True + adjustment1 + + + Reduces or enlarges the size of the printed formula by a specified enlargement factor. + + + + + False + True + 1 + + + + + False + True + 2 + + - False - True - 2 + 1 + 0 + + + + + False + True + center + center + res/lock.png + + + 0 + 0 @@ -253,13 +352,38 @@ vertical 6 - - Enable visual editing + True - True - False - True - True + False + + + False + True + center + center + res/lock.png + + + False + True + 0 + + + + + Enable visual editing + True + True + False + True + True + + + False + True + 1 + + False @@ -268,17 +392,42 @@ - - Ig_nore ~~ and ' at the end of the line + True - True - False - True - True - - - Specifies that these space wildcards will be removed if they are at the end of a line. + False + + + False + True + center + center + res/lock.png + + False + True + 0 + + + + + Ig_nore ~~ and ' at the end of the line + True + True + False + True + True + + + Specifies that these space wildcards will be removed if they are at the end of a line. + + + + + False + True + 1 + @@ -288,17 +437,42 @@ - - Embed only used symbols (smaller file size) + True - True - False - True - True - - - Saves only those symbols with each formula that are used in that formula. + False + + + False + True + center + center + res/lock.png + + + False + True + 0 + + + + + Embed only used symbols (smaller file size) + True + True + False + True + True + + + Saves only those symbols with each formula that are used in that formula. + + + + False + True + 1 + @@ -308,13 +482,38 @@ - - Auto close brackets, parentheses and braces + True - True - False - True - True + False + + + False + True + center + center + res/lock.png + + + False + True + 0 + + + + + Auto close brackets, parentheses and braces + True + True + False + True + True + + + False + True + 1 + + False @@ -327,6 +526,20 @@ True False 6 + + + False + True + center + center + res/lock.png + + + False + True + 0 + + True @@ -338,7 +551,7 @@ False True - 0 + 1 @@ -359,7 +572,7 @@ False True - 1 + 2 -- cgit