@dark-engine/platform-desktop
Version:
Dark renderer to desktop platforms like Windows, Linux, macOS via Nodegui and Qt
43 lines (42 loc) • 1.16 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
exports.detectIsTabItem = exports.QDarkTabItem = exports.TabItem = void 0;
const nodegui_1 = require('@nodegui/nodegui');
const core_1 = require('@dark-engine/core');
const factory_1 = require('../factory');
const flex_layout_1 = require('./flex-layout');
const TabItem = (0, core_1.component)(props => (0, factory_1.qTabItem)(props), {
displayName: 'TabItem',
});
exports.TabItem = TabItem;
class QDarkTabItem extends flex_layout_1.QDarkFlexLayout {
tab = null;
text;
icon = new nodegui_1.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);
}
}
exports.QDarkTabItem = QDarkTabItem;
function detectIsTabItem(value) {
return value instanceof QDarkTabItem;
}
exports.detectIsTabItem = detectIsTabItem;
//# sourceMappingURL=tab-item.js.map