You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-09-16 08:56:40 +02:00
Show overlay window while editing note
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
@@ -419,6 +419,8 @@ class Application {
|
||||
stdout: (text) => { console.info(text); },
|
||||
fullScreen: (b=true) => {},
|
||||
exit: () => {},
|
||||
showModalOverlay: (text) => {},
|
||||
hideModalOverlay: () => {},
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user