From 15b9c2f0d1c99b19b04b232980b587dfedd75c5f Mon Sep 17 00:00:00 2001 From: nikita_bartoshuk Date: Mon, 26 Jan 2026 15:07:16 +0300 Subject: [PATCH] added zoom to 100% btn --- .../main/app/controller/ViewTab.js | 5 +++++ apps/documenteditor/main/app/view/ViewTab.js | 21 ++++++++++++++++++- apps/documenteditor/main/locale/en.json | 2 ++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/controller/ViewTab.js b/apps/documenteditor/main/app/controller/ViewTab.js index fd99cc1f4d..5a2da79010 100644 --- a/apps/documenteditor/main/app/controller/ViewTab.js +++ b/apps/documenteditor/main/app/controller/ViewTab.js @@ -89,6 +89,7 @@ define([ 'ViewTab': { 'zoom:topage': _.bind(this.onBtnZoomTo, this, 'topage'), 'zoom:towidth': _.bind(this.onBtnZoomTo, this, 'towidth'), + 'zoom:100': _.bind(this.onZoomTo100, this), 'rulers:change': _.bind(this.onChangeRulers, this), 'darkmode:change': _.bind(this.onChangeDarkMode, this), 'macros:click': _.bind(this.onClickMacros, this), @@ -360,6 +361,10 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.view); }, + onZoomTo100: function () { + this.api && this.api.zoom(100); + }, + onChangeRulers: function (btn, checked) { Common.localStorage.setBool('de-hidden-rulers', !checked); Common.Utils.InternalSettings.set("de-hidden-rulers", !checked); diff --git a/apps/documenteditor/main/app/view/ViewTab.js b/apps/documenteditor/main/app/view/ViewTab.js index c34487d9eb..0267ef73e8 100644 --- a/apps/documenteditor/main/app/view/ViewTab.js +++ b/apps/documenteditor/main/app/view/ViewTab.js @@ -63,6 +63,9 @@ define([ '' + '' + '' + + '
' + + '' + + '
' + '
' + '
' + '' + @@ -156,6 +159,9 @@ define([ me.btnMultiplePages.on('click', _.bind(function (e) { me.fireEvent('pages:multiple', [e.pressed]); }, me)); + me.btnZoom100.on('click', _.bind(function (e) { + me.fireEvent('zoom:100'); + }, me)); me.cmbsZoom.forEach(function (cmb) { cmb.on('combo:focusin', _.bind(me.onComboOpen, this, false)); cmb.on('show:after', _.bind(me.onComboOpen, this, true)); @@ -311,6 +317,17 @@ define([ }); this.lockedControls.push(this.btnMultiplePages); + this.btnZoom100 = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-zoom-100', + lock: [_set.lostConnect, _set.disableOnStart], + caption: this.textZoom100, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small', + }); + this.lockedControls.push(this.btnZoom100); + if ( this.appConfig.isEdit && !(this.appConfig.customization && this.appConfig.customization.macros===false) && @@ -427,6 +444,7 @@ define([ this.btnInterfaceTheme.render($host.find('#slot-btn-interface-theme')); this.btnDarkDocument.render($host.find('#slot-btn-dark-document')); this.btnMultiplePages.render($host.find('#slot-btn-multiple-pages')); + this.btnZoom100.render($host.find('#slot-btn-zoom-100')); this.chStatusbar.render($host.find('#slot-chk-statusbar')); this.chToolbar.render($host.find('#slot-chk-toolbar')); this.chRulers.render($host.find('#slot-chk-rulers')); @@ -461,7 +479,8 @@ define([ this.btnNavigation.updateHint(this.tipHeadings); this.btnInterfaceTheme.updateHint(this.tipInterfaceTheme); this.btnDarkDocument.updateHint(this.tipDarkDocument); - this.btnMultiplePages.updateHint(this.tipMultiplePages) + this.btnMultiplePages.updateHint(this.tipMultiplePages); + this.btnZoom100.updateHint(this.tipZoom100); this.btnsFitToPage.forEach(function (btn) { btn.updateHint(me.tipFitToPage); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 731f038745..668c920587 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -4294,6 +4294,7 @@ "DE.Views.ViewTab.textTabStyle": "Tab style", "DE.Views.ViewTab.textZoom": "Zoom", "DE.Views.ViewTab.textMultiplePages": "Multiple Pages", + "DE.Views.ViewTab.textZoom100": "Zoom to 100%", "DE.Views.ViewTab.tipDarkDocument": "Dark document", "DE.Views.ViewTab.tipFitToPage": "Fit to page", "DE.Views.ViewTab.tipFitToWidth": "Fit to width", @@ -4305,6 +4306,7 @@ "DE.Views.ViewTab.tipResumeMacro": "Resume recording", "DE.Views.ViewTab.tipStopMacro": "Stop recording", "DE.Views.ViewTab.tipMultiplePages": "Multiple pages", + "DE.Views.ViewTab.tipZoom100": "Zoom to 100%", "DE.Views.WatermarkSettingsDialog.textAuto": "Auto", "DE.Views.WatermarkSettingsDialog.textBold": "Bold", "DE.Views.WatermarkSettingsDialog.textColor": "Text color",