Skip to content

Commit ab8775f

Browse files
committed
Adds missing methods on view from qwidget
1 parent e2c54ed commit ab8775f

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/components/View/index.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { QWidget, NodeWidget } from "@nodegui/nodegui";
1+
import {
2+
QWidget,
3+
NodeWidget,
4+
WindowState,
5+
CursorShape,
6+
QCursor,
7+
QIcon
8+
} from "@nodegui/nodegui";
29
import { registerComponent } from "../config";
310

411
type Geometry = {
@@ -19,6 +26,10 @@ export interface ViewProps {
1926
mouseTracking?: boolean;
2027
enabled?: boolean;
2128
windowOpacity?: Number;
29+
windowTitle?: string;
30+
windowState?: WindowState;
31+
windowIcon?: QIcon;
32+
cursor?: CursorShape | QCursor;
2233
on?: ListenerMap;
2334
ref?: any;
2435
}
@@ -61,6 +72,18 @@ export const setProps = (
6172
set windowOpacity(opacity: Number) {
6273
widget.setWindowOpacity(opacity);
6374
},
75+
set windowTitle(title: string) {
76+
widget.setWindowTitle(title);
77+
},
78+
set windowState(state: WindowState) {
79+
widget.setWindowState(state);
80+
},
81+
set cursor(cursor: CursorShape | QCursor) {
82+
widget.setCursor(cursor);
83+
},
84+
set windowIcon(icon: QIcon) {
85+
widget.setWindowIcon(icon);
86+
},
6487
set on(listenerMap: ListenerMap) {
6588
const listenerMapLatest = Object.assign({}, listenerMap);
6689
const oldListenerMap = Object.assign({}, oldProps.on);

0 commit comments

Comments
 (0)