mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
example,cmd: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ module gioui.org/cmd
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
gioui.org v0.0.0-20200615160648-c2f99fb0e99c
|
||||
gioui.org v0.0.0-20200617094714-596e32161041
|
||||
github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4
|
||||
github.com/chromedp/chromedp v0.5.2
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
||||
|
||||
+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-20200615160648-c2f99fb0e99c h1:5nU1iD464+yYrV946xsTC0jFMcDmY3XAe9dwyizP3PU=
|
||||
gioui.org v0.0.0-20200615160648-c2f99fb0e99c/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
|
||||
gioui.org v0.0.0-20200617094714-596e32161041 h1:mogSEMG8m1oAoF9kc7s0ABUkqZK6wq6rswSUCTbqhVs=
|
||||
gioui.org v0.0.0-20200617094714-596e32161041/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=
|
||||
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 h1:QD3KxSJ59L2lxG6MXBjNHxiQO2RmxTQ3XcK+wO44WOg=
|
||||
|
||||
@@ -94,10 +94,13 @@ func main() {
|
||||
sz := image.Point{X: width, Y: height}
|
||||
ops.Reset()
|
||||
gtx := layout.Context{
|
||||
Ops: &ops,
|
||||
Now: time.Now(),
|
||||
Queue: &queue,
|
||||
Config: &glfwConfig{scale},
|
||||
Ops: &ops,
|
||||
Now: time.Now(),
|
||||
Queue: &queue,
|
||||
Metric: unit.Metric{
|
||||
PxPerDp: scale,
|
||||
PxPerSp: scale,
|
||||
},
|
||||
Constraints: layout.Exact(sz),
|
||||
}
|
||||
draw(gtx, th)
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ module gioui.org/example
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
gioui.org v0.0.0-20200615160648-c2f99fb0e99c
|
||||
gioui.org v0.0.0-20200617094714-596e32161041
|
||||
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72
|
||||
github.com/google/go-github/v24 v24.0.1
|
||||
|
||||
+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-20200615160648-c2f99fb0e99c h1:5nU1iD464+yYrV946xsTC0jFMcDmY3XAe9dwyizP3PU=
|
||||
gioui.org v0.0.0-20200615160648-c2f99fb0e99c/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
|
||||
gioui.org v0.0.0-20200617094714-596e32161041 h1:mogSEMG8m1oAoF9kc7s0ABUkqZK6wq6rswSUCTbqhVs=
|
||||
gioui.org v0.0.0-20200617094714-596e32161041/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw=
|
||||
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
|
||||
|
||||
@@ -13,7 +13,6 @@ import (
|
||||
"image/png"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"math"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -35,10 +34,6 @@ import (
|
||||
var screenshot = flag.String("screenshot", "", "save a screenshot to a file and exit")
|
||||
var disable = flag.Bool("disable", false, "disable all widgets")
|
||||
|
||||
type scaledConfig struct {
|
||||
Scale float32
|
||||
}
|
||||
|
||||
type iconAndTextButton struct {
|
||||
theme *material.Theme
|
||||
button *widget.Clickable
|
||||
@@ -87,8 +82,11 @@ func saveScreenshot(f string) error {
|
||||
return err
|
||||
}
|
||||
gtx := layout.Context{
|
||||
Ops: new(op.Ops),
|
||||
Config: &scaledConfig{scale},
|
||||
Ops: new(op.Ops),
|
||||
Metric: unit.Metric{
|
||||
PxPerDp: scale,
|
||||
PxPerSp: scale,
|
||||
},
|
||||
Constraints: layout.Exact(sz),
|
||||
Queue: new(router.Router),
|
||||
}
|
||||
@@ -304,14 +302,6 @@ func kitchen(gtx layout.Context, th *material.Theme) layout.Dimensions {
|
||||
})
|
||||
}
|
||||
|
||||
func (s *scaledConfig) Px(v unit.Value) int {
|
||||
scale := s.Scale
|
||||
if v.U == unit.UnitPx {
|
||||
scale = 1
|
||||
}
|
||||
return int(math.Round(float64(scale * v.V)))
|
||||
}
|
||||
|
||||
const longText = `1. I learned from my grandfather, Verus, to use good manners, and to
|
||||
put restraint on anger. 2. In the famous memory of my father I had a
|
||||
pattern of modesty and manliness. 3. Of my mother I learned to be
|
||||
|
||||
Reference in New Issue
Block a user