UNPKG

@dark-engine/platform-desktop

Version:

Dark renderer to desktop platforms like Windows, Linux, macOS via Nodegui and Qt

41 lines (40 loc) 1.26 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports.QDarkFlexLayout = exports.FlexLayout = void 0; const nodegui_1 = require('@nodegui/nodegui'); const core_1 = require('@dark-engine/core'); const factory_1 = require('../factory'); const dialog_1 = require('./dialog'); const FlexLayout = (0, core_1.component)(props => (0, factory_1.qFlexLayout)(props), { displayName: 'FlexLayout', }); exports.FlexLayout = FlexLayout; class QDarkFlexLayout extends nodegui_1.QWidget { flexLayout = new nodegui_1.FlexLayout(); constructor() { super(); this.flexLayout.setFlexNode(this.getFlexNode()); this.setLayout(this.flexLayout); } detectIsContainer() { return true; } getFlexLayout() { return this.flexLayout; } appendChild(child) { if ((0, dialog_1.detectIsDialog)(child)) return; this.flexLayout.addWidget(child); } insertBefore(child, sibling) { if ((0, dialog_1.detectIsDialog)(child)) return; this.flexLayout.insertChildBefore(child, sibling); } removeChild(child) { if ((0, dialog_1.detectIsDialog)(child)) return; this.flexLayout.removeWidget(child); child.close(); } } exports.QDarkFlexLayout = QDarkFlexLayout; //# sourceMappingURL=flex-layout.js.map