-
-
Notifications
You must be signed in to change notification settings - Fork 308
Closed
Description
Describe the bug
In attempting to determine the source of nodegui/react-nodegui#162 (comment), I rebuilt roughly the same widget structure that nodegui-react
should have produced, seen below. This structure displays indeterminate sizing when modifying bits of the layout, just as in the React example.
To Reproduce
import { QMainWindow, QWidget } from '.';
import { QPushButton } from './lib/QtWidgets/QPushButton';
import { FlexLayout } from './lib/core/FlexLayout';
const win = new QMainWindow();
win.resize(500, 500);
const outer = new QWidget();
const outerLayout = new FlexLayout();
outerLayout.setFlexNode(outer.getFlexNode());
outer.setLayout(outerLayout);
const inner = new QWidget();
outerLayout.addWidget(inner);
const innerLayout = new FlexLayout();
innerLayout.setFlexNode(inner.getFlexNode());
inner.setLayout(innerLayout);
const button = new QPushButton();
button.setText('Toggle On');
button.addEventListener('clicked', () => {
button.setText(button.text() === 'Toggle On' ? 'Toggle Off' : 'Toggle On');
});
innerLayout.addWidget(button);
const centralWidget = new QWidget();
const centralLayout = new FlexLayout();
centralLayout.setFlexNode(centralWidget.getFlexNode());
centralLayout.addWidget(outer);
centralWidget.setLayout(centralLayout);
win.setCentralWidget(centralWidget);
win.show();
(global as any).win = win;
Expected behavior
The layout should not vary when modifying non-layout properties of widgets.
Desktop (please complete the following information):
- OS: macOS 10.15.5
- NodeGUI version: Latest
master
(0.21.0+)
jozanza, coke12103, Eeems and wkirby
Metadata
Metadata
Assignees
Labels
No labels