mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-08 09:58:34 +00:00
Preserve Autoscroll and Timestamp states
Signed-off-by: jbicker <jan.bicker@typefox.io>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ReactWidget, Message, Widget } from "@theia/core/lib/browser";
|
||||
import { ReactWidget, Message, Widget, StatefulWidget } from "@theia/core/lib/browser";
|
||||
import { postConstruct, injectable, inject } from "inversify";
|
||||
import * as React from 'react';
|
||||
import Select, { components } from 'react-select';
|
||||
@@ -107,7 +107,7 @@ export interface SelectOption {
|
||||
}
|
||||
|
||||
@injectable()
|
||||
export class MonitorWidget extends ReactWidget {
|
||||
export class MonitorWidget extends ReactWidget implements StatefulWidget {
|
||||
|
||||
static readonly ID = 'serial-monitor';
|
||||
|
||||
@@ -169,6 +169,14 @@ export class MonitorWidget extends ReactWidget {
|
||||
this.update();
|
||||
}
|
||||
|
||||
storeState(): MonitorModel.Data {
|
||||
return this.model.store();
|
||||
}
|
||||
|
||||
restoreState(oldState: MonitorModel.Data): void {
|
||||
this.model.restore(oldState);
|
||||
}
|
||||
|
||||
protected onAfterAttach(msg: Message) {
|
||||
super.onAfterAttach(msg);
|
||||
this.clear();
|
||||
|
||||
Reference in New Issue
Block a user