mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
example: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-2
@@ -3,9 +3,8 @@ module gioui.org/example
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
gioui.org v0.0.0-20191012123625-abb99eca5c54
|
||||
gioui.org v0.0.0-20191013162339-8cd4c2e5de65
|
||||
github.com/google/go-github/v24 v24.0.1
|
||||
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
|
||||
)
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
gioui.org v0.0.0-20191012123625-abb99eca5c54 h1:1LQMwF6UgHRaAbwvoaKWmnv5LwKt2HyXJooDvkNkmRg=
|
||||
gioui.org v0.0.0-20191012123625-abb99eca5c54/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
gioui.org v0.0.0-20191013162339-8cd4c2e5de65 h1:94lyVLRIPhu95x3goGooL3ZxkDZgo9dRgR6Unecwre0=
|
||||
gioui.org v0.0.0-20191013162339-8cd4c2e5de65/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||
|
||||
+3
-15
@@ -17,6 +17,7 @@ import (
|
||||
_ "net/http/pprof"
|
||||
|
||||
"gioui.org/f32"
|
||||
_ "gioui.org/font/gofont"
|
||||
"gioui.org/gesture"
|
||||
"gioui.org/io/key"
|
||||
"gioui.org/io/pointer"
|
||||
@@ -25,16 +26,11 @@ import (
|
||||
"gioui.org/op"
|
||||
"gioui.org/op/paint"
|
||||
"gioui.org/text"
|
||||
"gioui.org/text/opentype"
|
||||
"gioui.org/unit"
|
||||
"gioui.org/widget"
|
||||
"gioui.org/widget/material"
|
||||
|
||||
"github.com/google/go-github/v24/github"
|
||||
"golang.org/x/image/font/gofont/gobold"
|
||||
"golang.org/x/image/font/gofont/goitalic"
|
||||
"golang.org/x/image/font/gofont/gomono"
|
||||
"golang.org/x/image/font/gofont/goregular"
|
||||
|
||||
"golang.org/x/exp/shiny/materialdesign/icons"
|
||||
)
|
||||
@@ -68,18 +64,10 @@ type user struct {
|
||||
avatar image.Image
|
||||
}
|
||||
|
||||
var shaper *text.Shaper
|
||||
|
||||
var theme *material.Theme
|
||||
|
||||
func init() {
|
||||
s := new(text.Shaper)
|
||||
s.Register(text.Font{}, opentype.Must(opentype.Parse(goregular.TTF)))
|
||||
s.Register(text.Font{Style: text.Italic}, opentype.Must(opentype.Parse(goitalic.TTF)))
|
||||
s.Register(text.Font{Weight: text.Bold}, opentype.Must(opentype.Parse(gobold.TTF)))
|
||||
s.Register(text.Font{Typeface: "mono"}, opentype.Must(opentype.Parse(gomono.TTF)))
|
||||
shaper = s
|
||||
theme = material.NewTheme(s)
|
||||
theme = material.NewTheme()
|
||||
theme.Color.Text = rgb(0x333333)
|
||||
theme.Color.Hint = rgb(0xbbbbbb)
|
||||
}
|
||||
@@ -136,7 +124,7 @@ func (u *UI) layoutTimings(gtx *layout.Context) {
|
||||
layout.Inset{Top: unit.Dp(16)}.Layout(gtx, func() {
|
||||
txt := fmt.Sprintf("m: %d %s", mallocs, u.profile.Timings)
|
||||
lbl := theme.Caption(txt)
|
||||
lbl.Font.Typeface = "mono"
|
||||
lbl.Font.Variant = "Mono"
|
||||
lbl.Layout(gtx)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -9,12 +9,10 @@ import (
|
||||
"log"
|
||||
|
||||
"gioui.org/app"
|
||||
_ "gioui.org/font/gofont"
|
||||
"gioui.org/layout"
|
||||
"gioui.org/text"
|
||||
"gioui.org/text/opentype"
|
||||
"gioui.org/widget/material"
|
||||
|
||||
"golang.org/x/image/font/gofont/goregular"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -28,11 +26,7 @@ func main() {
|
||||
}
|
||||
|
||||
func loop(w *app.Window) error {
|
||||
shaper := new(text.Shaper)
|
||||
shaper.Register(text.Font{}, opentype.Must(
|
||||
opentype.Parse(goregular.TTF),
|
||||
))
|
||||
th := material.NewTheme(shaper)
|
||||
th := material.NewTheme()
|
||||
gtx := &layout.Context{
|
||||
Queue: w.Queue(),
|
||||
}
|
||||
|
||||
@@ -10,14 +10,12 @@ import (
|
||||
"gioui.org/app"
|
||||
"gioui.org/layout"
|
||||
"gioui.org/text"
|
||||
"gioui.org/text/opentype"
|
||||
"gioui.org/unit"
|
||||
"gioui.org/widget"
|
||||
"gioui.org/widget/material"
|
||||
|
||||
_ "gioui.org/font/gofont"
|
||||
"golang.org/x/exp/shiny/materialdesign/icons"
|
||||
"golang.org/x/image/font/gofont/goitalic"
|
||||
"golang.org/x/image/font/gofont/goregular"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -36,14 +34,7 @@ func main() {
|
||||
}
|
||||
|
||||
func loop(w *app.Window) error {
|
||||
shaper := new(text.Shaper)
|
||||
shaper.Register(text.Font{}, opentype.Must(
|
||||
opentype.Parse(goregular.TTF),
|
||||
))
|
||||
shaper.Register(text.Font{Style: text.Italic}, opentype.Must(
|
||||
opentype.Parse(goitalic.TTF),
|
||||
))
|
||||
th := material.NewTheme(shaper)
|
||||
th := material.NewTheme()
|
||||
gtx := &layout.Context{
|
||||
Queue: w.Queue(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user