all: update layouts to use layout.Context

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-09-24 19:14:58 +02:00
parent ce9bcee62b
commit ec307008db
6 changed files with 116 additions and 119 deletions
+3 -2
View File
@@ -79,6 +79,7 @@ func (a *App) run() error {
a.ui.profiling = *stats
ops := new(ui.Ops)
var cfg app.Config
ctx := new(layout.Context)
for {
select {
case users := <-a.updateUsers:
@@ -128,8 +129,8 @@ func (a *App) run() error {
case app.UpdateEvent:
ops.Reset()
cfg = e.Config
cs := layout.RigidConstraints(e.Size)
a.ui.Layout(&cfg, a.w.Queue(), ops, cs)
ctx.Constraints = layout.RigidConstraints(e.Size)
a.ui.Layout(&cfg, a.w.Queue(), ops, ctx)
a.w.Update(ops)
}
}