We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d64c310 + 62a4aad commit d6f79f0Copy full SHA for d6f79f0
1 file changed
src/components/View/index.ts
@@ -6,10 +6,17 @@ import {
6
} from "@nodegui/nodegui";
7
import { registerComponent } from "../config";
8
9
+type Geometry = {
10
+ x: number;
11
+ y: number;
12
+ width: number;
13
+ height: number;
14
+};
15
export interface ListenerMap {
16
[key: string]: (payload?: any) => void;
17
}
18
export interface ViewProps {
19
+ geometry?: Geometry;
20
id?: string;
21
style?: string; // Inline style from NodeGui
22
styleSheet?: string;
@@ -29,6 +36,14 @@ export const setProps = (
29
36
oldProps: ViewProps
30
37
) => {
31
38
const setter: ViewProps = {
39
+ set geometry(geometry: Geometry) {
40
+ widget.setGeometry(
41
+ geometry.x,
42
+ geometry.y,
43
+ geometry.width,
44
+ geometry.height
45
+ );
46
+ },
32
47
set visible(shouldShow: boolean) {
33
48
shouldShow ? widget.show() : widget.hide();
34
49
},
0 commit comments