bugifx: layout insertion and qvariant (#255)

This commit is contained in:
Atul R 2019-12-08 22:33:27 +01:00 committed by GitHub
parent c7863f758e
commit d79ba0620d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@nodegui/nodegui",
"version": "0.9.0",
"version": "0.9.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@nodegui/nodegui",
"version": "0.9.0",
"version": "0.9.1",
"description": "A cross platform library to build native desktop apps.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",

View File

@ -20,13 +20,13 @@ export class QVariant extends Component {
toString(): string {
return this.native.toString();
}
toInt(): string {
toInt(): number {
return this.native.toInt();
}
toDouble(): string {
toDouble(): number {
return this.native.toDouble();
}
toBool(): string {
toBool(): boolean {
return this.native.toBool();
}
}

View File

@ -14,10 +14,10 @@ export class FlexLayout extends NodeLayout {
protected flexNode?: FlexNode;
addWidget(childWidget: NodeWidget, childFlexNode?: FlexNode): void {
if (this.nodeChildren.has(childWidget)) {
return;
}
const childYogaNode = childFlexNode || childWidget.getFlexNode();
if (this.nodeChildren.has(childWidget)) {
this.removeWidget(childWidget, childYogaNode);
}
this.nodeChildren.add(childWidget);
this.native.addWidget(childWidget.native, childYogaNode);
}
@ -28,10 +28,10 @@ export class FlexLayout extends NodeLayout {
childFlexNode?: FlexNode,
beforeChildFlexNode?: FlexNode,
): void {
if (this.nodeChildren.has(childWidget)) {
return;
}
const childYogaNode = childFlexNode || childWidget.getFlexNode();
if (this.nodeChildren.has(childWidget)) {
this.removeWidget(childWidget, childYogaNode);
}
const beforeChildYogaNode = beforeChildFlexNode || beforeChildWidget.getFlexNode();
this.nodeChildren.add(childWidget); // No orderer required yet, so just inserting at the end.
this.native.insertChildBefore(childWidget.native, beforeChildYogaNode, childYogaNode);