~eliasnaur/scatter

62deef42798566213304abbd954a2353d133c76e — Elias Naur 4 years ago 386ca2a
all: bump gio version

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

M cmd/scatter/ui.go
M go.mod
M go.sum
M cmd/scatter/ui.go => cmd/scatter/ui.go +29 -29
@@ 99,7 99,7 @@ type threadsPage struct {
	account *Account

	fab     *widget.Button
	fabIcon *material.Icon
	fabIcon *widget.Icon

	updates       <-chan struct{}
	threadUpdates chan []*Thread


@@ 167,8 167,8 @@ type ShowThreadEvent struct {
var theme *material.Theme

var iconLib struct {
	create *material.Icon
	send   *material.Icon
	create *widget.Icon
	send   *widget.Icon
}

func uiMain() {


@@ 189,8 189,8 @@ func uiMain() {
	app.Main()
}

func mustIcon(data []byte) *material.Icon {
	ico, err := material.NewIcon(data)
func mustIcon(data []byte) *widget.Icon {
	ico, err := widget.NewIcon(data)
	if err != nil {
		log.Fatal(err)
	}


@@ 425,7 425,7 @@ func (a *App) layoutTimings(gtx *layout.Context) {
		in.Top = unit.Max(gtx, unit.Dp(16), in.Top)
		in.Layout(gtx, func() {
			txt := fmt.Sprintf("m: %d %s", mallocs, a.profile.Timings)
			lbl := theme.Caption(txt)
			lbl := material.Caption(theme, txt)
			lbl.Font.Variant = "Mono"
			lbl.Layout(gtx)
		})


@@ 513,7 513,7 @@ func (p *contactsPage) Layout(gtx *layout.Context) {
	layout.Flex{Axis: layout.Vertical}.Layout(gtx,
		layout.Rigid(func() {
			p.topbar.Layout(gtx, p.env.insets, func() {
				e := theme.Editor("Email address")
				e := material.Editor(theme, "Email address")
				e.TextSize = unit.Sp(20)
				e.Color = rgb(0xffffff)
				e.HintColor = rgb(0xbbbbbb)


@@ 552,7 552,7 @@ func (p *contactsPage) contact(gtx *layout.Context, index int) {
				})
			}),
			layout.Flexed(1, func() {
				theme.H6(contact.Address).Layout(gtx)
				material.H6(theme, contact.Address).Layout(gtx)
			}),
		)
	})


@@ 614,10 614,10 @@ func newSignInPage(env *Env) *signInPage {
			Axis: layout.Vertical,
		},
		fields: []*formField{
			&formField{Header: "Email address", Hint: "you@example.org", Value: &acc.User},
			&formField{Header: "Password", Hint: "correct horse battery staple", Value: &acc.Password},
			&formField{Header: "IMAP host", Hint: "host:port", Value: &acc.IMAPHost},
			&formField{Header: "SMTP host", Hint: "host:port", Value: &acc.SMTPHost},
			{Header: "Email address", Hint: "you@example.org", Value: &acc.User},
			{Header: "Password", Hint: "correct horse battery staple", Value: &acc.Password},
			{Header: "IMAP host", Hint: "host:port", Value: &acc.IMAPHost},
			{Header: "SMTP host", Hint: "host:port", Value: &acc.SMTPHost},
		},
		submit: &widget.Button{},
	}


@@ 649,7 649,7 @@ func (p *signInPage) Layout(gtx *layout.Context) {
		layout.Rigid(func() {
			var t Topbar
			t.Layout(gtx, p.env.insets, func() {
				lbl := theme.H6("Sign in")
				lbl := material.H6(theme, "Sign in")
				lbl.Color = rgb(0xffffff)
				lbl.Layout(gtx)
			})


@@ 681,7 681,7 @@ func (p *signInPage) layoutSigninForm(gtx *layout.Context) {
			in.Bottom = unit.Max(gtx, unit.Dp(32), p.env.insets.Bottom)
			layout.E.Layout(gtx, func() {
				in.Layout(gtx, func() {
					theme.Button("Sign in").Layout(gtx, p.submit)
					material.Button(theme, "Sign in").Layout(gtx, p.submit)
				})
			})
		}


@@ 692,13 692,13 @@ func (f *formField) Layout(gtx *layout.Context) {
	layout.Flex{Axis: layout.Vertical}.Layout(gtx,
		layout.Rigid(func() {
			gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
			header := theme.Caption(f.Header)
			header := material.Caption(theme, f.Header)
			header.Font.Weight = text.Bold
			header.Layout(gtx)
			gtx.Dimensions.Size.Y += gtx.Px(unit.Dp(4))
		}),
		layout.Rigid(func() {
			theme.Editor(f.Hint).Layout(gtx, f.edit)
			material.Editor(theme, f.Hint).Layout(gtx, f.edit)
		}),
	)
}


@@ 802,7 802,7 @@ func (p *threadsPage) Layout(gtx *layout.Context) {
				layout.Rigid(func() {
					var t Topbar
					t.Layout(gtx, p.env.insets, func() {
						lbl := theme.H6(p.account.User)
						lbl := material.H6(theme, p.account.User)
						lbl.Color = rgb(0xffffff)
						lbl.Layout(gtx)
					})


@@ 819,7 819,7 @@ func (p *threadsPage) Layout(gtx *layout.Context) {
					Right:  unit.Max(gtx, unit.Dp(16), p.env.insets.Right),
					Bottom: unit.Max(gtx, unit.Dp(16), p.env.insets.Bottom),
				}.Layout(gtx, func() {
					theme.IconButton(iconLib.create).Layout(gtx, p.fab)
					material.IconButton(theme, iconLib.create).Layout(gtx, p.fab)
				})
			})
		}),


@@ 891,7 891,7 @@ func (p *threadsPage) thread(gtx *layout.Context, index int) {
										initial = string(unicode.ToUpper(c))
										break
									}
									lbl := theme.H5(initial)
									lbl := material.H5(theme, initial)
									lbl.Color = rgb(0xffffff)
									lbl.Layout(gtx)
								}),


@@ 904,7 904,7 @@ func (p *threadsPage) thread(gtx *layout.Context, index int) {
						layout.Rigid(func() {
							baseline().Layout(gtx,
								layout.Rigid(func() {
									lbl := theme.H6(t.ID)
									lbl := material.H6(theme, t.ID)
									lbl.Font.Weight = fontWeight
									lbl.Layout(gtx)
								}),


@@ 912,7 912,7 @@ func (p *threadsPage) thread(gtx *layout.Context, index int) {
									gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
									in := layout.Inset{Left: unit.Dp(2)}
									in.Layout(gtx, func() {
										lbl := theme.Caption(formatTime(t.Updated))
										lbl := material.Caption(theme, formatTime(t.Updated))
										lbl.Color = bgtexcol
										lbl.Alignment = text.End
										lbl.Font.Weight = fontWeight


@@ 924,7 924,7 @@ func (p *threadsPage) thread(gtx *layout.Context, index int) {
						layout.Rigid(func() {
							in := layout.Inset{Top: unit.Dp(6)}
							in.Layout(gtx, func() {
								lbl := theme.Body2(t.Snippet)
								lbl := material.Body2(theme, t.Snippet)
								lbl.Color = bgtexcol
								lbl.Font.Weight = fontWeight
								lbl.MaxLines = 1


@@ 1021,7 1021,7 @@ func (p *threadPage) Layout(gtx *layout.Context) {
	layout.Flex{Axis: layout.Vertical}.Layout(gtx,
		layout.Rigid(func() {
			p.topbar.Layout(gtx, p.env.insets, func() {
				lbl := theme.H6(p.thread.ID)
				lbl := material.H6(theme, p.thread.ID)
				lbl.Color = rgb(0xffffff)
				lbl.Layout(gtx)
			})


@@ 1044,11 1044,11 @@ func (p *threadPage) Layout(gtx *layout.Context) {
			in.Layout(gtx, func() {
				switch {
				case p.thread.PendingInvitation:
					theme.Button("Accept invitation").Layout(gtx, p.accept)
					material.Button(theme, "Accept invitation").Layout(gtx, p.accept)
				case p.env.client.ContainsSession(p.thread.ID):
					p.layoutMessageBox(gtx)
				default:
					theme.Button("Send invitation").Layout(gtx, p.invite)
					material.Button(theme, "Send invitation").Layout(gtx, p.invite)
				}
			})
		}),


@@ 1075,7 1075,7 @@ func (p *threadPage) layoutMessageBox(gtx *layout.Context) {
			bg.Layout(gtx, func() {
				layout.W.Layout(gtx, func() {
					gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
					ed := theme.Editor("Send a message")
					ed := material.Editor(theme, "Send a message")
					ed.TextSize = unit.Sp(14)
					ed.Layout(gtx, p.msgEdit)
				})


@@ 1084,7 1084,7 @@ func (p *threadPage) layoutMessageBox(gtx *layout.Context) {
		layout.Rigid(func() {
			in := layout.Inset{Left: unit.Dp(8)}
			in.Layout(gtx, func() {
				btn := theme.IconButton(iconLib.send)
				btn := material.IconButton(theme, iconLib.send)
				btn.Size = unit.Dp(48)
				btn.Padding = unit.Dp(12)
				btn.Layout(gtx, p.send)


@@ 1121,7 1121,7 @@ func (p *threadPage) message(gtx *layout.Context, index int) {
				var msgWidth int
				layout.Flex{Axis: layout.Vertical}.Layout(gtx,
					layout.Rigid(func() {
						lbl := theme.Body2(msg.Message)
						lbl := material.Body2(theme, msg.Message)
						lbl.Color = msgCol
						lbl.Layout(gtx)
						gtx.Dimensions.Size.Y += gtx.Px(unit.Dp(4))


@@ 1135,7 1135,7 @@ func (p *threadPage) message(gtx *layout.Context, index int) {
						var children []layout.FlexChild
						child := layout.Rigid(func() {
							time := formatTime(msg.Time)
							lbl := theme.Caption(time)
							lbl := material.Caption(theme, time)
							lbl.Color = timecol
							lbl.Layout(gtx)
						})

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

require (
	gioui.org v0.0.0-20200203225345-b8b8003a7a98
	gioui.org v0.0.0-20200503110655-d474b5b16a81
	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,6 1,6 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20200203225345-b8b8003a7a98 h1:oQS5xS67GXndgOkPReXvPpNTR0SnDqp1+ZDf2cd+evg=
gioui.org v0.0.0-20200203225345-b8b8003a7a98/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
gioui.org v0.0.0-20200503110655-d474b5b16a81 h1:7v3dtTlRk2A7j/iZnuVU8vyTpox1Ddtintk+C/cOW1w=
gioui.org v0.0.0-20200503110655-d474b5b16a81/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
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=