~f4814n/frost

fd8e3b5466568cc4d4402f99a117a4a2e43ba33a — Fabian Geiselhart 3 months ago f24bed8
Bump gioui.org and gioui.org/x versions
M cmd/frost/app.go => cmd/frost/app.go +11 -11
@@ 25,7 25,7 @@ import (
	"git.sr.ht/~f4814n/frost/view/roomlist"
	fwidget "git.sr.ht/~f4814n/frost/widget"
	"git.sr.ht/~f4814n/matrix"
	"git.sr.ht/~whereswaldon/materials"
	"gioui.org/x/component"
	"go.uber.org/zap"
)



@@ 59,7 59,7 @@ type App struct {

	currentRoom matrix.Room

	bar            *materials.AppBar
	bar            *component.AppBar
	userListButton *widget.Clickable

	// On a widescreen desktop the layout is split into three columns.


@@ 71,8 71,8 @@ type App struct {

	format format

	modalLayer *materials.ModalLayer
	drawer     *materials.ModalNavDrawer
	modalLayer *component.ModalLayer
	drawer     *component.ModalNavDrawer
	theme      *material.Theme
}



@@ 102,15 102,15 @@ func newApp() *App {
		),
		platform:       platform,
		logger:         logger.Named("frost"),
		modalLayer:     materials.NewModal(),
		modalLayer:     component.NewModal(),
		theme:          material.NewTheme(gofont.Collection()),
		userListButton: new(widget.Clickable),
	}

	a.bar = materials.NewAppBar(a.modalLayer)
	a.bar = component.NewAppBar(a.modalLayer)
	a.bar.Title = "Frost"

	a.drawer = materials.NewModalNav(a.modalLayer, "Frost", "Here be dragons")
	a.drawer = component.NewModalNav(a.modalLayer, "Frost", "Here be dragons")

	a.cache = cache.New(a.cli, platform.Cache(), a.logger.Named("component.cache"))
	a.sync = sync.New(a.cli, a.logger.Named("component.sync"))


@@ 237,7 237,7 @@ func (a *App) back() {
func (a *App) update(gtx g) {
	for _, event := range a.bar.Events(gtx) {
		switch event.(type) {
		case materials.AppBarNavigationClicked:
		case component.AppBarNavigationClicked:
			if a.format == small && a.views[1].View != nil ||
				a.format == medium && a.views[2].View != nil {
				a.back()


@@ 277,12 277,12 @@ func (a *App) update(gtx g) {

func (a *App) updateBar(f format) {
	if a.views[1].View != nil && a.views[2].View == nil {
		a.bar.SetActions([]materials.AppBarAction{
			materials.SimpleIconAction(
		a.bar.SetActions([]component.AppBarAction{
			component.SimpleIconAction(
				a.theme,
				a.userListButton,
				util.MustIcon(icons.ActionViewList),
				materials.OverflowAction{
				component.OverflowAction{
					Name: "View room members",
					Tag:  a.userListButton,
				},

M go.mod => go.mod +3 -3
@@ 3,12 3,12 @@ module git.sr.ht/~f4814n/frost
go 1.14

require (
	gioui.org v0.0.0-20201224113856-0416fffc096b
	gioui.org v0.0.0-20210116085804-99bfa6a33cdf
	gioui.org/cmd v0.0.0-20201020094634-d5bdf0756a5a
	gioui.org/x v0.0.0-20210116203642-b812805638ca
	git.sr.ht/~f4814n/matrix v0.0.0-20210109173214-a4eb7ce0da5c
	git.sr.ht/~whereswaldon/materials v0.0.0-20201220015048-3f4fb49d1fd9
	go.uber.org/zap v1.16.0
	golang.org/x/exp v0.0.0-20201203231725-fa01524bc59d
	golang.org/x/exp v0.0.0-20201229011636-eab1b5eb1a03
	golang.org/x/image v0.0.0-20200927104501-e162460cd6b5
	golang.org/x/mod v0.4.0 // indirect
	golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect

M go.sum => go.sum +14 -11
@@ 1,16 1,14 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20200726090130-3b95e2918359/go.mod h1:jiUwifN9cRl/zmco43aAqh0aV+s9GbhG13KcD+gEpkU=
gioui.org v0.0.0-20201219144351-00c4a53036ad/go.mod h1:Y+uS7hHMvku1Q+ooaoq6fYD5B2LGoT8JtFgvmYmRzTw=
gioui.org v0.0.0-20201224113856-0416fffc096b h1:S5tOnnkKUhmtF9cuCtD4IAVPXPItqpPIUQBISIQ60Uo=
gioui.org v0.0.0-20201224113856-0416fffc096b/go.mod h1:Y+uS7hHMvku1Q+ooaoq6fYD5B2LGoT8JtFgvmYmRzTw=
gioui.org v0.0.0-20210116085804-99bfa6a33cdf h1:BPm0FHRKpTbpoe4DY2vKIVzWWni+IHvmltECoYRUYWk=
gioui.org v0.0.0-20210116085804-99bfa6a33cdf/go.mod h1:Y+uS7hHMvku1Q+ooaoq6fYD5B2LGoT8JtFgvmYmRzTw=
gioui.org/cmd v0.0.0-20201020094634-d5bdf0756a5a h1:BPgJqeQSxuX6CzFQ2EGDj4Kr2ZzwiqwdLyAYLXgxR+k=
gioui.org/cmd v0.0.0-20201020094634-d5bdf0756a5a/go.mod h1:dlmJnCEkOpRaChYxRmJZ5S4jk6y7DCfWnec39xGbUYk=
git.sr.ht/~f4814n/matrix v0.0.0-20201218143803-770e10bd6252 h1:82PU+gyoqJQWqdCZ5aefQ0YtIbcTlpCGQ1366UEChpc=
git.sr.ht/~f4814n/matrix v0.0.0-20201218143803-770e10bd6252/go.mod h1:yR3YNkJR8S3qLkGh178oKRm3MnsT5cERNEXOF8eFOIo=
gioui.org/x v0.0.0-20210116203642-b812805638ca h1:nkUukjo7RjLu9L3HYHE/r/mtCi1svCi6b+c30jLq9BQ=
gioui.org/x v0.0.0-20210116203642-b812805638ca/go.mod h1:+CDNGkslHDIe1EK2Q4E0G98qRllCaQrL6qtjBhBjSAo=
git.sr.ht/~f4814n/matrix v0.0.0-20210109173214-a4eb7ce0da5c h1:ViWW5NnBmVHdRrHzgXcZxDtyDHvPzv61HdivQ2z39W4=
git.sr.ht/~f4814n/matrix v0.0.0-20210109173214-a4eb7ce0da5c/go.mod h1:yR3YNkJR8S3qLkGh178oKRm3MnsT5cERNEXOF8eFOIo=
git.sr.ht/~whereswaldon/materials v0.0.0-20201220015048-3f4fb49d1fd9 h1:rb+UW4XloZFJvW022LJ++VyDRilIAcgEJbBLX3xtXd4=
git.sr.ht/~whereswaldon/materials v0.0.0-20201220015048-3f4fb49d1fd9/go.mod h1:evzscth58GGa3fzjGHmL2aR//0YLi52UfgfyTGFpMCM=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=


@@ 81,9 79,10 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4=
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE=
golang.org/x/exp v0.0.0-20201203231725-fa01524bc59d h1:FscZqdyN/qhN9in1p2FLXl6vsrWY792O5bak6GHqVs0=
golang.org/x/exp v0.0.0-20201203231725-fa01524bc59d/go.mod h1:1phAWC201xIgDyaFpmDeZkgf70Q4Pd/CNqfRtVPtxNw=
golang.org/x/exp v0.0.0-20201229011636-eab1b5eb1a03 h1:XlAInxBYX5nBofPaY51uv/x9xmRgZGr/lDOsePd2AcE=
golang.org/x/exp v0.0.0-20201229011636-eab1b5eb1a03/go.mod h1:I6l2HNBLBZEcrOoCpyKLdY2lHoRZ8lI4x60KMCQDft4=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20200618115811-c13761719519 h1:1e2ufUJNM3lCHEY5jIgac/7UTjd6cgJNdatjPdFWf34=


@@ 92,10 91,13 @@ golang.org/x/image v0.0.0-20200927104501-e162460cd6b5 h1:QelT11PB4FXiDEXucrfNckH
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449 h1:xUIPaMhvROX9dhPvRCenIJtU78+lbEenGbgqB5hfHCQ=


@@ 122,9 124,8 @@ golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201110211018-35f3e6cf4a65 h1:Qo9oJ566/Sq7N4hrGftVXs8GI2CXBCuOd4S2wHE/e0M=
golang.org/x/sys v0.0.0-20201110211018-35f3e6cf4a65/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=


@@ 135,11 136,13 @@ golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa h1:5E4dL8+NgFOgjwbTKz+OOEGGhP+ectTmF842l6KjupQ=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200609164405-eb789aa7ce50/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=

M view/login/view.go => view/login/view.go +5 -5
@@ 5,7 5,7 @@ import (

	"git.sr.ht/~f4814n/frost"
	"git.sr.ht/~f4814n/frost/util"
	"git.sr.ht/~whereswaldon/materials"
	"gioui.org/x/component"

	"go.uber.org/zap"



@@ 25,8 25,8 @@ type view struct {

	theme *material.Theme

	usernameEditor *materials.TextField
	passwordEditor *materials.TextField
	usernameEditor *component.TextField
	passwordEditor *component.TextField
	loginButton    *widget.Clickable

	errorMessage string


@@ 39,8 39,8 @@ type view struct {
func New(theme *material.Theme, logger *zap.Logger) frost.View {
	return &view{
		loginInProcess: false,
		usernameEditor: &materials.TextField{Editor: widget.Editor{Submit: true, SingleLine: true}},
		passwordEditor: &materials.TextField{Editor: widget.Editor{Submit: true, SingleLine: true, Mask: '•'}},
		usernameEditor: &component.TextField{Editor: widget.Editor{Submit: true, SingleLine: true}},
		passwordEditor: &component.TextField{Editor: widget.Editor{Submit: true, SingleLine: true, Mask: '•'}},
		loginButton:    new(widget.Clickable),
		logger:         logger,
		theme:          theme,

M view/roomhistory/composer.go => view/roomhistory/composer.go +3 -3
@@ 6,12 6,12 @@ import (
	"gioui.org/widget"
	"gioui.org/widget/material"
	"git.sr.ht/~f4814n/frost/util"
	"git.sr.ht/~whereswaldon/materials"
	"gioui.org/x/component"
	"golang.org/x/exp/shiny/materialdesign/icons"
)

type messageComposer struct {
	editor     *materials.TextField
	editor     *component.TextField
	submit     *widget.Clickable
	submitIcon *widget.Icon



@@ 21,7 21,7 @@ type messageComposer struct {

func newMessageComposer() *messageComposer {
	return &messageComposer{
		editor:     &materials.TextField{},
		editor:     &component.TextField{},
		submit:     new(widget.Clickable),
		submitIcon: util.MustIcon(icons.ContentSend),
		disabled:   false,

M view/roomlist/roomlist.go => view/roomlist/roomlist.go +2 -2
@@ 19,7 19,7 @@ import (
	"git.sr.ht/~f4814n/frost/view/roomhistory"
	fwidget "git.sr.ht/~f4814n/frost/widget"
	"git.sr.ht/~f4814n/matrix"
	"git.sr.ht/~whereswaldon/materials"
	"gioui.org/x/component"
)

type (


@@ 40,7 40,7 @@ type view struct {
	rooms []roomListElement
}

func New(cli *matrix.Client, modalLayer *materials.ModalLayer, theme *material.Theme, logger *zap.Logger) frost.View {
func New(cli *matrix.Client, modalLayer *component.ModalLayer, theme *material.Theme, logger *zap.Logger) frost.View {
	return &view{
		cli:    cli,
		theme:  theme,

M widget/background.go => widget/background.go +2 -2
@@ 22,7 22,7 @@ func (b *Background) Layout(gtx layout.Context, w layout.Widget) layout.Dimensio
	macro := op.Record(gtx.Ops)
	dims := b.Inset.Layout(gtx, w)
	macroCall := macro.Stop()
	stack := op.Push(gtx.Ops)
	state := op.Save(gtx.Ops)
	size := dims.Size
	width, height := float32(size.X), float32(size.Y)
	if r := float32(gtx.Px(b.Radius)); r > 0 {


@@ 47,6 47,6 @@ func (b *Background) Layout(gtx layout.Context, w layout.Widget) layout.Dimensio
	clip.Op().Add(gtx.Ops)

	macroCall.Add(gtx.Ops)
	stack.Pop()
	state.Load()
	return dims
}

M widget/clipcircle.go => widget/clipcircle.go +3 -3
@@ 1,10 1,10 @@
package widget

import (
	"gioui.org/f32"
	"gioui.org/layout"
	"gioui.org/op"
	"gioui.org/op/clip"
	"gioui.org/f32"
)

type ClipCircle struct {


@@ 20,12 20,12 @@ func (cc ClipCircle) Layout(gtx layout.Context, w layout.Widget) layout.Dimensio
	}
	szf := float32(max)
	rr := szf * .5
	stack := op.Push(gtx.Ops)
	stack := op.Save(gtx.Ops)
	clip.RRect{
		Rect: f32.Rectangle{Max: f32.Point{X: szf, Y: szf}},
		NE:   rr, NW: rr, SE: rr, SW: rr,
	}.Add(gtx.Ops)
	macroCall.Add(gtx.Ops)
	stack.Pop()
	stack.Load()
	return dims
}