mirror of https://github.com/buggins/dlangui.git
fix double drawing of tab header - fix #190
This commit is contained in:
parent
cb51dc04b1
commit
9d86705a55
|
|
@ -521,24 +521,26 @@ class TabControl : WidgetGroupDefaultDrawing {
|
||||||
override void onDraw(DrawBuf buf) {
|
override void onDraw(DrawBuf buf) {
|
||||||
if (visibility != Visibility.Visible)
|
if (visibility != Visibility.Visible)
|
||||||
return;
|
return;
|
||||||
super.onDraw(buf);
|
super.Widget.onDraw(buf);
|
||||||
Rect rc = _pos;
|
Rect rc = _pos;
|
||||||
applyMargins(rc);
|
applyMargins(rc);
|
||||||
applyPadding(rc);
|
applyPadding(rc);
|
||||||
auto saver = ClipRectSaver(buf, rc);
|
auto saver = ClipRectSaver(buf, rc);
|
||||||
|
// draw all items except selected
|
||||||
for (int i = _children.count - 1; i >= 0; i--) {
|
for (int i = _children.count - 1; i >= 0; i--) {
|
||||||
Widget item = _children.get(i);
|
Widget item = _children.get(i);
|
||||||
if (item.visibility != Visibility.Visible)
|
if (item.visibility != Visibility.Visible)
|
||||||
continue;
|
continue;
|
||||||
if (item.id.equal(_selectedTabId))
|
if (item.id.equal(_selectedTabId)) // skip selected
|
||||||
continue;
|
continue;
|
||||||
item.onDraw(buf);
|
item.onDraw(buf);
|
||||||
}
|
}
|
||||||
|
// draw selected item
|
||||||
for (int i = 0; i < _children.count; i++) {
|
for (int i = 0; i < _children.count; i++) {
|
||||||
Widget item = _children.get(i);
|
Widget item = _children.get(i);
|
||||||
if (item.visibility != Visibility.Visible)
|
if (item.visibility != Visibility.Visible)
|
||||||
continue;
|
continue;
|
||||||
if (!item.id.equal(_selectedTabId))
|
if (!item.id.equal(_selectedTabId)) // skip all except selected
|
||||||
continue;
|
continue;
|
||||||
item.onDraw(buf);
|
item.onDraw(buf);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue