bugifx: layout insertion and qvariant (#255)
This commit is contained in:
parent
c7863f758e
commit
d79ba0620d
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nodegui/nodegui",
|
||||
"version": "0.9.0",
|
||||
"version": "0.9.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user