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

26 lines
874 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());
constructor() {
super(el.div({ class: "application_ApplicationView" }));
2019-08-20 04:56:40 +08:00
this.element.id = "root";
2019-08-20 04:56:40 +08:00
this.element.append(this.menu_view.element, this.main_content_view.element);
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;
}
}