From 9e090ad2ac743fa2d6bdeb62a30e183fea6178ec Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 21 Nov 2024 20:47:26 +0300 Subject: [PATCH 1/2] [PE] Select pointer type --- .../toolbar/1.25x/big/btn-big-hand-tool.png | Bin .../toolbar/1.5x/big/btn-big-hand-tool.png | Bin .../toolbar/1.75x/big/btn-big-hand-tool.png | Bin .../img/toolbar/1x/big/btn-big-hand-tool.png | Bin .../toolbar/2.5x/big/btn-big-hand-tool.svg | 0 .../img/toolbar/2x/big/btn-big-hand-tool.png | Bin .../toolbar/1.25x/big/btn-big-hand-tool.png | Bin 526 -> 0 bytes .../toolbar/1.5x/big/btn-big-hand-tool.png | Bin 661 -> 0 bytes .../toolbar/1.75x/big/btn-big-hand-tool.png | Bin 870 -> 0 bytes .../img/toolbar/1x/big/btn-big-hand-tool.png | Bin 485 -> 0 bytes .../toolbar/2.5x/big/btn-big-hand-tool.svg | 1 - .../img/toolbar/2x/big/btn-big-hand-tool.png | Bin 961 -> 0 bytes .../main/app/controller/Main.js | 2 - .../main/app/controller/ViewTab.js | 25 ++++++++- .../main/app/view/ViewTab.js | 48 ++++++++++++++++++ apps/presentationeditor/main/locale/en.json | 6 ++- 16 files changed, 77 insertions(+), 5 deletions(-) rename apps/{documenteditor => common}/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png (100%) rename apps/{documenteditor => common}/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png (100%) rename apps/{documenteditor => common}/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png (100%) rename apps/{documenteditor => common}/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png (100%) rename apps/{documenteditor => common}/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg (100%) rename apps/{documenteditor => common}/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png (100%) delete mode 100644 apps/pdfeditor/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png delete mode 100644 apps/pdfeditor/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png delete mode 100644 apps/pdfeditor/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png delete mode 100644 apps/pdfeditor/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png delete mode 100644 apps/pdfeditor/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg delete mode 100644 apps/pdfeditor/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png diff --git a/apps/documenteditor/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png b/apps/common/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png similarity index 100% rename from apps/documenteditor/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png rename to apps/common/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png diff --git a/apps/documenteditor/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png b/apps/common/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png similarity index 100% rename from apps/documenteditor/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png rename to apps/common/main/resources/img/toolbar/1.5x/big/btn-big-hand-tool.png diff --git a/apps/documenteditor/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png b/apps/common/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png similarity index 100% rename from apps/documenteditor/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png rename to apps/common/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png diff --git a/apps/documenteditor/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png b/apps/common/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png similarity index 100% rename from apps/documenteditor/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png rename to apps/common/main/resources/img/toolbar/1x/big/btn-big-hand-tool.png diff --git a/apps/documenteditor/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg b/apps/common/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg similarity index 100% rename from apps/documenteditor/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg rename to apps/common/main/resources/img/toolbar/2.5x/big/btn-big-hand-tool.svg diff --git a/apps/documenteditor/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png b/apps/common/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png similarity index 100% rename from apps/documenteditor/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png rename to apps/common/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png diff --git a/apps/pdfeditor/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png b/apps/pdfeditor/main/resources/img/toolbar/1.25x/big/btn-big-hand-tool.png deleted file mode 100644 index 1e3722ba1178e1fcca95993ca21af751ef110524..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 526 zcmV+p0`dKcP)}42F?_gp)7_I|*|z93TM+lYoRtI0=)01SIf5QnH3*yDL{3&>teb%>> z6Jly=YHI4=NyYFnT#Wn37YQM#7(RxJaUTsP0a+mYU@!^D0^vu42}M4vdm@a0^AX*H z?Nfs3+C7DRN-*8K2iqrn>7L&937@)Wlzm2m36%U-z%-vXN5S-(H%GxVpEm?BUFJ>r z6v%?SfYG)8I-XJ7 zc3LXC?aBxy+i9unwyR*4sjx(o3nUC(OMIr;1u_p^ioX@-d?~udQDzOCXjU}RD&Al3 zj_xl@ix+_t#vQR#-d}3$N43;m!Ku5RXk%`5PcnN2Lw7y%#@t#8;8^G)yyM(pp|d?+ z1T5mQQCpMyhiN3l2q03CdWA9EN>1&R9a++Qh~xoECne1 z7fS~!P6Bd3rAR=knK_^zmw=3B=75TjfK)R!`@pqkuYrR3oXC11Pz8&E+&v6Q+C07WhBt^gD_rmqVC#f^#OKD$gt zi35t+lxCDfpaYetr}j}x1RDPMKqcy_)zngfLIiP)dU9z%A%ZxrJ-IZXU2pZbR z;GQ+i)QX;60s~nLXCc3^*&=r zquPEfY~F;=0d?GZEKH{ZS7T@2ql=EfPEl9&qVK9chu_deM_{M5t3s`$@2WqC-=mTD v2xw2I0#Qa9d5?hhcq&lMnl)?I?4$M#oz;C;;|FE500000NkvXXu0mjfs0b%` diff --git a/apps/pdfeditor/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png b/apps/pdfeditor/main/resources/img/toolbar/1.75x/big/btn-big-hand-tool.png deleted file mode 100644 index 889b06d8e3be00f99442976011897e91658c05a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 870 zcmV-s1DX7ZP)pS#N-zjcyE-%z9{X0D^Kw z4W;L=h$g<$+Cz&25R@xwC_P6r23q9{@<4|P-UCrM71a_61X|?_@<4|P-UCrM71a_8 z2%7kt;~nc0;VK3YH1RjbJJz$|D)xMk5{T8OErZA)-m)o#x8bTy-@71CK~Z=cuH5v! z3xX=Gk1IEQ9zal~^>Ov4&u3^_Qx8p7hN=uAgUBEwEe!OAsKlI717R9@wkYw~HH{raXCLsurtGe13Lu(|O;#Zu zk3M~Ypu?ku0Yu|&ve4%Kcl7BC1P+f_y0K<*kg z)@A^6C2J*q-o%iYw8~>RVF6)NZZU9y=hNpT5lJfK&R2U4LAlO#xe@bQF z`w7-DY?aC!vIySmlLPV*=R_@>*C!F?S`lEya=M)okCza*RxEe;yK#dsNxNk9ILQpc zB<+&X{6T*sLdE~XFz;5yDk4hk{`BQry;=y&!iTrg(exx(BM3<<()Ek$4<@}tN7!xVY|Siz&G|J8&JOKz2O_v8(i+^R;EbNA#8m)#6EjlXvWa%V1y z&s0(KJ22>Pxp&iNqyUWmg`9C`$ThD_q&b`DpUoM7Fo!Bx&v-`vM2Io%5_L5M$20n~ zA;z>zpizv$mRdaCV{MU$8$1vAY!Z?FS_nTrvG1|ANW=}E2Yfcg_-mo9aAnRg251jk wDH0Hbs}^1|KzrDd7(qQ^%QAdWvqo8l|J1BmmbD26$+{)MB7Qtdu%sW45-j3J0l{K^3@yu5TB0S& z_2&rQ5EG(rK@ju1AtprMf?!9DVxr?COW5tKLE=I3kRyWe_{frXpVoK;sR!dwUlS#r zP?0Vpeq^YxiIPsD2)`f+K~@0hd=(OmWwr?t1Zwv{=c|xlkJzLhw1}rh5mMa>J!lb6 zjUuGF)ifEWY=SY-MbTtb&x \ No newline at end of file diff --git a/apps/pdfeditor/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png b/apps/pdfeditor/main/resources/img/toolbar/2x/big/btn-big-hand-tool.png deleted file mode 100644 index 87ea9eb23bdc8accc2dc692efce7d60dcde66834..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 961 zcmV;y13vtTP)?gklw5i$ZJcmzI2-=Ut6!AZ-V0o^MhRoBW0 zo*egs)2yaBLf8w!AagUvK?!oa|vMuohvc7R?Q*_8LfmH@`=RmVn8 zF9Ejt*mwl6>e%=Mz^Y>7UbcAzu$tHy$u^GwRudaz+2#?zDq>?I+dKkTO>9hMo9-7! zYfagvd-Z6oE!%7XV9KMK0!U>qI$05b071t~LteHTOXQ9DW z(F#9n4p1Cf=wl%^Qeck^05#YwAv_x?utx@f8qAgo;DTCOzPO%{SEOzoY-HnKu~P$F zP)o}f*AwcHq;4JT-p0RT=KyG611}N#OdO*I%1#U%mk(Vc_L(w9ZI2zOJ2C#U_8Qpx z?)c`t27vyu_8Qpxqnr0y0A3RtI5PlzM@Klt23}(uh`o;x;JZJ53B-? zkF(Bav&zgd_^l(Bq4tD`?vX5*DjQ{8-!|WUFAJv324h}G-KJB-8#$!Bkh)FBH7Bq?%*9V5%3w;K1{Mro81ZL_&D=zG}ZlFF;N{gmizb&yu(r+ zrRe!%cam^3dnEEcd)DHDX7)(reW$I@>k~m7GCfnD>3zXQe' + '' + '
' + + '
' + + '' + + '' + + '
' + + '
' + '
' + '
' + '' + @@ -189,6 +194,12 @@ define([ me.btnMacros.on('click', function () { me.fireEvent('macros:click'); }); + me.btnSelectTool && me.btnSelectTool.on('toggle', _.bind(function(btn, state) { + state && me.fireEvent('pointer:select'); + }, me)); + me.btnHandTool && me.btnHandTool.on('toggle', _.bind(function(btn, state) { + state && me.fireEvent('pointer:hand'); + }, me)); }, initialize: function (options) { @@ -394,6 +405,36 @@ define([ dataHintOffset: 'small' }); this.lockedControls.push(this.btnMacros); + if (!this.appConfig.isEdit && !this.appConfig.isRestrictedEdit) { + this.btnSelectTool = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-select', + lock: [_set.disableOnStart], + caption: me.capBtnSelect, + toggleGroup: 'select-tools-tb', + enableToggle: true, + allowDepress: false, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.btnSelectTool); + + this.btnHandTool = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-big-hand-tool', + lock: [_set.disableOnStart], + caption: me.capBtnHand, + toggleGroup: 'select-tools-tb', + enableToggle: true, + allowDepress: false, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.btnHandTool); + } + Common.UI.LayoutManager.addControls(this.lockedControls); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); }, @@ -424,6 +465,8 @@ define([ this.chLeftMenu.render($host.find('#slot-chk-leftmenu')); this.chRightMenu.render($host.find('#slot-chk-rightmenu')); this.btnMacros.render($host.find('#slot-btn-macros')); + this.btnSelectTool && this.btnSelectTool.render($host.find('#slot-btn-select-tool')); + this.btnHandTool && this.btnHandTool.render($host.find('#slot-btn-hand-tool')); return this.$el; }, @@ -440,6 +483,8 @@ define([ me.btnGuides.updateHint(me.tipGuides); me.btnGridlines.updateHint(me.tipGridlines); me.btnMacros.updateHint(me.tipMacros); + me.btnSelectTool && me.btnSelectTool.updateHint(me.tipSelectTool); + me.btnHandTool && me.btnHandTool.updateHint(me.tipHandTool); me.btnGuides.setMenu( new Common.UI.Menu({ cls: 'shifted-right', @@ -501,6 +546,9 @@ define([ me.btnSlideMaster.$el.closest('.group').remove(); me.$el.find('.slide-master-separator').remove(); } + if (config.isEdit || config.isRestrictedEdit) { + me.$el.find('.group-tool-select').remove(); + } if (Common.UI.Themes.available()) { function _add_tab_styles() { diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 66ec589749..f9a3ff527c 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -2952,5 +2952,9 @@ "PE.Views.ViewTab.tipSlideMaster": "Slide master", "PE.Views.Toolbar.textTabDesign": "Design", "PE.Views.ViewTab.textMacros": "Macros", - "PE.Views.ViewTab.tipMacros": "Macros" + "PE.Views.ViewTab.tipMacros": "Macros", + "PE.Views.ViewTab.capBtnHand": "Hand", + "PE.Views.ViewTab.capBtnSelect": "Select", + "PE.Views.ViewTab.tipSelectTool": "Select tool", + "PE.Views.ViewTab.tipHandTool": "Hand tool" } From 5a22979ba53048ff1780b32a84df4480be64d2e8 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 21 Nov 2024 22:36:39 +0300 Subject: [PATCH 2/2] [PE] Refactoring --- apps/presentationeditor/main/app/view/ViewTab.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/presentationeditor/main/app/view/ViewTab.js b/apps/presentationeditor/main/app/view/ViewTab.js index f50cb6b47b..155fa80465 100644 --- a/apps/presentationeditor/main/app/view/ViewTab.js +++ b/apps/presentationeditor/main/app/view/ViewTab.js @@ -51,11 +51,11 @@ define([ '' + '
' + '
' + - '
' + + '
' + '' + '' + '
' + - '
' + + '
' + '
' + '
' + '' + @@ -547,7 +547,7 @@ define([ me.$el.find('.slide-master-separator').remove(); } if (config.isEdit || config.isRestrictedEdit) { - me.$el.find('.group-tool-select').remove(); + me.$el.find('#slot-btn-hand-tool').closest('.group').next().addBack().remove(); } if (Common.UI.Themes.available()) {