Update to gioui.org@20200829.
This commit is contained in:
parent
63330567f0
commit
41129e49cc
|
@ -3,8 +3,8 @@ module st.wow.git/gmp/hrm/hrm
|
|||
go 1.14
|
||||
|
||||
require (
|
||||
gioui.org v0.0.0-20200726090130-3b95e2918359
|
||||
gioui.org/cmd v0.0.0-20200726090130-3b95e2918359
|
||||
git.wow.st/gmp/ble v0.0.0-20200612201046-f5cc27a30de7
|
||||
gioui.org v0.0.0-20200829162755-829ee4559c5a
|
||||
gioui.org/cmd v0.0.0-20200829162755-829ee4559c5a
|
||||
git.wow.st/gmp/ble v0.0.0-20200905181229-90ab682a4410
|
||||
gopkg.in/yaml.v2 v2.3.0
|
||||
)
|
||||
|
|
|
@ -4,10 +4,12 @@ gioui.org v0.0.0-20191126175243-2ca2e5462f16 h1:p31rtmKm51xpj2QtqGNlljAyHEP1oStU
|
|||
gioui.org v0.0.0-20191126175243-2ca2e5462f16/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
gioui.org v0.0.0-20200612151431-2dc19a36959c h1:sGUKyRMv2bbfbsRyG8ghOI12l+WCGta+PivmznjuLgo=
|
||||
gioui.org v0.0.0-20200612151431-2dc19a36959c/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
|
||||
gioui.org v0.0.0-20200619121558-88ced59dad93/go.mod h1:jiUwifN9cRl/zmco43aAqh0aV+s9GbhG13KcD+gEpkU=
|
||||
gioui.org v0.0.0-20200715100850-e48b85f8d92e/go.mod h1:jiUwifN9cRl/zmco43aAqh0aV+s9GbhG13KcD+gEpkU=
|
||||
gioui.org v0.0.0-20200726090130-3b95e2918359 h1:lae3H0ZryBOt3Kboxa55mpo5KsASVHSdS65EsGMf9kc=
|
||||
gioui.org v0.0.0-20200726090130-3b95e2918359/go.mod h1:jiUwifN9cRl/zmco43aAqh0aV+s9GbhG13KcD+gEpkU=
|
||||
gioui.org v0.0.0-20200829162755-829ee4559c5a h1:mciXRGzQwU0TbgCILZzl6L1nYIWU31lDGIb+8RYige8=
|
||||
gioui.org v0.0.0-20200829162755-829ee4559c5a/go.mod h1:Y+uS7hHMvku1Q+ooaoq6fYD5B2LGoT8JtFgvmYmRzTw=
|
||||
gioui.org/cmd v0.0.0-20200726090130-3b95e2918359 h1:oIoK6LiOPvctO41lzgsQckWuN+nKO5WktPNUplEZf68=
|
||||
gioui.org/cmd v0.0.0-20200726090130-3b95e2918359/go.mod h1:HNGpTdPoljZA5nsjt6wLgnB6gyU6WL6531yQdsD7cE4=
|
||||
gioui.org/cmd v0.0.0-20200829162755-829ee4559c5a h1:TXnkA3Fdk7FpwZ6x9lbIAZoTKOg/i5aTLIJ4f7SSagY=
|
||||
|
@ -37,6 +39,10 @@ git.wow.st/gmp/ble v0.0.0-20200204223639-7a583419c528 h1:jXHDwWWs11Qua2DSdgU1WBW
|
|||
git.wow.st/gmp/ble v0.0.0-20200204223639-7a583419c528/go.mod h1:Fh9BYe6AckJS7dzv2LFPr/wSYVMROUwmtc01VyQmuZo=
|
||||
git.wow.st/gmp/ble v0.0.0-20200612201046-f5cc27a30de7 h1:RoWGPgYpz5szRySgT6/Vykxw0nBMH39Mv2+ghsMy82I=
|
||||
git.wow.st/gmp/ble v0.0.0-20200612201046-f5cc27a30de7/go.mod h1:CpPW2hELyNbPdD2I6XvJsu3PQ23iPYtlLTydJ+KZMbQ=
|
||||
git.wow.st/gmp/ble v0.0.0-20200619183549-b0b310a7b0d2 h1:X/NZSZaKiBOfLR3V+8+erNYJrwLfTD+dukqhCpjWgzo=
|
||||
git.wow.st/gmp/ble v0.0.0-20200619183549-b0b310a7b0d2/go.mod h1:ObxuF1L41fWoIEfwX2Rww1veGj77dXVISXJA6sqThBA=
|
||||
git.wow.st/gmp/ble v0.0.0-20200905181229-90ab682a4410 h1:oR4E/sHCCJ6GnZGWJb2pIwuSKAO/P1QfB3sXHUQHWXU=
|
||||
git.wow.st/gmp/ble v0.0.0-20200905181229-90ab682a4410/go.mod h1:NrH2R84qUcPGoI9MmPGB1GFIbQxCWEw4WpVnDEn/WUc=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4/go.mod h1:PfAWWKJqjlGFYJEidUM6aVIWPr0EpobeyVWEEmplX7g=
|
||||
github.com/chromedp/chromedp v0.5.2/go.mod h1:rsTo/xRo23KZZwFmWk2Ui79rBaVRRATCjLzNQlOFSiA=
|
||||
|
|
11
hrm/main.go
11
hrm/main.go
|
@ -118,7 +118,6 @@ func eventloop() {
|
|||
margin := layout.UniformInset(unit.Dp(10))
|
||||
|
||||
b := ble.NewBLE()
|
||||
b.Enable(w)
|
||||
|
||||
state := "starting"
|
||||
var hr int
|
||||
|
@ -239,13 +238,13 @@ func eventloop() {
|
|||
p2a := f32.Point{(h1-s2)/2, (h1-s2)/2}
|
||||
p2b := f32.Point{s2 + (h1-s2)/2, s2 + (h1-s2)/2}
|
||||
r2 := f32.Rectangle{p2a, p2b}
|
||||
clip.Rect{ Rect: r1, NE: h1/2, NW: h1/2, SE: h1/2, SW: h1/2}.Op(gtx.Ops).Add(gtx.Ops)
|
||||
clip.RRect{ Rect: r1, NE: h1/2, NW: h1/2, SE: h1/2, SW: h1/2}.Add(gtx.Ops)
|
||||
paint.ColorOp{Color: blue}.Add(gtx.Ops)
|
||||
paint.PaintOp{Rect: r1}.Add(gtx.Ops)
|
||||
clip.Rect{ Rect: r2, NE: s2/2, NW: s2/2, SE: s2/2, SW: s2/2}.Op(gtx.Ops).Add(gtx.Ops)
|
||||
clip.RRect{ Rect: r2, NE: s2/2, NW: s2/2, SE: s2/2, SW: s2/2}.Add(gtx.Ops)
|
||||
paint.ColorOp{Color: white}.Add(gtx.Ops)
|
||||
paint.PaintOp{Rect: r2}.Add(gtx.Ops)
|
||||
op.TransformOp{}.Offset(p2a).Add(gtx.Ops)
|
||||
op.Offset(p2a).Add(gtx.Ops)
|
||||
gtx.Constraints.Max.X = int(s2)
|
||||
gtx.Constraints.Max.Y = int(s2)
|
||||
gtx.Constraints.Min.X = int(s2)
|
||||
|
@ -489,7 +488,7 @@ func eventloop() {
|
|||
case e := <-w.Events():
|
||||
switch e := e.(type) {
|
||||
case system.DestroyEvent:
|
||||
return
|
||||
os.Exit(0)
|
||||
case system.FrameEvent:
|
||||
gtx := layout.NewContext(&ops, e)
|
||||
if e.Size.X > e.Size.Y {
|
||||
|
@ -502,6 +501,8 @@ func eventloop() {
|
|||
return margin.Layout(gtx, page)
|
||||
})
|
||||
e.Frame(gtx.Ops)
|
||||
default:
|
||||
handleEvent(e, b)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,9 @@ import (
|
|||
"log"
|
||||
|
||||
"gioui.org/app"
|
||||
"gioui.org/io/event"
|
||||
|
||||
"git.wow.st/gmp/ble"
|
||||
)
|
||||
|
||||
var confDir string
|
||||
|
@ -19,3 +22,10 @@ func getConfDir() string {
|
|||
}
|
||||
return confDir
|
||||
}
|
||||
|
||||
func handleEvent(e event.Event, b *ble.BLE) {
|
||||
switch e:= e.(type) {
|
||||
case app.ViewEvent:
|
||||
b.Enable(e.View)
|
||||
}
|
||||
}
|
||||
|
|
11
hrm/os_others.go
Normal file
11
hrm/os_others.go
Normal file
|
@ -0,0 +1,11 @@
|
|||
//+build !android
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"gioui.org/io/event"
|
||||
"git.wow.st/gmp/ble"
|
||||
)
|
||||
|
||||
func handleEvent(e event.Event, b *ble.BLE) {
|
||||
}
|
Loading…
Reference in New Issue
Block a user