@dark-engine/platform-desktop
Version:
Dark renderer to desktop platforms like Windows, Linux, macOS via Nodegui and Qt
43 lines (42 loc) • 1.27 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
exports.QDarkGroupBox = exports.GroupBox = 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 GroupBox = (0, core_1.component)(props => (0, factory_1.qGroupBox)(props), {
displayName: 'GroupBox',
});
exports.GroupBox = GroupBox;
class QDarkGroupBox extends nodegui_1.QGroupBox {
boxLayout = new nodegui_1.QBoxLayout(nodegui_1.Direction.TopToBottom);
constructor() {
super();
this.setLayout(this.boxLayout);
}
detectIsContainer() {
return true;
}
getBoxLayout() {
return this.boxLayout;
}
setDirection(value) {
this.boxLayout.setDirection(value);
}
appendChild(child) {
if ((0, dialog_1.detectIsDialog)(child)) return;
this.boxLayout.addWidget(child);
}
insertBefore(child, _, idx) {
if ((0, dialog_1.detectIsDialog)(child)) return;
this.boxLayout.insertWidget(idx, child);
}
removeChild(child) {
if ((0, dialog_1.detectIsDialog)(child)) return;
this.boxLayout.removeWidget(child);
child.close();
}
}
exports.QDarkGroupBox = QDarkGroupBox;
//# sourceMappingURL=group-box.js.map