bumps nodegui to 0.8.0 and fix tabwidget layout issue (#248)

* bumps nodegui to 0.8.0

* Fixes a size issue with tabWidgets

* Fixes tabwidget not stretching

* change to nodewidget
This commit is contained in:
Atul R 2019-12-04 20:19:39 +01:00 committed by GitHub
parent 352e0ee84a
commit b0c9bca53a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

2
package-lock.json generated
View File

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

View File

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

View File

@ -15,6 +15,7 @@ export const QTabWidgetEvents = Object.freeze({
export class QTabWidget extends NodeWidget {
native: NativeElement;
tabs: NodeWidget[];
constructor(parent?: NodeWidget) {
let native;
if (parent) {
@ -24,12 +25,14 @@ export class QTabWidget extends NodeWidget {
}
super(native);
this.nodeParent = parent;
this.tabs = [];
this.native = native;
}
addTab(page: NodeWidget, icon: QIcon, label: string): void {
this.nodeChildren.add(page);
this.native.addTab(page.native, icon.native, label);
this.tabs.push(page);
page.setFlexNodeSizeControlled(true);
}
setTabPosition(tabPosition: TabPosition): void {
@ -46,6 +49,9 @@ export class QTabWidget extends NodeWidget {
removeTab(index: number): void {
this.native.removeTab(index);
const toRemove = this.tabs[index];
toRemove.setFlexNodeSizeControlled(false);
this.tabs.splice(index, 1);
}
setTabsClosable(closeable: boolean): void {