mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-25 20:26:38 +00:00
when switching serial monitor on/off
open/dispose the monitor widget instead of toggling it. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
a2b3d9b314
commit
5aae800a4e
@ -87,25 +87,23 @@ export class MonitorViewContribution extends AbstractViewContribution<MonitorWid
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (this.toggleCommand) {
|
if (this.toggleCommand) {
|
||||||
commands.registerCommand(this.toggleCommand, {
|
commands.registerCommand(this.toggleCommand, { execute: () => this.toggle() });
|
||||||
execute: () => this.openView({
|
commands.registerCommand({ id: MonitorViewContribution.TOGGLE_SERIAL_MONITOR_TOOLBAR }, {
|
||||||
toggle: true,
|
|
||||||
activate: true
|
|
||||||
})
|
|
||||||
});
|
|
||||||
const toolbarCmd = {
|
|
||||||
id: MonitorViewContribution.TOGGLE_SERIAL_MONITOR_TOOLBAR
|
|
||||||
}
|
|
||||||
commands.registerCommand(toolbarCmd, {
|
|
||||||
isVisible: widget => ArduinoToolbar.is(widget) && widget.side === 'right',
|
isVisible: widget => ArduinoToolbar.is(widget) && widget.side === 'right',
|
||||||
execute: () => this.openView({
|
execute: () => this.toggle()
|
||||||
toggle: true,
|
|
||||||
activate: true
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected async toggle(): Promise<void> {
|
||||||
|
const widget = this.tryGetWidget();
|
||||||
|
if (widget) {
|
||||||
|
widget.dispose();
|
||||||
|
} else {
|
||||||
|
await this.openView({ activate: true, reveal: true });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected renderAutoScrollButton(): React.ReactNode {
|
protected renderAutoScrollButton(): React.ReactNode {
|
||||||
return <React.Fragment key='autoscroll-toolbar-item'>
|
return <React.Fragment key='autoscroll-toolbar-item'>
|
||||||
<div
|
<div
|
||||||
|
Loading…
x
Reference in New Issue
Block a user