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:
parent
352e0ee84a
commit
b0c9bca53a
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nodegui/nodegui",
|
||||
"version": "0.7.0",
|
||||
"version": "0.8.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user