UNPKG

@dark-engine/platform-desktop

Version:

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

75 lines (74 loc) 1.64 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports.detectIsGridItem = exports.QDarkGridItem = exports.GridItem = void 0; const nodegui_1 = require('@nodegui/nodegui'); const core_1 = require('@dark-engine/core'); const factory_1 = require('../factory'); const utils_1 = require('../utils'); const GridItem = (0, core_1.component)(props => (0, factory_1.qGridItem)(props), { displayName: 'GridItem', }); exports.GridItem = GridItem; class QDarkGridItem extends nodegui_1.QWidget { child = null; row; col; rowSpan; colSpan; alignment; detectIsContainer() { return true; } getChild() { return this.child; } setRow(value) { this.row = value; } getRow() { return this.row; } setCol(value) { this.col = value; } getCol() { return this.col; } setRowSpan(value) { this.rowSpan = value; } getRowSpan() { return this.rowSpan; } setColSpan(value) { this.colSpan = value; } getColSpan() { return this.colSpan; } setAlignment(value) { this.alignment = value; } getAlignment() { return this.alignment; } appendChild(child) { if (this.child) { console.warn(`GridItem can't have more than one child node`); (0, utils_1.throwUnsupported)(this); } this.child = child; } insertBefore() { (0, utils_1.throwUnsupported)(this); } removeChild() { this.child = null; } } exports.QDarkGridItem = QDarkGridItem; function detectIsGridItem(value) { return value instanceof QDarkGridItem; } exports.detectIsGridItem = detectIsGridItem; //# sourceMappingURL=grid-item.js.map