Fix tab invalidation bugs

This commit is contained in:
Drew DeVault 2018-06-11 20:13:02 -04:00
parent 6728a11fdf
commit dc90be24de
1 changed files with 5 additions and 1 deletions

View File

@ -43,7 +43,9 @@ func (tabs *Tabs) invalidateChild(d Drawable) {
for i, tab := range tabs.Tabs {
if tab.Content == d {
if i == tabs.Selected {
tabs.TabContent.Invalidate()
if tabs.onInvalidateContent != nil {
tabs.onInvalidateContent(tabs.TabContent)
}
}
return
}
@ -107,6 +109,8 @@ func (content *TabContent) Invalidate() {
if content.onInvalidateContent != nil {
content.onInvalidateContent(content)
}
tab := content.Tabs[content.Selected]
tab.Content.Invalidate()
}
func (content *TabContent) OnInvalidate(onInvalidate func(d Drawable)) {