~eliasnaur/scatter

2dbfa0d23cf1b8c0f76e3dc16fcf49e5200567b3 — Elias Naur 1 year, 2 months ago 60352f0
cmd/scatter: update to new layout.Align

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 files changed, 13 insertions(+), 18 deletions(-)

M cmd/scatter/ui.go
M go.mod
M go.sum
M cmd/scatter/ui.go => cmd/scatter/ui.go +10 -15
@@ 448,8 448,7 @@ func (a *App) layoutTimings(c ui.Config, q input.Queue, ops *ui.Ops, ctx *layout
	runtime.ReadMemStats(&mstats)
	mallocs := mstats.Mallocs - a.lastMallocs
	a.lastMallocs = mstats.Mallocs
	al := layout.Align{Alignment: layout.NE}
	al.Layout(ops, ctx, func() {
	layout.Align(layout.NE).Layout(ops, ctx, func() {
		in := a.env.insets
		in.Top = ui.Max(c, ui.Dp(16), in.Top)
		in.Layout(c, ops, ctx, func() {


@@ 721,8 720,7 @@ func (p *signInPage) layoutSigninForm(c ui.Config, q input.Queue, ops *ui.Ops, c
			})
		default:
			in.Bottom = ui.Max(c, ui.Dp(32), p.env.insets.Bottom)
			align := layout.Align{Alignment: layout.E}
			align.Layout(ops, ctx, func() {
			layout.Align(layout.E).Layout(ops, ctx, func() {
				in.Layout(c, ops, ctx, func() {
					p.submit.Layout(c, p.env, ops, ctx)
				})


@@ 879,13 877,11 @@ func (p *threadsPage) Layout(c ui.Config, q input.Queue, ops *ui.Ops, ctx *layou
		f.Layout(c1, c2)
	})
	c2 := st.Rigid(func() {
		al := layout.Align{Alignment: layout.SE}
		in := layout.Inset{
			Right:  ui.Max(c, ui.Dp(16), p.env.insets.Right),
			Bottom: ui.Max(c, ui.Dp(16), p.env.insets.Bottom),
		}
		al.Layout(ops, ctx, func() {
			in.Layout(c, ops, ctx, func() {
		layout.Align(layout.SE).Layout(ops, ctx, func() {
			layout.Inset{
				Right:  ui.Max(c, ui.Dp(16), p.env.insets.Right),
				Bottom: ui.Max(c, ui.Dp(16), p.env.insets.Bottom),
			}.Layout(c, ops, ctx, func() {
				p.fab.Layout(c, p.env, ops, ctx)
			})
		})


@@ 1172,8 1168,7 @@ func (p *threadPage) layoutMessageBox(c ui.Config, q input.Queue, ops *ui.Ops, c
			Radius:   ui.Dp(10),
		}
		bg.Layout(c, ops, ctx, func() {
			align := layout.Align{Alignment: layout.W}
			align.Layout(ops, ctx, func() {
			layout.Align(layout.W).Layout(ops, ctx, func() {
				ctx.Constraints.Width.Min = ctx.Constraints.Width.Max
				p.msgEdit.Layout(c, q, ops, ctx)
			})


@@ 1185,13 1180,13 @@ func (p *threadPage) layoutMessageBox(c ui.Config, q input.Queue, ops *ui.Ops, c
func (p *threadPage) message(c ui.Config, ops *ui.Ops, ctx *layout.Context, index int) {
	msg := p.messages[index]
	in := layout.Inset{Top: ui.Dp(16), Left: ui.Dp(16), Right: ui.Dp(40)}
	align := layout.Align{Alignment: layout.W}
	align := layout.Align(layout.W)
	msgMat := colorMaterial(ops, rgb(0xffffff))
	bgcol := theme.brand
	timecol := argb(0xaaaaaaaa)
	if msg.Own {
		in.Left, in.Right = in.Right, in.Left
		align.Alignment = layout.E
		align = layout.Align(layout.E)
		bgcol = colorMaterial(ops, rgb(0xeeeeee))
		msgMat = theme.text
		timecol = rgb(0x888888)

M go.mod => go.mod +1 -1
@@ 3,7 3,7 @@ module scatter.im
go 1.13

require (
	gioui.org/ui v0.0.0-20190924171458-ec307008db58
	gioui.org/ui v0.0.0-20190924183532-b928ee65f7a2
	github.com/eliasnaur/libsignal-protocol-go v0.0.0-20190626062856-3295f72b181e
	github.com/emersion/go-imap v1.0.0-rc.1
	github.com/emersion/go-imap-idle v0.0.0-20190519112320-2704abd7050e

M go.sum => go.sum +2 -2
@@ 1,5 1,5 @@
gioui.org/ui v0.0.0-20190924171458-ec307008db58 h1:nNoxWhsj7N/cwdB5F1+yEfXAS3FN5piTrEOzv0DejHg=
gioui.org/ui v0.0.0-20190924171458-ec307008db58/go.mod h1:PssKPKlqVIeyaed+0w492Xc2NgX5M3n6oZKOAj5rxoE=
gioui.org/ui v0.0.0-20190924183532-b928ee65f7a2 h1:98ei56UOalfOxmm5R/On3CtpsbgDAvvhIrLyxnaApuY=
gioui.org/ui v0.0.0-20190924183532-b928ee65f7a2/go.mod h1:PssKPKlqVIeyaed+0w492Xc2NgX5M3n6oZKOAj5rxoE=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/RadicalApp/complete v0.0.0-20170329192659-17e6c0ee499b h1:cAULFohNVfNzco0flF4okSPg3s7/tCj+hMIldtYZo4c=
github.com/RadicalApp/complete v0.0.0-20170329192659-17e6c0ee499b/go.mod h1:zZ3+l0EkpT2ZPnoamPBG50PBUtQrXwwyJ6elQZMmqgk=