Adds base boilerplates similar to that of Electron

This commit is contained in:
Atul R
2019-07-29 23:31:03 +02:00
parent 1d60603633
commit 55ee7b2bee
7 changed files with 383 additions and 186 deletions
+6
View File
@@ -2,6 +2,7 @@ import addon from "../../core/addon";
import { NodeLayout } from "../../QtWidgets/QLayout";
import { EventWidget, BaseWidgetEvents } from "../../core/EventWidget";
import { NativeElement } from "../../core/Component";
import { FlexLayout } from "../../core/FlexLayout";
// All Widgets should extend from NodeWidget
// Implement all native QWidget methods here so that all widgets get access to those aswell
@@ -18,6 +19,11 @@ export abstract class NodeWidget extends EventWidget {
this.native.close();
};
setLayout = (parentLayout: NodeLayout) => {
const flexLayout = parentLayout as FlexLayout;
if (flexLayout.setFlexNode) {
//if flex layout set the flexnode
flexLayout.setFlexNode(this.getFlexNode());
}
this.native.setLayout(parentLayout.native);
this.layout = parentLayout;
};