mirror of https://github.com/buggins/dlangui.git
implement renaming of tabs
This commit is contained in:
parent
075708fae3
commit
40b267d6c2
|
@ -402,6 +402,20 @@ class TabControl : WidgetGroupDefaultDrawing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// change name and id of tab
|
||||||
|
void renameTab(int index, string id, dstring name) {
|
||||||
|
_items[index].text = name;
|
||||||
|
_items[index].id = id;
|
||||||
|
for (int i = 0; i < _children.count; i++) {
|
||||||
|
TabItemWidget widget = cast (TabItemWidget)_children[i];
|
||||||
|
if (widget && widget.item is _items[index]) {
|
||||||
|
widget.setItem(_items[index]);
|
||||||
|
requestLayout();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void onTabClose(string tabId) {
|
protected void onTabClose(string tabId) {
|
||||||
if (tabClose.assigned)
|
if (tabClose.assigned)
|
||||||
tabClose(tabId);
|
tabClose(tabId);
|
||||||
|
@ -779,6 +793,11 @@ class TabWidget : VerticalLayout, TabHandler, TabCloseHandler {
|
||||||
_tabControl.renameTab(index, name);
|
_tabControl.renameTab(index, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// change name of tab
|
||||||
|
void renameTab(int index, string id, dstring name) {
|
||||||
|
_tabControl.renameTab(index, id, name);
|
||||||
|
}
|
||||||
|
|
||||||
@property Visibility hiddenTabsVisibility() { return _tabHost.hiddenTabsVisibility; }
|
@property Visibility hiddenTabsVisibility() { return _tabHost.hiddenTabsVisibility; }
|
||||||
@property void hiddenTabsVisibility(Visibility v) { _tabHost.hiddenTabsVisibility = v; }
|
@property void hiddenTabsVisibility(Visibility v) { _tabHost.hiddenTabsVisibility = v; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue