UNPKG

@dark-engine/platform-desktop

Version:

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

33 lines (32 loc) 853 B
import { QMenuBar } from '@nodegui/nodegui'; import { component } from '@dark-engine/core'; import { qMenuBar } from '../factory'; import { QDarkMenu } from './menu'; import { throwUnsupported } from '../utils'; const MenuBar = component(props => qMenuBar(props), { displayName: 'MenuBar', }); class QDarkMenuBar extends QMenuBar { detectIsContainer() { return true; } appendChild(child) { if (child instanceof QDarkMenu) { this.addMenu(child); } else { console.warn('MenuBar supports only Menu as its children'); throwUnsupported(this); } } insertBefore() { throwUnsupported(this); } removeChild() { throwUnsupported(this); } } function detectIsMenuBar(value) { return value instanceof QDarkMenuBar; } export { MenuBar, QDarkMenuBar, detectIsMenuBar }; //# sourceMappingURL=menu-bar.js.map