UNPKG

@dark-engine/platform-desktop

Version:

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

70 lines (69 loc) 1.36 kB
import { QWidget } from '@nodegui/nodegui'; import { component } from '@dark-engine/core'; import { qGridItem } from '../factory'; import { throwUnsupported } from '../utils'; const GridItem = component(props => qGridItem(props), { displayName: 'GridItem', }); class QDarkGridItem extends 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`); throwUnsupported(this); } this.child = child; } insertBefore() { throwUnsupported(this); } removeChild() { this.child = null; } } function detectIsGridItem(value) { return value instanceof QDarkGridItem; } export { GridItem, QDarkGridItem, detectIsGridItem }; //# sourceMappingURL=grid-item.js.map