MCPcopy Index your code
hub / github.com/nodegui/react-nodegui / setViewProps

Function setViewProps

src/components/View/RNView.ts:120–212  ·  view source on GitHub ↗
(widget: QWidget<any>, newProps: ViewProps<Signals>, oldProps: ViewProps<Signals>)

Source from the content-addressed store, hash-verified

118 * @ignore
119 */
120export function setViewProps<Signals extends {}>(widget: QWidget<any>, newProps: ViewProps<Signals>, oldProps: ViewProps<Signals>) {
121 const setter: ViewProps<Signals> = {
122 set visible(shouldShow: boolean) {
123 shouldShow ? widget.show() : widget.hide();
124 },
125 set styleSheet(styleSheet: string) {
126 widget.setStyleSheet(styleSheet);
127 },
128 set style(inlineStyle: string) {
129 if (newProps.styleSheet) {
130 console.warn("Both styleSheet and inlineStyle can't be used together");
131 }
132 widget.setInlineStyle(inlineStyle);
133 },
134 set geometry(geometry: Geometry) {
135 widget.setGeometry(geometry.x, geometry.y, geometry.width, geometry.height);
136 },
137 set id(id: string) {
138 widget.setObjectName(id);
139 },
140 set mouseTracking(isMouseTracked: boolean) {
141 widget.setMouseTracking(isMouseTracked);
142 },
143 set enabled(enable: boolean) {
144 widget.setEnabled(enable);
145 },
146 set windowOpacity(opacity: number) {
147 widget.setWindowOpacity(opacity);
148 },
149 set windowTitle(title: string) {
150 widget.setWindowTitle(title);
151 },
152 set windowState(state: WindowState) {
153 widget.setWindowState(state);
154 },
155 set cursor(cursor: CursorShape | QCursor) {
156 widget.setCursor(cursor);
157 },
158 set windowIcon(icon: QIcon) {
159 widget.setWindowIcon(icon);
160 },
161 set minSize(size: Size) {
162 widget.setMinimumSize(size.width, size.height);
163 },
164 set maxSize(size: Size) {
165 widget.setMaximumSize(size.width, size.height);
166 },
167 set size(size: ViewSize) {
168 if (size.fixed) {
169 widget.setFixedSize(size.width, size.height);
170 } else {
171 const minSize = newProps.minSize || { width: 0, height: 0 };
172 const maxSize = newProps.maxSize || {
173 width: 16777215,
174 height: 16777215,
175 };
176 widget.setMinimumSize(minSize.width, minSize.height);
177 widget.setMaximumSize(maxSize.width, maxSize.height);

Callers 15

setListPropsFunction · 0.90
setTablePropsFunction · 0.90
setWindowPropsFunction · 0.90
setSliderPropsFunction · 0.90
setComboBoxPropsFunction · 0.90
setLineEditPropsFunction · 0.90
setMenuBarPropsFunction · 0.90
setDialPropsFunction · 0.90
setTextPropsFunction · 0.90
setSpinBoxPropsFunction · 0.90
setDialogPropsFunction · 0.90
setGridViewPropsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected