@dark-engine/platform-desktop
Version:
Dark renderer to desktop platforms like Windows, Linux, macOS via Nodegui and Qt
38 lines (37 loc) • 892 B
JavaScript
import { QIcon } from '@nodegui/nodegui';
import { component } from '@dark-engine/core';
import { qTabItem } from '../factory';
import { QDarkFlexLayout } from './flex-layout';
const TabItem = component(props => qTabItem(props), {
displayName: 'TabItem',
});
class QDarkTabItem extends QDarkFlexLayout {
tab = null;
text;
icon = new QIcon();
setTab(value) {
this.tab = value;
}
setText(value) {
this.text = value;
this.tab.setTabText(this.getIndex(), this.text);
}
getText() {
return this.text;
}
setIcon(value) {
this.icon = value;
this.tab.setTabIcon(this.getIndex(), this.icon);
}
getIcon() {
return this.icon;
}
getIndex() {
return this.tab.indexOf(this);
}
}
function detectIsTabItem(value) {
return value instanceof QDarkTabItem;
}
export { TabItem, QDarkTabItem, detectIsTabItem };
//# sourceMappingURL=tab-item.js.map