diff --git a/.all-contributorsrc b/.all-contributorsrc
index 5e56a329..4fae6153 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -175,6 +175,15 @@
"contributions": [
"code"
]
+ },
+ {
+ "login": "KaMeHb-UA",
+ "name": "KaMeHb-UA",
+ "avatar_url": "https://avatars.githubusercontent.com/u/20382677?v=4",
+ "profile": "https://github.com/KaMeHb-UA",
+ "contributions": [
+ "code"
+ ]
}
],
"contributorsPerLine": 7,
diff --git a/README.md b/README.md
index 534c6285..e2ffd8ad 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,8 @@
# React NodeGui
+⚠️ React NodeGui is no longer maintained. Please fork it to continue development ⚠️
+
+
[](https://spectrum.chat/nodegui)
[](#contributors)
@@ -127,31 +130,37 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
diff --git a/package.json b/package.json
index 46c0ac64..b7abff71 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@nodegui/react-nodegui",
- "version": "0.13.0",
+ "version": "0.14.0",
"description": "React Native for building cross platform desktop applications",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
@@ -20,7 +20,7 @@
"docs": "typedoc && node ./website/docs/scripts/fixdocs.js"
},
"dependencies": {
- "@nodegui/nodegui": "^0.36.0",
+ "@nodegui/nodegui": "^0.57.1",
"@types/react-reconciler": "^0.18.0",
"phin": "3.5.1",
"react-deep-force-update": "^2.1.3",
@@ -28,14 +28,15 @@
"react-reconciler": "^0.25.1"
},
"peerDependencies": {
- "react": "^17.0.2"
+ "react": "^16.14.0"
},
"devDependencies": {
- "@types/node": "^16.6.1",
+ "@types/node": "^16.11.0",
+ "@types/react": "^16.14.0",
"prettier": "^2.3.2",
- "react": "^16.13.1",
+ "react": "^16.14.0",
"typedoc": "^0.17.8",
"typedoc-plugin-markdown": "^2.4.2",
- "typescript": "^4.3.5"
+ "typescript": "^4.4.4"
}
}
diff --git a/src/components/AbstractComponents/RNAbstractButton.ts b/src/components/AbstractComponents/RNAbstractButton.ts
index fc993b30..09092f4b 100644
--- a/src/components/AbstractComponents/RNAbstractButton.ts
+++ b/src/components/AbstractComponents/RNAbstractButton.ts
@@ -4,7 +4,7 @@ import { QAbstractButton } from "@nodegui/nodegui";
/**
* The Button component provides ability to add and manipulate native button widgets. It is based on
- * [NodeGui's QPushButton](https://docs.nodegui.org/docs/api/QPushButton).
+ * [NodeGui's QPushButton](https://docs.nodegui.org/docs/api/generated/classes/QPushButton).
* ## Example
* ```javascript
* import React from "react";
@@ -30,15 +30,15 @@ export interface AbstractButtonProps
*/
children?: string;
/**
- * Sets the given text to the button. [QPushButton: setText](https://docs.nodegui.org/docs/api/QPushButton#buttonsettexttext)
+ * Sets the given text to the button. [QPushButton: setText](https://docs.nodegui.org/docs/api/generated/classes/QPushButton#buttonsettexttext)
*/
text?: string;
/**
- * Sets an icon in the button. [QPushButton: setIcon](https://docs.nodegui.org/docs/api/QPushButton#buttonseticonicon)
+ * Sets an icon in the button. [QPushButton: setIcon](https://docs.nodegui.org/docs/api/generated/classes/QPushButton#buttonseticonicon)
*/
icon?: QIcon;
/**
- * Sets an icon size in the button. [QPushButton: setIconSize](https://docs.nodegui.org/docs/api/QPushButton#buttonseticonsize)
+ * Sets an icon size in the button. [QPushButton: setIconSize](https://docs.nodegui.org/docs/api/generated/classes/QPushButton#buttonseticonsize)
*/
iconSize?: QSize;
}
diff --git a/src/components/Action/RNAction.ts b/src/components/Action/RNAction.ts
index ba44cd5c..485ca481 100644
--- a/src/components/Action/RNAction.ts
+++ b/src/components/Action/RNAction.ts
@@ -38,7 +38,7 @@ export interface ActionProps extends RNProps {
icon?: QIcon;
/**
- * Sets the object name (id) of the widget in Qt. Object name can be analogous to id of an element in the web world. Using the objectName of the widget one can reference it in the Qt's stylesheet much like what we do with id in the web world. [QWidget: setObjectName](https://docs.nodegui.org/docs/api/NodeWidget#widgetsetobjectnameobjectname)
+ * Sets the object name (id) of the widget in Qt. Object name can be analogous to id of an element in the web world. Using the objectName of the widget one can reference it in the Qt's stylesheet much like what we do with id in the web world. [QWidget: setObjectName](https://docs.nodegui.org/docs/api/generated/classes/QWidget#widgetsetobjectnameobjectname)
*/
id?: string;
diff --git a/src/components/AnimatedImage/RNAnimatedImage.ts b/src/components/AnimatedImage/RNAnimatedImage.ts
index b39dcdea..1b7f7062 100644
--- a/src/components/AnimatedImage/RNAnimatedImage.ts
+++ b/src/components/AnimatedImage/RNAnimatedImage.ts
@@ -1,4 +1,4 @@
-import { QLabel, NodeWidget, QMovie, QSize } from "@nodegui/nodegui";
+import { QLabel, QWidget, QMovie, QSize } from "@nodegui/nodegui";
import { TextProps, setTextProps } from "../Text/RNText";
import { RNWidget } from "../config";
import { throwUnsupported, isValidUrl } from "../../utils/helpers";
@@ -44,16 +44,16 @@ export class RNAnimatedImage extends QLabel implements RNWidget {
setProps(newProps: AnimatedImageProps, oldProps: AnimatedImageProps): void {
setAnimatedImageProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "animatedimage";
diff --git a/src/components/BoxView/RNBoxView.ts b/src/components/BoxView/RNBoxView.ts
index 9cc7e455..15035f3f 100644
--- a/src/components/BoxView/RNBoxView.ts
+++ b/src/components/BoxView/RNBoxView.ts
@@ -2,12 +2,13 @@ import {
QWidget,
QBoxLayoutSignals,
QBoxLayout,
- NodeWidget,
Direction,
+ QLayout,
+ QObjectSignals,
} from "@nodegui/nodegui";
import { ViewProps, setViewProps } from "../View/RNView";
import { RNComponent } from "../config";
-import { NodeDialog } from "@nodegui/nodegui/dist/lib/QtWidgets/QDialog";
+import { QDialog } from "@nodegui/nodegui/dist/lib/QtWidgets/QDialog";
export interface BoxViewProps extends ViewProps {
direction?: Direction;
@@ -20,7 +21,7 @@ const setBoxViewProps = (
) => {
const setter: BoxViewProps = {
set direction(direction: Direction) {
- widget.layout?.setDirection(direction);
+ widget.layout()?.setDirection(direction);
},
};
Object.assign(setter, newProps);
@@ -33,33 +34,36 @@ const setBoxViewProps = (
export class RNBoxView extends QWidget implements RNComponent {
native: any;
initialProps?: BoxViewProps;
- children: Array> = [];
- get layout() {
- return super.layout as QBoxLayout | undefined;
+ _children: Array> = [];
+
+ layout(): QBoxLayout | null {
+ return super.layout() as any;
}
- set layout(l: QBoxLayout | undefined) {
- super.layout = l;
+
+ setLayout(layout: QBoxLayout): void {
+ super.setLayout(layout);
}
+
setProps(newProps: BoxViewProps, oldProps: BoxViewProps): void {
- if (this.layout) {
+ if (this.layout()) {
setBoxViewProps(this, newProps, oldProps);
} else {
this.initialProps = newProps;
}
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
this.appendChild(child);
}
- appendChild(child: NodeWidget): void {
- if (child instanceof NodeDialog) {
+ appendChild(child: QWidget): void {
+ if (child instanceof QDialog) {
return;
}
const updateChild = () => {
- this.layout?.addWidget(child);
- this.children.push(child);
+ this.layout()?.addWidget(child);
+ this._children.push(child);
};
- if (this.layout) {
+ if (this.layout()) {
updateChild();
return;
@@ -67,7 +71,6 @@ export class RNBoxView extends QWidget implements RNComponent {
const layout = new QBoxLayout(Direction.LeftToRight);
this.setLayout(layout);
- this.layout = layout;
// Newly created layout, so set initial props
if (this.initialProps) {
@@ -76,11 +79,11 @@ export class RNBoxView extends QWidget implements RNComponent {
updateChild();
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
- if (child instanceof NodeDialog) {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
+ if (child instanceof QDialog) {
return;
}
- const prevIndex = this.children.indexOf(beforeChild);
+ const prevIndex = this._children.indexOf(beforeChild);
if (prevIndex === -1) {
throw new Error(
@@ -88,14 +91,14 @@ export class RNBoxView extends QWidget implements RNComponent {
);
}
- this.children.splice(prevIndex, 0, child);
- this.layout?.insertWidget(prevIndex, child);
+ this._children.splice(prevIndex, 0, child);
+ this.layout()?.insertWidget(prevIndex, child);
}
- removeChild(child: NodeWidget): void {
- const prevIndex = this.children.indexOf(child);
+ removeChild(child: QWidget): void {
+ const prevIndex = this._children.indexOf(child);
if (prevIndex !== -1) {
- this.children.splice(prevIndex, 1);
+ this._children.splice(prevIndex, 1);
}
child.close();
diff --git a/src/components/Button/RNButton.ts b/src/components/Button/RNButton.ts
index f5c9f62a..f2bac8fe 100644
--- a/src/components/Button/RNButton.ts
+++ b/src/components/Button/RNButton.ts
@@ -1,4 +1,4 @@
-import { QPushButton, NodeWidget, QPushButtonSignals } from "@nodegui/nodegui";
+import { QPushButton, QWidget, QPushButtonSignals } from "@nodegui/nodegui";
import {
AbstractButtonProps,
setAbstractButtonProps
@@ -8,7 +8,7 @@ import { throwUnsupported } from "../../utils/helpers";
/**
* The Button component provides ability to add and manipulate native button widgets. It is based on
- * [NodeGui's QPushButton](https://docs.nodegui.org/docs/api/QPushButton).
+ * [NodeGui's QPushButton](https://docs.nodegui.org/docs/api/generated/classes/QPushButton).
* ## Example
* ```javascript
* import React from "react";
@@ -29,7 +29,7 @@ import { throwUnsupported } from "../../utils/helpers";
*/
export interface ButtonProps extends AbstractButtonProps {
/**
- * Sets whether the button border is raised. [QPushButton: setFlat](https://docs.nodegui.org/docs/api/QPushButton#buttonsetflatisflat)
+ * Sets whether the button border is raised. [QPushButton: setFlat](https://docs.nodegui.org/docs/api/generated/classes/QPushButton#buttonsetflatisflat)
*/
flat?: boolean;
}
@@ -52,16 +52,16 @@ const setButtonProps = (
* @ignore
*/
export class RNButton extends QPushButton implements RNWidget {
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
setProps(newProps: ButtonProps, oldProps: ButtonProps) {
diff --git a/src/components/Calendar/RNCalendar.ts b/src/components/Calendar/RNCalendar.ts
new file mode 100644
index 00000000..ecf4b8fc
--- /dev/null
+++ b/src/components/Calendar/RNCalendar.ts
@@ -0,0 +1,114 @@
+import {
+ Component,
+ DayOfWeek,
+ QCalendarWidget,
+ QCalendarWidgetSignals,
+ QFont,
+} from "@nodegui/nodegui";
+import {
+ HorizontalHeaderFormat,
+ SelectionMode,
+ VerticalHeaderFormat,
+} from "@nodegui/nodegui/dist/lib/QtWidgets/QCalendarWidget";
+import { throwUnsupported } from "../../utils/helpers";
+import { RNComponent } from "../config";
+import { setViewProps, ViewProps } from "../View/RNView";
+
+export interface CalendarProps extends ViewProps {
+ /**
+ * Sets the time an inactive date edit is shown before its contents are accepted. [QCalendarWidget: setDateEditAcceptDelay](https://docs.nodegui.org/docs/api/generated/classes/qcalendarwidget#setdateeditacceptdelay)
+ */
+ dateEditAcceptDelay?: number;
+ /**
+ * Sets whether the date edit popup is enabled. [QCalendarWidget: setDateEditEnabled](https://docs.nodegui.org/docs/api/generated/classes/qcalendarwidget#setdateeditenabled)
+ */
+ dateEditEnabled?: boolean;
+ /**
+ * Sets a value identifying the day displayed in the first column. [QCalendarWidget: setFirstDayOfWeek](https://docs.nodegui.org/docs/api/generated/classes/qcalendarwidget#setfirstdayofweek)
+ */
+ firstDayOfWeek?: DayOfWeek;
+ /**
+ * Sets a font for the action. [QCalendarWidget: setFont](https://docs.nodegui.org/docs/api/generated/classes/qcalendarwidget#setfont)
+ */
+ font?: QFont;
+ /**
+ * Sets whether the table grid is displayed. [QCalendarWidget: setGridVisible](https://docs.nodegui.org/docs/api/generated/classes/qcalendarwidget#setgridvisible)
+ */
+ gridVisible?: boolean;
+ /**
+ * Sets the format of the horizontal header. [QCalendarWidget: setHorizontalHeaderFormat](https://docs.nodegui.org/docs/api/generated/classes/qcalendarwidget#sethorizontalheaderformat)
+ */
+ horizontalHeaderFormat?: HorizontalHeaderFormat;
+ /**
+ * Sets whether the navigation bar is shown or not. [QCalendarWidget: setNavigationBarVisible](https://docs.nodegui.org/docs/api/generated/classes/qcalendarwidget#setnavigationbarvisible)
+ */
+ navigationBarVisible?: boolean;
+ /**
+ * Sets the type of selection the user can make in the calendar. [QCalendarWidget: setSelectionMode](https://docs.nodegui.org/docs/api/generated/classes/qcalendarwidget#setselectionmode)
+ */
+ selectionMode?: SelectionMode;
+ /**
+ * Sets the format of the vertical header. [QCalendarWidget: setVerticalHeaderFormat](https://docs.nodegui.org/docs/api/generated/classes/qcalendarwidget#setverticalheaderformat)
+ */
+ verticalHeaderFormat?: VerticalHeaderFormat;
+}
+
+const setCalendarProps = (
+ widget: RNCalendar,
+ newProps: CalendarProps,
+ oldProps: CalendarProps
+) => {
+ const setter: CalendarProps = {
+ set dateEditAcceptDelay(delay: number) {
+ widget.setDateEditAcceptDelay(delay);
+ },
+ set dateEditEnabled(enable: boolean) {
+ widget.setDateEditEnabled(enable);
+ },
+ set firstDayOfWeek(dayOfWeek: DayOfWeek) {
+ widget.setFirstDayOfWeek(dayOfWeek);
+ },
+ set font(font: QFont) {
+ widget.setFont(font);
+ },
+ set gridVisible(show: boolean) {
+ widget.setGridVisible(show);
+ },
+ set horizontalHeaderFormat(format: HorizontalHeaderFormat) {
+ widget.setHorizontalHeaderFormat(format);
+ },
+ set navigationBarVisible(visible: boolean) {
+ widget.setNavigationBarVisible(visible);
+ },
+ set selectionMode(mode: SelectionMode) {
+ widget.setSelectionMode(mode);
+ },
+ set verticalHeaderFormat(format: VerticalHeaderFormat) {
+ widget.setVerticalHeaderFormat(format);
+ },
+ };
+ Object.assign(setter, newProps);
+ setViewProps(widget, newProps, oldProps);
+};
+
+/**
+ * @ignore
+ */
+export class RNCalendar extends QCalendarWidget implements RNComponent {
+ setProps(newProps: CalendarProps, oldProps: CalendarProps): void {
+ setCalendarProps(this, newProps, oldProps);
+ }
+ appendInitialChild(child: Component): void {
+ throwUnsupported(this);
+ }
+ appendChild(child: Component): void {
+ throwUnsupported(this);
+ }
+ insertBefore(child: Component, beforeChild: Component): void {
+ throwUnsupported(this);
+ }
+ removeChild(child: Component): void {
+ throwUnsupported(this);
+ }
+ static tagName = "calendar";
+}
diff --git a/src/components/Calendar/index.ts b/src/components/Calendar/index.ts
new file mode 100644
index 00000000..68970266
--- /dev/null
+++ b/src/components/Calendar/index.ts
@@ -0,0 +1,91 @@
+import { ComponentConfig, registerComponent, RNComponent } from "../config";
+import { AppContainer } from "../../reconciler";
+import { Fiber } from "react-reconciler";
+import { CalendarProps, RNCalendar } from "./RNCalendar";
+
+class CalendarConfig extends ComponentConfig {
+ tagName = RNCalendar.tagName;
+ shouldSetTextContent(nextProps: CalendarProps): boolean {
+ return false;
+ }
+ createInstance(
+ newProps: CalendarProps,
+ rootInstance?: AppContainer,
+ context?: any,
+ workInProgress?: Fiber
+ ): RNCalendar {
+ const widget = new RNCalendar();
+ widget.setProps(newProps, {});
+ return widget;
+ }
+ commitMount(
+ instance: RNCalendar,
+ newProps: CalendarProps,
+ internalInstanceHandle: any
+ ): void {
+ if (newProps.visible !== false) {
+ instance.show();
+ }
+ return;
+ }
+ commitUpdate(
+ instance: RNCalendar,
+ updatePayload: any,
+ oldProps: CalendarProps,
+ newProps: CalendarProps,
+ finishedWork: Fiber
+ ): void {
+ instance.setProps(newProps, oldProps);
+ }
+}
+
+/**
+ * The Calendar component provides ability to add calendar widgets. It is based on
+ * [NodeGui's QCalendarWidget](https://docs.nodegui.org/docs/api/generated/classes/qcalendarwidget/).
+ * @example
+ * ```typescriptreact
+ * import {
+ * DateFormat,
+ * DayOfWeek,
+ * NativeElement,
+ * QCalendarWidgetSignals,
+ * QDate,
+ * } from "@nodegui/nodegui";
+ * import {
+ * Calendar,
+ * Renderer,
+ * useEventHandler,
+ * Window,
+ * } from "@nodegui/react-nodegui";
+ * import React from "react";
+ * const App = () => {
+ * const calendarClickHandler = useEventHandler(
+ * {
+ * activated: (nativeDate) => {
+ * const date = new QDate(nativeDate as unknown as NativeElement);
+ * console.log(`activated: ${date.toString(DateFormat.SystemLocaleDate)}`);
+ * },
+ * clicked: (nativeDate) => {
+ * const date = new QDate(nativeDate as unknown as NativeElement);
+ * console.log(`clicked: ${date.toString(DateFormat.SystemLocaleDate)}`);
+ * },
+ * currentPageChanged: (year, month) => {
+ * console.log(`currentPageChanged: year, month: ${year}, ${month}`);
+ * },
+ * selectionChanged: () => {
+ * console.log("selectionChanged");
+ * },
+ * },
+ * []
+ * );
+ *
+ * return (
+ *
+ *
+ *
+ * );
+ * }
+ * Renderer.render();
+ * ```
+ */
+export const Calendar = registerComponent(new CalendarConfig());
diff --git a/src/components/CheckBox/RNCheckBox.ts b/src/components/CheckBox/RNCheckBox.ts
index e8441210..43b98773 100644
--- a/src/components/CheckBox/RNCheckBox.ts
+++ b/src/components/CheckBox/RNCheckBox.ts
@@ -1,4 +1,4 @@
-import { QCheckBox, NodeWidget, QCheckBoxSignals } from "@nodegui/nodegui";
+import { QCheckBox, QWidget, QCheckBoxSignals } from "@nodegui/nodegui";
import { RNWidget } from "../config";
import { throwUnsupported } from "../../utils/helpers";
import {
@@ -8,7 +8,7 @@ import {
/**
* The CheckBox component provides ability to add and manipulate native button widgets. It is based on
- * [NodeGui's QCheckBox](https://docs.nodegui.org/docs/api/QCheckBox).
+ * [NodeGui's QCheckBox](https://docs.nodegui.org/docs/api/generated/classes/QCheckBox).
* ## Example
* ```javascript
* import React from "react";
@@ -29,7 +29,7 @@ import {
*/
export interface CheckBoxProps extends AbstractButtonProps {
/**
- * This property holds whether the button is checked. [QCheckBox: setChecked](https://docs.nodegui.org/docs/api/QCheckBox/#checkboxsetcheckedcheck)
+ * This property holds whether the button is checked. [QCheckBox: setChecked](https://docs.nodegui.org/docs/api/generated/classes/QCheckBox/#checkboxsetcheckedcheck)
*/
checked?: boolean;
}
@@ -55,16 +55,16 @@ export class RNCheckBox extends QCheckBox implements RNWidget {
setProps(newProps: CheckBoxProps, oldProps: CheckBoxProps): void {
setCheckBoxProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "checkbox";
diff --git a/src/components/ColorDialog/RNColorDialog.ts b/src/components/ColorDialog/RNColorDialog.ts
index b6b2fa54..5686fcef 100644
--- a/src/components/ColorDialog/RNColorDialog.ts
+++ b/src/components/ColorDialog/RNColorDialog.ts
@@ -1,4 +1,4 @@
-import { NodeWidget, QColor, QColorDialog, QColorDialogSignals } from "@nodegui/nodegui";
+import { QWidget, QColor, QColorDialog, QColorDialogSignals } from "@nodegui/nodegui";
import { ColorDialogOption } from "@nodegui/nodegui/dist/lib/QtWidgets/QColorDialog";
import { throwUnsupported } from "../../utils/helpers";
import { RNWidget } from "../config";
@@ -31,16 +31,16 @@ export class RNColorDialog extends QColorDialog implements RNWidget {
setProps(newProps: ColorDialogProps, oldProps: ColorDialogProps): void {
setColorDialogProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "color-dialog";
diff --git a/src/components/ComboBox/RNComboBox.ts b/src/components/ComboBox/RNComboBox.ts
index ebb21ab5..da2deea5 100644
--- a/src/components/ComboBox/RNComboBox.ts
+++ b/src/components/ComboBox/RNComboBox.ts
@@ -1,6 +1,6 @@
import {
QComboBox,
- NodeWidget,
+ QWidget,
QSize,
QVariant,
SizeAdjustPolicy,
@@ -52,7 +52,7 @@ const setComboBoxProps = (
widget.setProperty("count", count);
},
set iconSize(iconSize: QSize) {
- widget.setProperty("iconSize", iconSize.native);
+ widget.setProperty("iconSize", iconSize.native!);
},
set frame(frame: boolean) {
widget.setProperty("frame", frame);
@@ -61,7 +61,7 @@ const setComboBoxProps = (
widget.setProperty("currentIndex", currentIndex);
},
set currentData(value: QVariant) {
- widget.setProperty("currentData", value.native);
+ widget.setProperty("currentData", value.native!);
},
set currentText(text: string) {
widget.setProperty("currentText", text);
@@ -102,16 +102,16 @@ export class RNComboBox extends QComboBox implements RNWidget {
setProps(newProps: ComboBoxProps, oldProps: ComboBoxProps): void {
setComboBoxProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "combobox";
diff --git a/src/components/Dial/RNDial.ts b/src/components/Dial/RNDial.ts
index b2cb70e4..959f74e0 100644
--- a/src/components/Dial/RNDial.ts
+++ b/src/components/Dial/RNDial.ts
@@ -1,4 +1,4 @@
-import { QDial, NodeWidget, QDialSignals } from "@nodegui/nodegui";
+import { QDial, QWidget, QDialSignals } from "@nodegui/nodegui";
import { ViewProps, setViewProps } from "../View/RNView";
import { RNWidget } from "../config";
import { throwUnsupported } from "../../utils/helpers";
@@ -53,16 +53,16 @@ export class RNDial extends QDial implements RNWidget {
setProps(newProps: DialProps, oldProps: DialProps): void {
setDialProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "dial";
diff --git a/src/components/Dialog/RNDialog.ts b/src/components/Dialog/RNDialog.ts
index 70f5a161..eb875fcb 100644
--- a/src/components/Dialog/RNDialog.ts
+++ b/src/components/Dialog/RNDialog.ts
@@ -1,9 +1,8 @@
-import { FlexLayout, FocusReason, NodeWidget, QDialog, QDialogSignals, QFont } from "@nodegui/nodegui";
-import { NodeDialog } from "@nodegui/nodegui/dist/lib/QtWidgets/QDialog";
+import { FlexLayout, FocusReason, QWidget, QDialog, QDialogSignals, QFont } from "@nodegui/nodegui";
import { RNWidget } from "../config";
import { setViewProps, ViewProps } from "../View/RNView";
-export interface DialogProps extends ViewProps {
+export interface DialogProps extends ViewProps {
open?: boolean;
font?: QFont;
focus?: FocusReason;
@@ -45,32 +44,31 @@ export class RNDialog extends QDialog implements RNWidget {
setProps(newProps: DialogProps, oldProps: DialogProps): void {
setDialogProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
this.appendChild(child);
}
- appendChild(child: NodeWidget): void {
- if (!child || child instanceof NodeDialog) {
+ appendChild(child: QWidget): void {
+ if (!child || child instanceof QDialog) {
return;
}
- if (!this.layout) {
+ if (!this.layout()) {
const flexLayout = new FlexLayout();
flexLayout.setFlexNode(this.getFlexNode());
this.setLayout(flexLayout);
- this.layout = flexLayout;
}
- this.layout.addWidget(child);
+ this.layout()!.addWidget(child);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
- if (child! instanceof NodeDialog) {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
+ if (child! instanceof QDialog) {
this.appendChild(child);
}
}
- removeChild(child: NodeWidget): void {
- if (!this.layout) {
+ removeChild(child: QWidget): void {
+ if (!this.layout()) {
console.warn("parent has no layout to remove child from");
return;
}
- this.layout.removeWidget(child);
+ this.layout()!.removeWidget(child);
child.close();
}
static tagName = "dialog";
diff --git a/src/components/ErrorPrompt/RNErrorPrompt.ts b/src/components/ErrorPrompt/RNErrorPrompt.ts
index c1b6ae11..595bb3d0 100644
--- a/src/components/ErrorPrompt/RNErrorPrompt.ts
+++ b/src/components/ErrorPrompt/RNErrorPrompt.ts
@@ -1,4 +1,4 @@
-import { NodeWidget, QErrorMessage, QErrorMessageSignals } from "@nodegui/nodegui";
+import { QWidget, QErrorMessage, QErrorMessageSignals } from "@nodegui/nodegui";
import { throwUnsupported } from "../../utils/helpers";
import { RNWidget } from "../config";
import { DialogProps, setDialogProps } from "../Dialog/RNDialog";
@@ -22,16 +22,16 @@ export class RNErrorPrompt extends QErrorMessage implements RNWidget {
setProps(newProps: ErrorPromptProps, oldProps: ErrorPromptProps): void {
setErrorPromptProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "error-prompt";
diff --git a/src/components/FileDialog/RNFileDialog.ts b/src/components/FileDialog/RNFileDialog.ts
index a4c7ce1c..2bfae6b2 100644
--- a/src/components/FileDialog/RNFileDialog.ts
+++ b/src/components/FileDialog/RNFileDialog.ts
@@ -1,4 +1,4 @@
-import { NodeWidget, QFileDialog, DialogLabel, QFileDialogSignals, Option } from "@nodegui/nodegui";
+import { QWidget, QFileDialog, DialogLabel, QFileDialogSignals, Option } from "@nodegui/nodegui";
import { throwUnsupported } from "../../utils/helpers";
import { RNWidget } from "../config";
import { DialogProps, setDialogProps } from "../Dialog/RNDialog";
@@ -47,16 +47,16 @@ export class RNFileDialog extends QFileDialog implements RNWidget {
setProps(newProps: FileDialogProps, oldProps: FileDialogProps): void {
setFileDialogProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "file-dialog";
diff --git a/src/components/FontDialog/RNFontDialog.ts b/src/components/FontDialog/RNFontDialog.ts
index 19771a6e..3bf7f432 100644
--- a/src/components/FontDialog/RNFontDialog.ts
+++ b/src/components/FontDialog/RNFontDialog.ts
@@ -1,4 +1,4 @@
-import { FontDialogOption, NodeWidget, QFont, QFontDialog, QFontDialogSignals } from "@nodegui/nodegui";
+import { FontDialogOption, QWidget, QFont, QFontDialog, QFontDialogSignals } from "@nodegui/nodegui";
import { throwUnsupported } from "../../utils/helpers";
import { RNWidget } from "../config";
import { DialogProps, setDialogProps } from "../Dialog/RNDialog";
@@ -30,16 +30,16 @@ export class RNFontDialog extends QFontDialog implements RNWidget {
setProps(newProps: FontDialogProps, oldProps: FontDialogProps): void {
setFontDialogProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "font-dialog";
diff --git a/src/components/GridView/GridColumn/RNGridColumn.ts b/src/components/GridView/GridColumn/RNGridColumn.ts
index 234df6a7..0f5318fb 100644
--- a/src/components/GridView/GridColumn/RNGridColumn.ts
+++ b/src/components/GridView/GridColumn/RNGridColumn.ts
@@ -1,5 +1,5 @@
import { FunctionComponentElement } from "react";
-import { Component, NodeWidget } from "@nodegui/nodegui";
+import { Component, QWidget } from "@nodegui/nodegui";
import { RNComponent } from "../../config";
import { RNGridRow } from "../GridRow/RNGridRow";
@@ -18,8 +18,8 @@ const setGridColumnProps = (
) => {
if (widget.actualWidget) {
// TODO: Optimize this
- parentRow.parentGrid?.layout?.removeWidget(widget.actualWidget);
- parentRow.parentGrid?.layout?.addWidget(
+ parentRow.parentGrid?.layout()?.removeWidget(widget.actualWidget);
+ parentRow.parentGrid?.layout()?.addWidget(
widget.actualWidget,
parentRow.rowIndex ?? 0,
widget.columnIndex ?? 0,
@@ -38,7 +38,7 @@ const setGridColumnProps = (
export class RNGridColumn extends Component implements RNComponent {
native: any;
- actualWidget?: NodeWidget;
+ actualWidget?: QWidget;
parentRow?: RNGridRow;
latestProps?: GridColumnProps;
prevProps?: GridColumnProps;
@@ -61,7 +61,7 @@ export class RNGridColumn extends Component implements RNComponent {
return;
}
- this.parentRow?.parentGrid?.layout?.removeWidget(this.actualWidget);
+ this.parentRow?.parentGrid?.layout()?.removeWidget(this.actualWidget);
this.actualWidget.close();
this.actualWidget = undefined;
}
@@ -76,19 +76,19 @@ export class RNGridColumn extends Component implements RNComponent {
this.latestProps = newProps;
this.prevProps = oldProps;
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
if (this.actualWidget) {
throw new Error("Grid column can have only one child");
}
this.actualWidget = child;
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
this.appendInitialChild(child);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
this.appendInitialChild(child);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
this.remove();
}
static tagName: string = "gridcolumn";
diff --git a/src/components/GridView/GridColumn/index.ts b/src/components/GridView/GridColumn/index.ts
index 132e9250..74b1a613 100644
--- a/src/components/GridView/GridColumn/index.ts
+++ b/src/components/GridView/GridColumn/index.ts
@@ -14,7 +14,7 @@ class GridColumnConfig extends ComponentConfig {
context: any,
workInProgress: Fiber
): RNGridColumn {
- const widget = new RNGridColumn();
+ const widget = new RNGridColumn(null!);
widget.setProps(newProps, newProps);
return widget;
}
diff --git a/src/components/GridView/GridRow/index.ts b/src/components/GridView/GridRow/index.ts
index bcd12a05..94b69dec 100644
--- a/src/components/GridView/GridRow/index.ts
+++ b/src/components/GridView/GridRow/index.ts
@@ -14,7 +14,7 @@ class GridRowConfig extends ComponentConfig {
context: any,
workInProgress: Fiber
): RNGridRow {
- const widget = new RNGridRow();
+ const widget = new RNGridRow(null!);
widget.setProps(newProps, newProps);
return widget;
}
diff --git a/src/components/GridView/RNGridView.ts b/src/components/GridView/RNGridView.ts
index 0483fa92..edb707ee 100644
--- a/src/components/GridView/RNGridView.ts
+++ b/src/components/GridView/RNGridView.ts
@@ -1,5 +1,5 @@
import { FunctionComponentElement } from "react";
-import { QGridLayoutSignals, QGridLayout, QWidget } from "@nodegui/nodegui";
+import { QGridLayoutSignals, QGridLayout, QWidget, QLayout, QObjectSignals } from "@nodegui/nodegui";
import { ViewProps, setViewProps } from "../View/RNView";
import { RNComponent } from "../config";
import { RNGridRow, GridRowProps } from "./GridRow/RNGridRow";
@@ -42,18 +42,18 @@ const setGridViewProps = (
) => {
const setter: Omit = {
set horizontalSpacing(spacing: number) {
- widget.layout?.setHorizontalSpacing(spacing);
+ widget.layout()?.setHorizontalSpacing(spacing);
},
set verticalSpacing(spacing: number) {
- widget.layout?.setVerticalSpacing(spacing);
+ widget.layout()?.setVerticalSpacing(spacing);
},
set columnProps(props: GridViewColumnProps) {
for (const indexString of Object.keys(props)) {
const index = parseInt(indexString, 10);
const { stretch, minWidth } = props[index];
- widget.layout?.setColumnStretch(index, stretch ?? 0);
- widget.layout?.setColumnMinimumWidth(index, minWidth ?? 0);
+ widget.layout()?.setColumnStretch(index, stretch ?? 0);
+ widget.layout()?.setColumnMinimumWidth(index, minWidth ?? 0);
}
},
set rowProps(props: GridViewRowProps) {
@@ -61,8 +61,8 @@ const setGridViewProps = (
const index = parseInt(indexString, 10);
const { stretch, minHeight } = props[index];
- widget.layout?.setRowStretch(index, stretch ?? 0);
- widget.layout?.setRowMinimumHeight(index, minHeight ?? 0);
+ widget.layout()?.setRowStretch(index, stretch ?? 0);
+ widget.layout()?.setRowMinimumHeight(index, minHeight ?? 0);
}
},
};
@@ -75,16 +75,15 @@ const setGridViewProps = (
*/
export class RNGridView extends QWidget implements RNComponent {
native: any;
- _layout?: QGridLayout;
initialProps?: GridViewProps;
childRows: Array> = [];
- get layout() {
- return this._layout;
+ layout(): QGridLayout | null {
+ return super.layout() as any;
}
- set layout(l: QGridLayout | undefined) {
- this._layout = l;
+ setLayout(layout: QGridLayout): void {
+ super.setLayout(layout);
}
updateChildren(startIndex = 0): void {
@@ -100,7 +99,7 @@ export class RNGridView extends QWidget implements RNComponent {
/* RNComponent */
setProps(newProps: GridViewProps, oldProps: GridViewProps): void {
- if (this.layout) {
+ if (this.layout()) {
setGridViewProps(this, newProps, oldProps);
} else {
this.initialProps = newProps;
@@ -129,7 +128,7 @@ export class RNGridView extends QWidget implements RNComponent {
});
};
- if (this.layout) {
+ if (this.layout()) {
updateChild();
return;
@@ -137,7 +136,6 @@ export class RNGridView extends QWidget implements RNComponent {
const layout = new QGridLayout();
this.setLayout(layout);
- this.layout = layout;
// Newly created layout, so set initial props
if (this.initialProps) {
diff --git a/src/components/Image/RNImage.ts b/src/components/Image/RNImage.ts
index af000d94..1c66b6b9 100644
--- a/src/components/Image/RNImage.ts
+++ b/src/components/Image/RNImage.ts
@@ -2,7 +2,7 @@ import {
QLabel,
QPixmap,
AspectRatioMode,
- NodeWidget,
+ QWidget,
QSize,
TransformationMode,
} from "@nodegui/nodegui";
@@ -77,16 +77,16 @@ export class RNImage extends QLabel implements RNWidget {
setProps(newProps: ImageProps, oldProps: ImageProps): void {
setImageProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "image";
diff --git a/src/components/InputDialog/RNInputDialog.ts b/src/components/InputDialog/RNInputDialog.ts
index 3c0be4a1..113eda90 100644
--- a/src/components/InputDialog/RNInputDialog.ts
+++ b/src/components/InputDialog/RNInputDialog.ts
@@ -1,4 +1,4 @@
-import { EchoMode, InputDialogOptions, InputMode, NodeWidget, QInputDialog, QInputDialogSignals } from "@nodegui/nodegui";
+import { EchoMode, InputDialogOptions, InputMode, QWidget, QInputDialog, QInputDialogSignals } from "@nodegui/nodegui";
import { throwUnsupported } from "../../utils/helpers";
import { RNWidget } from "../config";
import { DialogProps, setDialogProps } from "../Dialog/RNDialog";
@@ -85,16 +85,16 @@ export class RNInputDialog extends QInputDialog implements RNWidget {
setProps(newProps: InputDialogProps, oldProps: InputDialogProps): void {
setInputDialogProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "input-dialog";
diff --git a/src/components/LineEdit/RNLineEdit.ts b/src/components/LineEdit/RNLineEdit.ts
index 5f165a6e..2a6eca10 100644
--- a/src/components/LineEdit/RNLineEdit.ts
+++ b/src/components/LineEdit/RNLineEdit.ts
@@ -1,7 +1,7 @@
import {
QLineEdit,
EchoMode,
- NodeWidget,
+ QWidget,
QLineEditSignals
} from "@nodegui/nodegui";
import { ViewProps, setViewProps } from "../View/RNView";
@@ -66,16 +66,16 @@ export class RNLineEdit extends QLineEdit implements RNWidget {
setProps(newProps: LineEditProps, oldProps: LineEditProps): void {
setLineEditProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "linedit";
diff --git a/src/components/List/RNList.ts b/src/components/List/RNList.ts
index 86c4bd6a..f5a5a11a 100644
--- a/src/components/List/RNList.ts
+++ b/src/components/List/RNList.ts
@@ -36,7 +36,7 @@ export class RNList extends QListWidget implements RNComponent {
this.appendChild(child);
}
appendChild(child: RNListItem): void {
- if (!this.layout) {
+ if (!this.layout()) {
this.setLayout(new FlexLayout());
}
diff --git a/src/components/ListItem/RNListItem.ts b/src/components/ListItem/RNListItem.ts
index 148385f0..b8444c47 100644
--- a/src/components/ListItem/RNListItem.ts
+++ b/src/components/ListItem/RNListItem.ts
@@ -1,4 +1,4 @@
-import { NodeWidget, QListWidgetItem, QIcon } from "@nodegui/nodegui";
+import { QWidget, QListWidgetItem, QIcon } from "@nodegui/nodegui";
import { RNComponent } from "../config";
export interface ListItemProps {
@@ -30,24 +30,24 @@ export const setListItemProps = (
*/
export class RNListItem extends QListWidgetItem implements RNComponent {
native: any;
- actualListItemWidget?: NodeWidget;
+ actualListItemWidget?: QWidget;
setProps(newProps: ListItemProps, oldProps: ListItemProps): void {
setListItemProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
if (this.actualListItemWidget) {
throw new Error("ListItem can have only one child");
}
this.actualListItemWidget = child;
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
this.appendInitialChild(child);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
this.appendInitialChild(child);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
if (child) {
child.close();
}
diff --git a/src/components/Menu/RNMenu.ts b/src/components/Menu/RNMenu.ts
index 68656942..704bedd7 100644
--- a/src/components/Menu/RNMenu.ts
+++ b/src/components/Menu/RNMenu.ts
@@ -1,4 +1,4 @@
-import { QMenu, QMenuSignals, Component, NodeWidget } from "@nodegui/nodegui";
+import { QMenu, QMenuSignals, Component, QWidget } from "@nodegui/nodegui";
import { RNWidget } from "../config";
import { throwUnsupported } from "../../utils/helpers";
import { RNAction } from "../Action/RNAction";
diff --git a/src/components/MenuBar/RNMenuBar.ts b/src/components/MenuBar/RNMenuBar.ts
index ca5acae3..1118a163 100644
--- a/src/components/MenuBar/RNMenuBar.ts
+++ b/src/components/MenuBar/RNMenuBar.ts
@@ -1,4 +1,4 @@
-import { NodeWidget, QMenu, QMenuBar, QMenuBarSignals } from "@nodegui/nodegui";
+import { QWidget, QMenu, QMenuBar, QMenuBarSignals } from "@nodegui/nodegui";
import { ViewProps, setViewProps } from "../View/RNView";
import { RNWidget } from "../config";
import { throwUnsupported } from "../../utils/helpers";
@@ -35,13 +35,13 @@ export class RNMenuBar extends QMenuBar implements RNWidget {
appendChild(child: QMenu): void {
this.appendInitialChild(child);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
console.warn(
"Updating menubar is not yet supported. Please help by raising a PR"
);
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
console.warn(
"Updating menubar is not yet supported. Please help by raising a PR"
);
diff --git a/src/components/PlainTextEdit/RNPlainTextEdit.ts b/src/components/PlainTextEdit/RNPlainTextEdit.ts
index 72d26db2..1bb4af09 100644
--- a/src/components/PlainTextEdit/RNPlainTextEdit.ts
+++ b/src/components/PlainTextEdit/RNPlainTextEdit.ts
@@ -1,6 +1,6 @@
import {
QPlainTextEdit,
- NodeWidget,
+ QWidget,
QPlainTextEditSignals
} from "@nodegui/nodegui";
import { ViewProps, setViewProps } from "../View/RNView";
@@ -66,16 +66,16 @@ export class RNPlainTextEdit extends QPlainTextEdit implements RNWidget {
setProps(newProps: PlainTextEditProps, oldProps: PlainTextEditProps): void {
setPlainTextEditProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "plaintextedit";
diff --git a/src/components/ProgressBar/RNProgressBar.ts b/src/components/ProgressBar/RNProgressBar.ts
index 91e0c378..0096d5f7 100644
--- a/src/components/ProgressBar/RNProgressBar.ts
+++ b/src/components/ProgressBar/RNProgressBar.ts
@@ -1,7 +1,7 @@
import {
QProgressBar,
Orientation,
- NodeWidget,
+ QWidget,
QProgressBarSignals
} from "@nodegui/nodegui";
import { ViewProps, setViewProps } from "../View/RNView";
@@ -62,16 +62,16 @@ export class RNProgressBar extends QProgressBar implements RNWidget {
setProps(newProps: ProgressBarProps, oldProps: ProgressBarProps): void {
setProgressBarProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "progressbar";
diff --git a/src/components/ProgressDialog/RNProgressDialog.ts b/src/components/ProgressDialog/RNProgressDialog.ts
index 94c000c7..448eaedb 100644
--- a/src/components/ProgressDialog/RNProgressDialog.ts
+++ b/src/components/ProgressDialog/RNProgressDialog.ts
@@ -1,4 +1,4 @@
-import { NodeWidget, QProgressDialog, QProgressDialogSignals } from "@nodegui/nodegui";
+import { QWidget, QProgressDialog, QProgressDialogSignals } from "@nodegui/nodegui";
import { throwUnsupported } from "../../utils/helpers";
import { RNWidget } from "../config";
import { DialogProps, setDialogProps } from "../Dialog/RNDialog";
@@ -72,16 +72,16 @@ export class RNProgressDialog extends QProgressDialog implements RNWidget {
setProps(newProps: ProgressDialogProps, oldProps: ProgressDialogProps): void {
setProgressDialogProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "progress-dialog";
diff --git a/src/components/RadioButton/RNRadioButton.ts b/src/components/RadioButton/RNRadioButton.ts
index ee137dbc..415b3ec0 100644
--- a/src/components/RadioButton/RNRadioButton.ts
+++ b/src/components/RadioButton/RNRadioButton.ts
@@ -1,6 +1,6 @@
import {
QRadioButton,
- NodeWidget,
+ QWidget,
QRadioButtonSignals
} from "@nodegui/nodegui";
import { RNWidget } from "../config";
@@ -34,16 +34,16 @@ export class RNRadioButton extends QRadioButton implements RNWidget {
setProps(newProps: RadioButtonProps, oldProps: RadioButtonProps): void {
setRadioButtonProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
static tagName = "radiobutton";
diff --git a/src/components/ScrollArea/RNScrollArea.ts b/src/components/ScrollArea/RNScrollArea.ts
index 0f9a8b78..2cd82f29 100644
--- a/src/components/ScrollArea/RNScrollArea.ts
+++ b/src/components/ScrollArea/RNScrollArea.ts
@@ -1,4 +1,4 @@
-import { QScrollArea, NodeWidget, QScrollAreaSignals } from "@nodegui/nodegui";
+import { QScrollArea, QWidget, QScrollAreaSignals } from "@nodegui/nodegui";
import { ViewProps, setViewProps } from "../View/RNView";
import { RNWidget } from "../config";
@@ -27,24 +27,24 @@ export class RNScrollArea extends QScrollArea implements RNWidget {
setProps(newProps: ScrollAreaProps, oldProps: ScrollAreaProps): void {
setScrollAreaProps(this, newProps, oldProps);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
const removedChild = this.takeWidget();
if (removedChild) {
removedChild.close();
}
child.close();
}
- appendInitialChild(child: NodeWidget): void {
- if (this.contentWidget) {
+ appendInitialChild(child: QWidget): void {
+ if (this.widget()) {
console.warn("ScrollView can't have more than one child node");
return;
}
this.setWidget(child);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
this.appendInitialChild(child);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
this.appendInitialChild(child);
}
static tagName = "scrollarea";
diff --git a/src/components/Slider/RNSlider.ts b/src/components/Slider/RNSlider.ts
index 7b1b5ca4..500a165d 100644
--- a/src/components/Slider/RNSlider.ts
+++ b/src/components/Slider/RNSlider.ts
@@ -1,4 +1,4 @@
-import { QSlider, NodeWidget, QSliderSignals, TickPosition, Orientation } from '@nodegui/nodegui';
+import { QSlider, QWidget, QSliderSignals, TickPosition, Orientation } from '@nodegui/nodegui';
import { setViewProps, ViewProps } from '../View/RNView';
import { RNWidget } from '../config';
import { throwUnsupported } from '../../utils/helpers';
@@ -77,19 +77,19 @@ export class RNSlider extends QSlider implements RNWidget {
setSliderProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget): void {
+ removeChild(child: QWidget): void {
throwUnsupported(this);
}
diff --git a/src/components/SpinBox/RNSpinBox.ts b/src/components/SpinBox/RNSpinBox.ts
index e546bfb7..68fcf2b4 100644
--- a/src/components/SpinBox/RNSpinBox.ts
+++ b/src/components/SpinBox/RNSpinBox.ts
@@ -1,4 +1,4 @@
-import { QSpinBox, NodeWidget, QSpinBoxSignals } from "@nodegui/nodegui";
+import { QSpinBox, QWidget, QSpinBoxSignals } from "@nodegui/nodegui";
import { ViewProps, setViewProps } from "../View/RNView";
import { RNWidget } from "../config";
import { throwUnsupported } from "../../utils/helpers";
@@ -67,16 +67,16 @@ export class RNSpinBox extends QSpinBox implements RNWidget {
setProps(newProps: SpinBoxProps, oldProps: SpinBoxProps): void {
setSpinBoxProps(this, newProps, oldProps);
}
- appendInitialChild(child: NodeWidget): void {
+ appendInitialChild(child: QWidget): void {
throwUnsupported(this);
}
- appendChild(child: NodeWidget): void {
+ appendChild(child: QWidget): void {
throwUnsupported(this);
}
- insertBefore(child: NodeWidget, beforeChild: NodeWidget): void {
+ insertBefore(child: QWidget, beforeChild: QWidget): void {
throwUnsupported(this);
}
- removeChild(child: NodeWidget