aboutsummaryrefslogtreecommitdiffstats
path: root/ui/account.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-01-10 22:54:55 -0500
committerDrew DeVault <sir@cmpwn.com>2018-01-10 22:54:55 -0500
commit55e84533022c1f9bf9fd9e2cd2db930394b590b8 (patch)
tree513ee239f641aa5154427776efa18fda752e642d /ui/account.go
parent77a0f68758905faa74407499ff92c90929e27989 (diff)
downloadaerc-55e84533022c1f9bf9fd9e2cd2db930394b590b8.tar.gz
Improve invalidation logic
Diffstat (limited to 'ui/account.go')
-rw-r--r--ui/account.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/ui/account.go b/ui/account.go
index 0949e524..9c16cc57 100644
--- a/ui/account.go
+++ b/ui/account.go
@@ -11,6 +11,8 @@ type AccountTab struct {
Config *config.AccountConfig
Worker *worker.Worker
Parent *UIState
+
+ counter int
}
func NewAccountTab(conf *config.AccountConfig, work *worker.Worker) *AccountTab {
@@ -24,10 +26,6 @@ func (acc *AccountTab) Name() string {
return acc.Config.Name
}
-func (acc *AccountTab) Invalid() bool {
- return false
-}
-
func (acc *AccountTab) SetParent(parent *UIState) {
acc.Parent = parent
}
@@ -37,5 +35,10 @@ func (acc *AccountTab) Render(at Geometry) {
Fg: tb.ColorDefault,
Bg: tb.ColorDefault,
}
- TPrintf(&at, cell, "%s", acc.Name())
+ TPrintf(&at, cell, "%s %d", acc.Name(), acc.counter)
+ acc.counter++
+ if acc.counter%10000 == 0 {
+ acc.counter = 0
+ }
+ acc.Parent.InvalidateFrom(acc)
}