From 0af70b0f5794842a0ac6d5522f1f4f56368c6845 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sat, 25 Feb 2023 13:07:13 -0700 Subject: [PATCH] Various QoL fixes in UI * Update AP menus, add options * AP menu prompt to show user's Actor/Subject name * Allow MLTEV to have focus SGRs --- art/themes/luciano_blocktronics/MAILMNU.ANS | Bin 3422 -> 4190 bytes art/themes/luciano_blocktronics/MMENU.ANS | Bin 4239 -> 4239 bytes art/themes/luciano_blocktronics/MSGPMPT.ANS | Bin 283 -> 331 bytes .../luciano_blocktronics/activitypub_menu.ans | Bin 3949 -> 3976 bytes .../activitypub_menu_prompt.ans | Bin 0 -> 331 bytes .../activitypub_user_config_images.ans | Bin 2151 -> 2151 bytes art/themes/luciano_blocktronics/theme.hjson | 8 ++++ core/activitypub/user_config.js | 2 + core/fse.js | 4 +- core/multi_line_edit_text_view.js | 34 +++++++++-------- misc/menu_templates/activitypub.in.hjson | 35 +++++++++++++++--- 11 files changed, 61 insertions(+), 22 deletions(-) create mode 100644 art/themes/luciano_blocktronics/activitypub_menu_prompt.ans diff --git a/art/themes/luciano_blocktronics/MAILMNU.ANS b/art/themes/luciano_blocktronics/MAILMNU.ANS index fef5522e7cf8b6f7cbb4cac950f913833620e30a..09b559cfa4e590b692a453082bc2dfc0385de105 100644 GIT binary patch literal 4190 zcmb_f&2C&Z7)`~F4LcUh#$6!6?#>J(i&;%kRIw;RM6j7v8Vym@x`8$-JXVs|nJe9Q z-~lSmkL_#EEeQ!s)tj;X{hV{Y&%U17ri-)9vWsE1nXi_M*v~fKEaJdFUEJZLF`r%R z``*K0w&`e0vpHQf!rFWV=N_>%(GNW=mq#(A4+e|)fj%%<9>y2PCnxLY$6@``@jCeg zFBgZB2Z7;4P|B)AIkR9O6>JhxeaCbnkzjj*PZI?tq>Y~@?u-vo^2!`AnrkYD9(Kck z|A=U4T;J`SoYADqfN{k;^Kbr2jA7_G389!sr0`{oJRtPWxC|c2X<7&n$4J0DZ5iyw zDU_E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0N&fCOU}IhBuO-G4S2WPHlLJ@q{hR}sCb`r6%9 z3|DSQk;Q*Jnr`R*(c;biK~=%ye?8->-mR;8`s2>l*7o+Rt$SN~?mmC^BE3Ca*r@#e E0{0?d)&Kwi diff --git a/art/themes/luciano_blocktronics/MMENU.ANS b/art/themes/luciano_blocktronics/MMENU.ANS index cf395ec0e69ba7d43d00e7bc7efae74a102974d8..f779f31c6fd3b6d417bf0108ec3cf5495e5413e9 100644 GIT binary patch delta 26 icmeBI>{r}S#x=Q$%V4qs2g~MFT>DrVO($mxr~v?XhzKbF delta 26 icmeBI>{r}S#x+@igJp6Vm%-*$T>DrV4JKy_r~v?V7YHB# diff --git a/art/themes/luciano_blocktronics/MSGPMPT.ANS b/art/themes/luciano_blocktronics/MSGPMPT.ANS index 40415248b99fd6a74b2e1ba6eebbc5263603be2e..0f7c2da814759a4577e6d2813202f8fb2262c316 100644 GIT binary patch delta 156 zcmbQubehRoI@%ytI@;JES3x@3(Ava2_YP3R+SmxpyaN_AHn%o0$h{9#1rY@@%t2hB zpn__MkKx3PRuZbtAs~~ufQIBM0CfS?-@bG2zQV)|LlzKk;;c{|BVz+2Bh%9i3=E8n W0Srt)8VHy@oqQF-+#Ml2I0*m{RVUH_ delta 146 zcmX@jG@HptI@-Y6#K79vAXh;;+R)m>JogS*$lTi4DEH1Ch#*kjJomnIv5X50sUhY|kq^c^mKS$qF1&V0Ith M4klCC$sYWw0K~^9U;qFB delta 74 zcmeB>e=E0PAGcUqeojt)d1hX^LT+MSVtQ(kbhNQ~?&kB{I*gP3IW;FMaEMJl$16NJ cm)9J~mIAWZO*Y`QoxGB72a^HQc5$yXuF-4Vir FlK{QkK*j(7 literal 0 HcmV?d00001 diff --git a/art/themes/luciano_blocktronics/activitypub_user_config_images.ans b/art/themes/luciano_blocktronics/activitypub_user_config_images.ans index b61239faa7d2ffd2abfcf6ca4f42e8026a5d6d74..116d966f02fe568a81154269edbe6846028588d5 100644 GIT binary patch delta 21 dcmaDZ@LXWS6c$FK%~M%cF*6yNPIlx_0{~dw2F?Hg delta 21 dcmaDZ@LXWS6c$Fq%~M%cF*6w&O?Ko^0{~dO2FU;b diff --git a/art/themes/luciano_blocktronics/theme.hjson b/art/themes/luciano_blocktronics/theme.hjson index 4243dda1..0363949b 100644 --- a/art/themes/luciano_blocktronics/theme.hjson +++ b/art/themes/luciano_blocktronics/theme.hjson @@ -1474,6 +1474,14 @@ } } } + + activityPubMenuCommand: { + mci: { + TL1: { + text: "|00|08(|11|AS|08)" + } + } + } } achievements: { diff --git a/core/activitypub/user_config.js b/core/activitypub/user_config.js index 11657b60..882f18eb 100644 --- a/core/activitypub/user_config.js +++ b/core/activitypub/user_config.js @@ -254,6 +254,8 @@ exports.getModule = class ActivityPubUserConfig extends MenuModule { imageView.setText(apSettings.image); iconView.setText(apSettings.icon); + imageView.setFocus(true); + return callback(null); }, ], diff --git a/core/fse.js b/core/fse.js index ad7149d8..dfff57b5 100644 --- a/core/fse.js +++ b/core/fse.js @@ -505,7 +505,7 @@ exports.FullScreenEditorModule = msg = insert( msg, tearLinePos, - bodyMessageView.getSGRFor('text') + bodyMessageView.getTextSgrPrefix() ); } @@ -1496,7 +1496,7 @@ exports.FullScreenEditorModule = const bodyMessageView = this.viewControllers.body.getView( MciViewIds.body.message ); - quoteLines += `${ansi.normal()}${bodyMessageView.getSGRFor('text')}`; + quoteLines += `${ansi.normal()}${bodyMessageView.getTextSgrPrefix()}`; } msgView.addText(`${quoteLines}\n\n`); } diff --git a/core/multi_line_edit_text_view.js b/core/multi_line_edit_text_view.js index 5fddbb1b..192c9e7c 100644 --- a/core/multi_line_edit_text_view.js +++ b/core/multi_line_edit_text_view.js @@ -128,14 +128,6 @@ function MultiLineEditTextView(options) { // this.cursorPos = { col: 0, row: 0 }; - this.getSGRFor = function (sgrFor) { - return ( - { - text: self.getSGR(), - }[sgrFor] || self.getSGR() - ); - }; - this.isEditMode = function () { return 'edit' === self.mode; }; @@ -144,6 +136,14 @@ function MultiLineEditTextView(options) { return 'preview' === self.mode; }; + this.getTextSgrPrefix = function () { + if (!self.isEditMode()) { + return ''; + } + + return self.hasFocus ? self.getFocusSGR() : self.getSGR(); + }; + // :TODO: Most of the calls to this could be avoided via incrementRow(), decrementRow() that keeps track or such this.getTextLinesIndex = function (row) { if (!_.isNumber(row)) { @@ -171,7 +171,7 @@ function MultiLineEditTextView(options) { this.toggleTextCursor = function (action) { self.client.term.rawWrite( - `${self.getSGRFor('text')}${ + `${self.getTextSgrPrefix()}${ 'hide' === action ? ansi.hideCursor() : ansi.showCursor() }` ); @@ -183,11 +183,11 @@ function MultiLineEditTextView(options) { const startIndex = self.getTextLinesIndex(startRow); const endIndex = Math.min(self.getTextLinesIndex(endRow), self.textLines.length); const absPos = self.getAbsolutePosition(startRow, 0); + const prefix = self.getTextSgrPrefix(); for (let i = startIndex; i < endIndex; ++i) { - //${self.getSGRFor('text')} self.client.term.write( - `${ansi.goto(absPos.row++, absPos.col)}${self.getRenderText(i)}`, + `${ansi.goto(absPos.row++, absPos.col)}${prefix}${self.getRenderText(i)}`, false // convertLineFeeds ); } @@ -492,7 +492,7 @@ function MultiLineEditTextView(options) { .slice(self.cursorPos.col - c.length); self.client.term.write( - `${ansi.hideCursor()}${self.getSGRFor('text')}${renderText}${ansi.goto( + `${ansi.hideCursor()}${self.getTextSgrPrefix()}${renderText}${ansi.goto( absPos.row, absPos.col )}${ansi.showCursor()}`, @@ -1105,10 +1105,14 @@ MultiLineEditTextView.prototype.redraw = function () { }; MultiLineEditTextView.prototype.setFocus = function (focused) { - this.client.term.rawWrite(this.getSGRFor('text')); - this.moveClientCursorToCursorPos(); - MultiLineEditTextView.super_.prototype.setFocus.call(this, focused); + + if (this.isEditMode() && this.getSGR() !== this.getFocusSGR()) { + this.redrawVisibleArea(); + } else { + this.client.term.rawWrite(this.getTextSgrPrefix()); + } + this.moveClientCursorToCursorPos(); }; MultiLineEditTextView.prototype.setText = function ( diff --git a/misc/menu_templates/activitypub.in.hjson b/misc/menu_templates/activitypub.in.hjson index 5f4b148e..87579043 100644 --- a/misc/menu_templates/activitypub.in.hjson +++ b/misc/menu_templates/activitypub.in.hjson @@ -1,9 +1,9 @@ { menus: { activityPubMenu: { - desc: ActivityPub + desc: ActivityPub Menu art: activitypub_menu - prompt: menuCommand + prompt: activiytPubMenuCommand submit: [ { value: {command: "S"} @@ -14,17 +14,26 @@ action: @menu:activityPubUserConfig } { - value: {command: "M"} + value: {command: "S"} action: @menu:activityPubSocialManager } { value: {command: "Q"} action: @menu:mainMenu } + { + value: { command: "E" } + action: @menu:privateMailMenu + } + { + value: { command: "G" } + action: @menu:fullLogoffSequence + } ] } + activityPubActorSearch: { - desc: Viewing ActivityPub + desc: ActivityPub Search module: activitypub/actor_search config: { cls: true @@ -166,7 +175,7 @@ } } activityPubSocialManager: { - desc: Social Manager + desc: ActivityPub Social Manager module: ./activitypub/social_manager config: { art: {main: "activitypub_social_manager"} @@ -199,4 +208,20 @@ } } } + + prompts: { + activityPubMenuCommand: { + art: activitypub_menu_prompt + mci: { + ET2: { + argName: command + width: 20 + maxLength: 20 + submit: true + textStyle: upper + focus: true + } + } + } + } }