mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 00:45:35 +00:00
apps: replace separate layout state with layout.Context fields
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -77,9 +77,9 @@ func initProfiling() {
|
||||
|
||||
func (a *App) run() error {
|
||||
a.ui.profiling = *stats
|
||||
ops := new(ui.Ops)
|
||||
var cfg app.Config
|
||||
ctx := new(layout.Context)
|
||||
c := &layout.Context{
|
||||
Queue: a.w.Queue(),
|
||||
}
|
||||
for {
|
||||
select {
|
||||
case users := <-a.updateUsers:
|
||||
@@ -127,11 +127,9 @@ func (a *App) run() error {
|
||||
}
|
||||
}
|
||||
case app.UpdateEvent:
|
||||
ops.Reset()
|
||||
cfg = e.Config
|
||||
ctx.Constraints = layout.RigidConstraints(e.Size)
|
||||
a.ui.Layout(&cfg, a.w.Queue(), ops, ctx)
|
||||
a.w.Update(ops)
|
||||
c.Reset(&e.Config, layout.RigidConstraints(e.Size))
|
||||
a.ui.Layout(c)
|
||||
a.w.Update(c.Ops)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user