diff options
author | dante <dante19031999@gmail.com> | 2021-05-14 13:46:41 +0200 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2021-05-28 10:57:26 +0200 |
commit | 1a0fd1c1342969e5b4d08d13764483cd8bada589 (patch) | |
tree | 36777e9554aa6f78b23aab859c7fe75a1d4e6e99 /starmath | |
parent | e2970060121824650f95421d8d2411840a40311f (diff) |
tdf#130654 editable smeditwindow zoom UI
Change-Id: Ibedf060ea838876e3598ff449e6f200119570cc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115605
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/dialog.hxx | 1 | ||||
-rw-r--r-- | starmath/inc/edit.hxx | 1 | ||||
-rw-r--r-- | starmath/source/dialog.cxx | 7 | ||||
-rw-r--r-- | starmath/source/edit.cxx | 10 | ||||
-rw-r--r-- | starmath/source/smmod.cxx | 3 | ||||
-rw-r--r-- | starmath/source/unomodel.cxx | 1 | ||||
-rw-r--r-- | starmath/uiconfig/smath/ui/smathsettings.ui | 53 |
7 files changed, 72 insertions, 4 deletions
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index ac1f65ac9913..016d13ea7e10 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -49,6 +49,7 @@ class SmPrintOptionsTabPage final : public SfxTabPage std::unique_ptr<weld::CheckButton> m_xNoRightSpaces; std::unique_ptr<weld::CheckButton> m_xSaveOnlyUsedSymbols; std::unique_ptr<weld::CheckButton> m_xAutoCloseBrackets; + std::unique_ptr<weld::MetricSpinButton> m_xSmZoom; DECL_LINK(SizeButtonClickHdl, weld::Toggleable&, void); diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx index 9a6ec77fdf95..a5dee85fdbd4 100644 --- a/starmath/inc/edit.hxx +++ b/starmath/inc/edit.hxx @@ -118,6 +118,7 @@ public: ESelection GetSelection() const; void SetSelection(const ESelection& rSel); + void UpdateStatus(bool bSetDocModified); bool IsEmpty() const; bool IsSelected() const; diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 802588f9c38c..ff1d001578de 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -170,6 +170,7 @@ SmPrintOptionsTabPage::SmPrintOptionsTabPage(weld::Container* pPage, weld::Dialo , m_xNoRightSpaces(m_xBuilder->weld_check_button("norightspaces")) , m_xSaveOnlyUsedSymbols(m_xBuilder->weld_check_button("saveonlyusedsymbols")) , m_xAutoCloseBrackets(m_xBuilder->weld_check_button("autoclosebrackets")) + , m_xSmZoom(m_xBuilder->weld_metric_spin_button("smzoom", FieldUnit::PERCENT)) { m_xSizeNormal->connect_toggled(LINK(this, SmPrintOptionsTabPage, SizeButtonClickHdl)); m_xSizeScaled->connect_toggled(LINK(this, SmPrintOptionsTabPage, SizeButtonClickHdl)); @@ -180,6 +181,7 @@ SmPrintOptionsTabPage::SmPrintOptionsTabPage(weld::Container* pPage, weld::Dialo SmPrintOptionsTabPage::~SmPrintOptionsTabPage() { + SmGetActiveView()->GetEditWindow()->UpdateStatus(false); } bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet) @@ -200,7 +202,9 @@ bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet) rSet->Put(SfxBoolItem(GetWhich(SID_NO_RIGHT_SPACES), m_xNoRightSpaces->get_active())); rSet->Put(SfxBoolItem(GetWhich(SID_SAVE_ONLY_USED_SYMBOLS), m_xSaveOnlyUsedSymbols->get_active())); rSet->Put(SfxBoolItem(GetWhich(SID_AUTO_CLOSE_BRACKETS), m_xAutoCloseBrackets->get_active())); + rSet->Put(SfxUInt16Item(GetWhich(SID_SMEDITWINDOWZOOM), sal::static_int_cast<sal_uInt16>(m_xSmZoom->get_value(FieldUnit::PERCENT)))); + SmGetActiveView()->GetEditWindow()->UpdateStatus(false); return true; } @@ -216,6 +220,9 @@ void SmPrintOptionsTabPage::Reset(const SfxItemSet* rSet) m_xZoom->set_value(static_cast<const SfxUInt16Item &>(rSet->Get(GetWhich(SID_PRINTZOOM))).GetValue(), FieldUnit::PERCENT); + m_xSmZoom->set_sensitive(true); + m_xSmZoom->set_value(static_cast<const SfxUInt16Item &>(rSet->Get(GetWhich(SID_SMEDITWINDOWZOOM))).GetValue(), FieldUnit::PERCENT); + m_xTitle->set_active(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_PRINTTITLE))).GetValue()); m_xNoRightSpaces->set_active(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_NO_RIGHT_SPACES))).GetValue()); m_xSaveOnlyUsedSymbols->set_active(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_SAVE_ONLY_USED_SYMBOLS))).GetValue()); diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index 373d3e8349d7..079be31c88ae 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -711,13 +711,17 @@ void SmEditTextWindow::UpdateStatus(bool bSetDocModified) SmModule *pMod = SM_MOD(); if (pMod && pMod->GetConfig()->IsAutoRedraw()) Flush(); - SmDocShell* pDoc = bSetDocModified ? mrEditWindow.GetDoc() : nullptr; - if (pDoc) - pDoc->SetModified(); + if (bSetDocModified) + mrEditWindow.GetDoc()->SetModified(); static_cast<SmEditEngine*>(GetEditEngine())->executeZoom(GetEditView()); } +void SmEditWindow::UpdateStatus(bool bSetDocModified) +{ + mxTextControl->UpdateStatus(bSetDocModified); +} + void SmEditWindow::Cut() { if (mxTextControl) diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx index 640eba718a34..e3b6c041903e 100644 --- a/starmath/source/smmod.cxx +++ b/starmath/source/smmod.cxx @@ -211,7 +211,8 @@ std::unique_ptr<SfxItemSet> SmModule::CreateItemSet( sal_uInt16 nId ) svl::Items< //TP_SMPRINT SID_PRINTTITLE, SID_PRINTZOOM, SID_NO_RIGHT_SPACES, SID_SAVE_ONLY_USED_SYMBOLS, - SID_AUTO_CLOSE_BRACKETS, SID_AUTO_CLOSE_BRACKETS>{}); + SID_AUTO_CLOSE_BRACKETS, SID_AUTO_CLOSE_BRACKETS, + SID_SMEDITWINDOWZOOM, SID_SMEDITWINDOWZOOM>{}); GetConfig()->ConfigToItemSet(*pRet); } diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 20bc4f35280f..5d4d73b879ad 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -613,6 +613,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any* SID_NO_RIGHT_SPACES, SID_NO_RIGHT_SPACES, SID_SAVE_ONLY_USED_SYMBOLS, SID_SAVE_ONLY_USED_SYMBOLS, SID_AUTO_CLOSE_BRACKETS, SID_AUTO_CLOSE_BRACKETS, + SID_SMEDITWINDOWZOOM, SID_SMEDITWINDOWZOOM, 0 }; auto pItemSet = std::make_unique<SfxItemSet>( SmDocShell::GetPool(), nRange ); diff --git a/starmath/uiconfig/smath/ui/smathsettings.ui b/starmath/uiconfig/smath/ui/smathsettings.ui index 8208296602a4..214c57a8d8ca 100644 --- a/starmath/uiconfig/smath/ui/smathsettings.ui +++ b/starmath/uiconfig/smath/ui/smathsettings.ui @@ -8,6 +8,12 @@ <property name="step_increment">1</property> <property name="page_increment">10</property> </object> + <object class="GtkAdjustment" id="adjustment2"> + <property name="lower">10</property> + <property name="upper">1000</property> + <property name="step-increment">10</property> + <property name="page-increment">10</property> + </object> <object class="GtkBox" id="SmathSettings"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -301,6 +307,53 @@ <property name="position">2</property> </packing> </child> + <child> + <object class="GtkBox" id="box5"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="mnemonic-widget">smzoom</property> + <property name="use-underline">True</property> + <property name="label" translatable="yes" context="smathsettings|smzoom">Scaling code input window:</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="smzoom"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="activates-default">True</property> + <property name="truncate-multiline">True</property> + <property name="adjustment">adjustment2</property> + <property name="value">100</property> + <property name="secondary-icon-tooltip-text" translatable="yes" context="extended_tip|smzoom">Reduces or enlarges the size of the formula code by a specified enlargement factor.</property> + <child internal-child="accessible"> + <object class="AtkObject" id="smzoom-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|smzoom">Reduces or enlarges the size of the formula code by a specified enlargement factor.</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> </object> </child> <child type="label"> |