diff --git a/CliClient/app/app-gui.js b/CliClient/app/app-gui.js index 1803ae8d0..ffb47c831 100644 --- a/CliClient/app/app-gui.js +++ b/CliClient/app/app-gui.js @@ -230,6 +230,30 @@ class AppGui { this.rootWidget_.addChild(win1); } + showModalOverlay(text) { + if (!this.widget('overlayWindow')) { + const textWidget = new TextWidget(); + textWidget.hStretch = true; + textWidget.vStretch = true; + textWidget.text = 'testing'; + textWidget.name = 'overlayText'; + + const win = new WindowWidget(); + win.name = 'overlayWindow'; + win.addChild(textWidget); + + this.rootWidget_.addChild(win); + } + + this.widget('overlayWindow').activate(); + this.widget('overlayText').text = text; + } + + hideModalOverlay() { + if (this.widget('overlayWindow')) this.widget('overlayWindow').hide(); + this.widget('mainWindow').activate(); + } + addCommandToConsole(cmd) { this.stdout(chalk.cyan.bold('> ' + cmd)); } diff --git a/CliClient/app/app.js b/CliClient/app/app.js index 3e30db30b..831ae9c86 100644 --- a/CliClient/app/app.js +++ b/CliClient/app/app.js @@ -419,6 +419,8 @@ class Application { stdout: (text) => { console.info(text); }, fullScreen: (b=true) => {}, exit: () => {}, + showModalOverlay: (text) => {}, + hideModalOverlay: () => {}, }; } diff --git a/CliClient/app/command-edit.js b/CliClient/app/command-edit.js index 3ac25981b..8eb4a6436 100644 --- a/CliClient/app/command-edit.js +++ b/CliClient/app/command-edit.js @@ -74,8 +74,9 @@ class Command extends BaseCommand { this.logger().info('Disabling fullscreen...'); - this.stdout(_('Starting to edit note. Close the editor to get back to the prompt.')); + //this.stdout(_('Starting to edit note. Close the editor to get back to the prompt.')); + app().gui().showModalOverlay(_('Starting to edit note. Close the editor to get back to the prompt.')); app().gui().forceRender(); const termState = app().gui().term().saveState(); @@ -83,6 +84,7 @@ class Command extends BaseCommand { spawnSync(editorPath, editorArgs, { stdio: 'inherit' }); app().gui().term().restoreState(termState); + app().gui().hideModalOverlay(); app().gui().forceRender(); // -------------------------------------------------------------------------