From 2a9e6a2ba125ebd05e281fa6e40e1ec09e0d3e6b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 13 Jan 2025 22:14:16 +0300 Subject: [PATCH] [DE] Change icons/labels for rtl direction --- apps/common/main/lib/component/Label.js | 4 +++ .../main/app/controller/Toolbar.js | 27 +++++++++++++++---- apps/documenteditor/main/locale/en.json | 2 ++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/component/Label.js b/apps/common/main/lib/component/Label.js index 1a1d8597ae..be8322567a 100644 --- a/apps/common/main/lib/component/Label.js +++ b/apps/common/main/lib/component/Label.js @@ -148,6 +148,10 @@ define([ } } } + }, + + setCaption: function(text) { + this.$label.find('.caption').text(text); } }); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index c12b9ea704..bfcb59c7c1 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1765,12 +1765,29 @@ define([ }, onApiTextDirection: function (isRtl){ - if (this.toolbar.btnTextDir.options.dirRtl !== !!isRtl) { - this.toolbar.btnTextDir.changeIcon({ - next: isRtl ? 'btn-dir-rtl' : 'btn-dir-ltr', - curr: this.toolbar.btnTextDir.options.dirRtl ? 'btn-dir-rtl' : 'btn-dir-ltr' + var toolbar = this.toolbar, + oldRtl = toolbar.btnTextDir.options.dirRtl, + newRtl = !!isRtl; + if (oldRtl !== newRtl) { + toolbar.btnTextDir.changeIcon({ + next: newRtl ? 'btn-dir-rtl' : 'btn-dir-ltr', + curr: oldRtl ? 'btn-dir-rtl' : 'btn-dir-ltr' }); - this.toolbar.btnTextDir.options.dirRtl = !!isRtl; + toolbar.btnMarkers.changeIcon({ + next: newRtl ? 'btn-setmarkers-rtl' : 'btn-setmarkers', + curr: oldRtl ? 'btn-setmarkers-rtl' : 'btn-setmarkers' + }); + toolbar.btnNumbers.changeIcon({ + next: newRtl ? 'btn-numbering-rtl' : 'btn-numbering', + curr: oldRtl ? 'btn-numbering-rtl' : 'btn-numbering' + }); + toolbar.btnMultilevels.changeIcon({ + next: newRtl ? 'btn-multilevels-rtl' : 'btn-multilevels', + curr: oldRtl ? 'btn-multilevels-rtl' : 'btn-multilevels' + }); + toolbar.lblIndentsLeft.setCaption(newRtl ? toolbar.textIndBefore : toolbar.textIndLeft); + toolbar.lblIndentsRight.setCaption(newRtl ? toolbar.textIndAfter : toolbar.textIndRight); + toolbar.btnTextDir.options.dirRtl = !!isRtl; } }, diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 7f1aa74920..3fe7bdbf99 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -3654,6 +3654,8 @@ "DE.Views.Toolbar.textDirLtr": "Left-to-right", "DE.Views.Toolbar.textDirRtl": "Right-to-left", "DE.Views.Toolbar.tipTextDir": "Text direction", + "DE.Views.Toolbar.textIndBefore": "Indent before", + "DE.Views.Toolbar.textIndAfter": "Indent after", "DE.Views.ViewTab.textAlwaysShowToolbar": "Always Show Toolbar", "DE.Views.ViewTab.textDarkDocument": "Dark Document", "DE.Views.ViewTab.textFill": "Fill",