Browse Source

Update Gio version.

master
Greg 2 years ago
parent
commit
11e2dbad38
  1. 4
      cmd/form/main.go
  2. 4
      cmd/grid/main.go
  3. 10
      cmd/hello/main.go
  4. 8
      grid.go
  5. 2
      main.go

4
cmd/form/main.go

@ -158,9 +158,9 @@ func main1() {
giowrap.RecordMallocs()
}
}
ctx = ctx.Reset(&e)
ctx.Reset(&e)
giowrap.Mallocs("pre-layout")
ctx = (*page).Layout(ctx)
(*page).Layout(ctx)
giowrap.Mallocs("post-layout")
ctx.Update()
for i, w := range btns {

4
cmd/grid/main.go

@ -43,7 +43,7 @@ func main() {
app.Main()
}
func layoutRect(c ui.Config, ops *ui.Ops, cs layout.Constraints) layout.Dimens {
func layoutRect(c ui.Config, ops *ui.Ops, cs layout.Constraints) layout.Dimensions {
ins := layout.UniformInset(ui.Px(10))
cs = ins.Begin(c, ops, cs)
paint.PaintOp{Rect: f32.Rectangle{
@ -52,7 +52,7 @@ func layoutRect(c ui.Config, ops *ui.Ops, cs layout.Constraints) layout.Dimens {
Y: float32(cs.Width.Max),
},
}}.Add(ops)
dims := layout.Dimens{
dims := layout.Dimensions{
Size: image.Point{
X: cs.Width.Max,
Y: cs.Width.Max,

10
cmd/hello/main.go

@ -484,7 +484,7 @@ func main4() {
}
}
var dims layout.Dimens
var dims layout.Dimensions
cs := layout.RigidConstraints(e.Size)
{
f1 := layout.Flex{Axis: layout.Vertical}
@ -535,14 +535,14 @@ func main4() {
}
}
func layoutRRect(c ui.Config, ops *ui.Ops, cs layout.Constraints) layout.Dimens {
func layoutRRect(c ui.Config, ops *ui.Ops, cs layout.Constraints) layout.Dimensions {
r := float32(c.Px(ui.Dp(4)))
sz := image.Point{X: cs.Width.Min, Y: cs.Height.Min}
w, h := float32(sz.X), float32(sz.Y)
giowrap.Rrect(ops, w, h, r, r, r, r)
paint.ColorOp{Color: color.RGBA{A: 0xff, R: 0x3c, G: 0x98, B: 0xc6}}.Add(ops)
paint.PaintOp{Rect: f32.Rectangle{Max: f32.Point{X: w, Y: h}}}.Add(ops)
return layout.Dimens{Size: sz}
return layout.Dimensions{Size: sz}
}
type Button struct {
@ -551,10 +551,10 @@ type Button struct {
Click gesture.Click
}
func (b *Button) Layout(c ui.Config, ops *ui.Ops, cs layout.Constraints) layout.Dimens {
func (b *Button) Layout(c ui.Config, ops *ui.Ops, cs layout.Constraints) layout.Dimensions {
ins := layout.UniformInset(ui.Dp(10))
cs = ins.Begin(c, ops, cs)
var dims layout.Dimens
var dims layout.Dimensions
st := layout.Stack{}
st.Init(ops, cs)
{

8
grid.go

@ -20,7 +20,7 @@ type Grid struct {
}
type GridChild struct {
dims layout.Dimens
dims layout.Dimensions
macro ui.MacroOp
}
@ -57,7 +57,7 @@ func (g *Grid) Begin() {
g.macro.Record(g.ops)
}
func (g *Grid) End(dims layout.Dimens) GridChild {
func (g *Grid) End(dims layout.Dimensions) GridChild {
if g.mode != modeBegun {
panic("Must call Grid.Begin() before adding children.")
}
@ -65,7 +65,7 @@ func (g *Grid) End(dims layout.Dimens) GridChild {
return GridChild{dims: dims, macro: g.macro}
}
func (g *Grid) Layout(cs ...GridChild) layout.Dimens {
func (g *Grid) Layout(cs ...GridChild) layout.Dimensions {
rowheight := 0
height := 0
var width float32
@ -110,7 +110,7 @@ func (g *Grid) Layout(cs ...GridChild) layout.Dimens {
} else {
dwidth = g.cs.Width.Max
}
return layout.Dimens{Size: image.Point{dwidth, height}}
return layout.Dimensions{Size: image.Point{dwidth, height}}
}
func toPointF(p image.Point) f32.Point {

2
main.go

@ -47,7 +47,7 @@ type Context struct {
q input.Queue
ops *ui.Ops
cs layout.Constraints
dims layout.Dimens
dims layout.Dimensions
container Widget
}

Loading…
Cancel
Save