mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-24 11:46:32 +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) {
|
||||
commands.registerCommand(this.toggleCommand, {
|
||||
execute: () => this.openView({
|
||||
toggle: true,
|
||||
activate: true
|
||||
})
|
||||
});
|
||||
const toolbarCmd = {
|
||||
id: MonitorViewContribution.TOGGLE_SERIAL_MONITOR_TOOLBAR
|
||||
}
|
||||
commands.registerCommand(toolbarCmd, {
|
||||
commands.registerCommand(this.toggleCommand, { execute: () => this.toggle() });
|
||||
commands.registerCommand({ id: MonitorViewContribution.TOGGLE_SERIAL_MONITOR_TOOLBAR }, {
|
||||
isVisible: widget => ArduinoToolbar.is(widget) && widget.side === 'right',
|
||||
execute: () => this.openView({
|
||||
toggle: true,
|
||||
activate: true
|
||||
})
|
||||
execute: () => this.toggle()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
return <React.Fragment key='autoscroll-toolbar-item'>
|
||||
<div
|
||||
|
Loading…
x
Reference in New Issue
Block a user