phantasmal-world/src/application/gui/ApplicationView.ts

30 lines
901 B
TypeScript
Raw Normal View History

2019-08-20 04:56:40 +08:00
import { NavigationView } from "./NavigationView";
import { MainContentView } from "./MainContentView";
import { el } from "../../core/gui/dom";
import { ResizableWidget } from "../../core/gui/ResizableWidget";
2019-08-20 04:56:40 +08:00
export class ApplicationView extends ResizableWidget {
2019-08-20 04:56:40 +08:00
private menu_view = this.disposable(new NavigationView());
private main_content_view = this.disposable(new MainContentView());
readonly element = el.div(
{ class: "application_ApplicationView" },
this.menu_view.element,
this.main_content_view.element,
);
2019-08-20 04:56:40 +08:00
constructor() {
super();
2019-08-20 04:56:40 +08:00
this.element.id = "root";
this.finalize_construction(ApplicationView.prototype);
2019-08-20 04:56:40 +08:00
}
resize(width: number, height: number): this {
super.resize(width, height);
this.main_content_view.resize(width, height - this.menu_view.height);
return this;
}
}