mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
cmd,example: update 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
|
go 1.13
|
||||||
|
|
||||||
require (
|
require (
|
||||||
gioui.org v0.0.0-20191203232943-86d69859b93a
|
gioui.org v0.0.0-20191211234536-7814da47a0ff
|
||||||
github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4
|
github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4
|
||||||
github.com/chromedp/chromedp v0.5.2
|
github.com/chromedp/chromedp v0.5.2
|
||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
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=
|
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||||
gioui.org v0.0.0-20191203232943-86d69859b93a h1:bF+1UDLyzDS3uePt+vWdPres0WauMc6cjvTOAYuPRU8=
|
gioui.org v0.0.0-20191211234536-7814da47a0ff h1:XaABsWEirzZKjqiWVD5eck5Ge/FpYEP9/eZHV1jpj50=
|
||||||
gioui.org v0.0.0-20191203232943-86d69859b93a/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
gioui.org v0.0.0-20191211234536-7814da47a0ff/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=
|
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/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=
|
github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4 h1:QD3KxSJ59L2lxG6MXBjNHxiQO2RmxTQ3XcK+wO44WOg=
|
||||||
|
|||||||
Vendored
+18
-14
@@ -62,20 +62,24 @@ func loop(w *app.Window) error {
|
|||||||
case system.FrameEvent:
|
case system.FrameEvent:
|
||||||
|
|
||||||
gtx.Reset(e.Config, e.Size)
|
gtx.Reset(e.Config, e.Size)
|
||||||
rows := layout.Flex{Axis: layout.Vertical}
|
layout.Flex{Axis: layout.Vertical}.Layout(gtx,
|
||||||
r1 := rows.Flex(gtx, 0.5, func() {
|
layout.Flexed(0.5, func() {
|
||||||
columns := layout.Flex{Axis: layout.Horizontal}
|
layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
|
||||||
r1c1 := columns.Flex(gtx, 0.5, func() { topLeft.Layout(gtx) })
|
// r1c1
|
||||||
r1c2 := columns.Flex(gtx, 0.5, func() { topRight.Layout(gtx) })
|
layout.Flexed(0.5, func() { topLeft.Layout(gtx) }),
|
||||||
columns.Layout(gtx, r1c1, r1c2)
|
// r1c2
|
||||||
})
|
layout.Flexed(0.5, func() { topRight.Layout(gtx) }),
|
||||||
r2 := rows.Flex(gtx, 0.5, func() {
|
)
|
||||||
columns := layout.Flex{Axis: layout.Horizontal}
|
}),
|
||||||
r2c1 := columns.Flex(gtx, 0.5, func() { botLeft.Layout(gtx) })
|
layout.Flexed(0.5, func() {
|
||||||
r2c2 := columns.Flex(gtx, 0.5, func() { botRight.Layout(gtx) })
|
layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
|
||||||
columns.Layout(gtx, r2c1, r2c2)
|
// r2c1
|
||||||
})
|
layout.Flexed(0.5, func() { botLeft.Layout(gtx) }),
|
||||||
rows.Layout(gtx, r1, r2)
|
// r2c2
|
||||||
|
layout.Flexed(0.5, func() { botRight.Layout(gtx) }),
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
e.Frame(gtx.Ops)
|
e.Frame(gtx.Ops)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ module gioui.org/example
|
|||||||
go 1.13
|
go 1.13
|
||||||
|
|
||||||
require (
|
require (
|
||||||
gioui.org v0.0.0-20191203232943-86d69859b93a
|
gioui.org v0.0.0-20191211234536-7814da47a0ff
|
||||||
github.com/google/go-github/v24 v24.0.1
|
github.com/google/go-github/v24 v24.0.1
|
||||||
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
|
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
|
||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
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=
|
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||||
gioui.org v0.0.0-20191203232943-86d69859b93a h1:bF+1UDLyzDS3uePt+vWdPres0WauMc6cjvTOAYuPRU8=
|
gioui.org v0.0.0-20191211234536-7814da47a0ff h1:XaABsWEirzZKjqiWVD5eck5Ge/FpYEP9/eZHV1jpj50=
|
||||||
gioui.org v0.0.0-20191203232943-86d69859b93a/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
gioui.org v0.0.0-20191211234536-7814da47a0ff/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
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/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||||
|
|||||||
+103
-112
@@ -172,84 +172,79 @@ func (up *userPage) commit(gtx *layout.Context, index int) {
|
|||||||
label := theme.Caption(msg)
|
label := theme.Caption(msg)
|
||||||
in := layout.Inset{Top: unit.Dp(16), Right: unit.Dp(8), Left: unit.Dp(8)}
|
in := layout.Inset{Top: unit.Dp(16), Right: unit.Dp(8), Left: unit.Dp(8)}
|
||||||
in.Layout(gtx, func() {
|
in.Layout(gtx, func() {
|
||||||
f := layout.Flex{Axis: layout.Horizontal}
|
layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
|
||||||
c1 := f.Rigid(gtx, func() {
|
layout.Rigid(func() {
|
||||||
sz := gtx.Px(unit.Dp(48))
|
sz := gtx.Px(unit.Dp(48))
|
||||||
cc := clipCircle{}
|
cc := clipCircle{}
|
||||||
cc.Layout(gtx, func() {
|
cc.Layout(gtx, func() {
|
||||||
gtx.Constraints = layout.RigidConstraints(gtx.Constraints.Constrain(image.Point{X: sz, Y: sz}))
|
gtx.Constraints = layout.RigidConstraints(gtx.Constraints.Constrain(image.Point{X: sz, Y: sz}))
|
||||||
u.layoutAvatar(gtx)
|
u.layoutAvatar(gtx)
|
||||||
})
|
})
|
||||||
})
|
}),
|
||||||
c2 := f.Flex(gtx, 1, func() {
|
layout.Flexed(1, func() {
|
||||||
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
|
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
|
||||||
layout.Inset{Left: unit.Dp(8)}.Layout(gtx, func() {
|
layout.Inset{Left: unit.Dp(8)}.Layout(gtx, func() {
|
||||||
label.Layout(gtx)
|
label.Layout(gtx)
|
||||||
})
|
})
|
||||||
})
|
}),
|
||||||
f.Layout(gtx, c1, c2)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *UI) layoutUsers(gtx *layout.Context) {
|
func (u *UI) layoutUsers(gtx *layout.Context) {
|
||||||
st := layout.Stack{Alignment: layout.SE}
|
layout.Stack{Alignment: layout.SE}.Layout(gtx,
|
||||||
c1 := st.Rigid(gtx, func() {
|
layout.Expanded(func() {
|
||||||
f := layout.Flex{Axis: layout.Vertical}
|
layout.Flex{Axis: layout.Vertical}.Layout(gtx,
|
||||||
|
layout.Rigid(func() {
|
||||||
c1 := f.Rigid(gtx, func() {
|
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
|
||||||
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
|
layout.UniformInset(unit.Dp(16)).Layout(gtx, func() {
|
||||||
layout.UniformInset(unit.Dp(16)).Layout(gtx, func() {
|
sz := gtx.Px(unit.Dp(200))
|
||||||
sz := gtx.Px(unit.Dp(200))
|
cs := gtx.Constraints
|
||||||
cs := gtx.Constraints
|
gtx.Constraints = layout.RigidConstraints(cs.Constrain(image.Point{X: sz, Y: sz}))
|
||||||
gtx.Constraints = layout.RigidConstraints(cs.Constrain(image.Point{X: sz, Y: sz}))
|
theme.Editor("Hint").Layout(gtx, u.edit)
|
||||||
theme.Editor("Hint").Layout(gtx, u.edit)
|
})
|
||||||
})
|
}),
|
||||||
})
|
layout.Rigid(func() {
|
||||||
|
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
|
||||||
c2 := f.Rigid(gtx, func() {
|
in := layout.Inset{Bottom: unit.Dp(16), Left: unit.Dp(16), Right: unit.Dp(16)}
|
||||||
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
|
in.Layout(gtx, func() {
|
||||||
in := layout.Inset{Bottom: unit.Dp(16), Left: unit.Dp(16), Right: unit.Dp(16)}
|
e := theme.Editor("Hint")
|
||||||
|
e.Font.Size = unit.Sp(14)
|
||||||
|
e.Font.Style = text.Italic
|
||||||
|
e.Layout(gtx, u.edit2)
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
layout.Rigid(func() {
|
||||||
|
layout.Stack{}.Layout(gtx,
|
||||||
|
layout.Expanded(func() {
|
||||||
|
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
|
||||||
|
fill{rgb(0xf2f2f2)}.Layout(gtx)
|
||||||
|
}),
|
||||||
|
layout.Stacked(func() {
|
||||||
|
in := layout.Inset{Top: unit.Dp(16), Right: unit.Dp(8), Bottom: unit.Dp(8), Left: unit.Dp(8)}
|
||||||
|
in.Layout(gtx, func() {
|
||||||
|
lbl := theme.Caption("GOPHERS")
|
||||||
|
lbl.Color = rgb(0x888888)
|
||||||
|
lbl.Layout(gtx)
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
layout.Flexed(1, func() {
|
||||||
|
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
|
||||||
|
u.layoutContributors(gtx)
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
layout.Stacked(func() {
|
||||||
|
in := layout.UniformInset(unit.Dp(16))
|
||||||
in.Layout(gtx, func() {
|
in.Layout(gtx, func() {
|
||||||
e := theme.Editor("Hint")
|
for u.fab.Clicked(gtx) {
|
||||||
e.Font.Size = unit.Sp(14)
|
}
|
||||||
e.Font.Style = text.Italic
|
theme.IconButton(u.fabIcon).Layout(gtx, u.fab)
|
||||||
e.Layout(gtx, u.edit2)
|
|
||||||
})
|
})
|
||||||
})
|
}),
|
||||||
|
)
|
||||||
c3 := f.Rigid(gtx, func() {
|
|
||||||
s := layout.Stack{}
|
|
||||||
c2 := s.Rigid(gtx, func() {
|
|
||||||
in := layout.Inset{Top: unit.Dp(16), Right: unit.Dp(8), Bottom: unit.Dp(8), Left: unit.Dp(8)}
|
|
||||||
in.Layout(gtx, func() {
|
|
||||||
lbl := theme.Caption("GOPHERS")
|
|
||||||
lbl.Color = rgb(0x888888)
|
|
||||||
lbl.Layout(gtx)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
c1 := s.Expand(gtx, func() {
|
|
||||||
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
|
|
||||||
fill{rgb(0xf2f2f2)}.Layout(gtx)
|
|
||||||
})
|
|
||||||
s.Layout(gtx, c1, c2)
|
|
||||||
})
|
|
||||||
|
|
||||||
c4 := f.Flex(gtx, 1, func() {
|
|
||||||
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
|
|
||||||
u.layoutContributors(gtx)
|
|
||||||
})
|
|
||||||
f.Layout(gtx, c1, c2, c3, c4)
|
|
||||||
})
|
|
||||||
c2 := st.Rigid(gtx, func() {
|
|
||||||
in := layout.UniformInset(unit.Dp(16))
|
|
||||||
in.Layout(gtx, func() {
|
|
||||||
for u.fab.Clicked(gtx) {
|
|
||||||
}
|
|
||||||
theme.IconButton(u.fabIcon).Layout(gtx, u.fab)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
st.Layout(gtx, c1, c2)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *UI) layoutContributors(gtx *layout.Context) {
|
func (u *UI) layoutContributors(gtx *layout.Context) {
|
||||||
@@ -264,12 +259,10 @@ func (u *UI) layoutContributors(gtx *layout.Context) {
|
|||||||
|
|
||||||
func (u *UI) user(gtx *layout.Context, index int) {
|
func (u *UI) user(gtx *layout.Context, index int) {
|
||||||
user := u.users[index]
|
user := u.users[index]
|
||||||
elem := layout.Flex{Axis: layout.Vertical}
|
in := layout.UniformInset(unit.Dp(8))
|
||||||
c1 := elem.Rigid(gtx, func() {
|
in.Layout(gtx, func() {
|
||||||
in := layout.UniformInset(unit.Dp(8))
|
centerRowOpts().Layout(gtx,
|
||||||
in.Layout(gtx, func() {
|
layout.Rigid(func() {
|
||||||
f := centerRowOpts()
|
|
||||||
c1 := f.Rigid(gtx, func() {
|
|
||||||
in := layout.Inset{Right: unit.Dp(8)}
|
in := layout.Inset{Right: unit.Dp(8)}
|
||||||
cc := clipCircle{}
|
cc := clipCircle{}
|
||||||
in.Layout(gtx, func() {
|
in.Layout(gtx, func() {
|
||||||
@@ -280,41 +273,39 @@ func (u *UI) user(gtx *layout.Context, index int) {
|
|||||||
user.layoutAvatar(gtx)
|
user.layoutAvatar(gtx)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
}),
|
||||||
c2 := f.Rigid(gtx, func() {
|
layout.Rigid(func() {
|
||||||
f := column()
|
column().Layout(gtx,
|
||||||
c1 := f.Rigid(gtx, func() {
|
layout.Rigid(func() {
|
||||||
f := baseline()
|
baseline().Layout(gtx,
|
||||||
c1 := f.Rigid(gtx, func() {
|
layout.Rigid(func() {
|
||||||
theme.Body1(user.name).Layout(gtx)
|
theme.Body1(user.name).Layout(gtx)
|
||||||
})
|
}),
|
||||||
c2 := f.Flex(gtx, 1, func() {
|
layout.Flexed(1, func() {
|
||||||
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
|
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
|
||||||
layout.Align(layout.E).Layout(gtx, func() {
|
layout.Align(layout.E).Layout(gtx, func() {
|
||||||
layout.Inset{Left: unit.Dp(2)}.Layout(gtx, func() {
|
layout.Inset{Left: unit.Dp(2)}.Layout(gtx, func() {
|
||||||
theme.Caption("3 hours ago").Layout(gtx)
|
theme.Caption("3 hours ago").Layout(gtx)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
layout.Rigid(func() {
|
||||||
|
in := layout.Inset{Top: unit.Dp(4)}
|
||||||
|
in.Layout(gtx, func() {
|
||||||
|
lbl := theme.Caption(user.company)
|
||||||
|
lbl.Color = rgb(0xbbbbbb)
|
||||||
|
lbl.Layout(gtx)
|
||||||
})
|
})
|
||||||
})
|
}),
|
||||||
f.Layout(gtx, c1, c2)
|
)
|
||||||
})
|
}),
|
||||||
c2 := f.Rigid(gtx, func() {
|
)
|
||||||
in := layout.Inset{Top: unit.Dp(4)}
|
|
||||||
in.Layout(gtx, func() {
|
|
||||||
lbl := theme.Caption(user.company)
|
|
||||||
lbl.Color = rgb(0xbbbbbb)
|
|
||||||
lbl.Layout(gtx)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
f.Layout(gtx, c1, c2)
|
|
||||||
})
|
|
||||||
f.Layout(gtx, c1, c2)
|
|
||||||
})
|
|
||||||
pointer.Rect(image.Rectangle{Max: gtx.Dimensions.Size}).Add(gtx.Ops)
|
|
||||||
click := &u.userClicks[index]
|
|
||||||
click.Add(gtx.Ops)
|
|
||||||
})
|
})
|
||||||
elem.Layout(gtx, c1)
|
pointer.Rect(image.Rectangle{Max: gtx.Dimensions.Size}).Add(gtx.Ops)
|
||||||
|
click := &u.userClicks[index]
|
||||||
|
click.Add(gtx.Ops)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *user) layoutAvatar(gtx *layout.Context) {
|
func (u *user) layoutAvatar(gtx *layout.Context) {
|
||||||
@@ -377,7 +368,7 @@ func (c *clipCircle) Layout(gtx *layout.Context, w layout.Widget) {
|
|||||||
Rect: f32.Rectangle{Max: f32.Point{X: szf, Y: szf}},
|
Rect: f32.Rectangle{Max: f32.Point{X: szf, Y: szf}},
|
||||||
NE: rr, NW: rr, SE: rr, SW: rr,
|
NE: rr, NW: rr, SE: rr, SW: rr,
|
||||||
}.Op(gtx.Ops).Add(gtx.Ops)
|
}.Op(gtx.Ops).Add(gtx.Ops)
|
||||||
m.Add(gtx.Ops)
|
m.Add()
|
||||||
stack.Pop()
|
stack.Pop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+36
-36
@@ -141,48 +141,48 @@ func kitchen(gtx *layout.Context, th *material.Theme) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
func() {
|
func() {
|
||||||
buttons := layout.Flex{Alignment: layout.Middle}
|
|
||||||
in := layout.UniformInset(unit.Dp(8))
|
in := layout.UniformInset(unit.Dp(8))
|
||||||
b1 := buttons.Rigid(gtx, func() {
|
layout.Flex{Alignment: layout.Middle}.Layout(gtx,
|
||||||
in.Layout(gtx, func() {
|
layout.Rigid(func() {
|
||||||
th.IconButton(icon).Layout(gtx, iconButton)
|
in.Layout(gtx, func() {
|
||||||
})
|
th.IconButton(icon).Layout(gtx, iconButton)
|
||||||
})
|
})
|
||||||
b2 := buttons.Rigid(gtx, func() {
|
}),
|
||||||
in.Layout(gtx, func() {
|
layout.Rigid(func() {
|
||||||
for button.Clicked(gtx) {
|
in.Layout(gtx, func() {
|
||||||
green = !green
|
for button.Clicked(gtx) {
|
||||||
}
|
green = !green
|
||||||
th.Button("Click me!").Layout(gtx, button)
|
}
|
||||||
})
|
th.Button("Click me!").Layout(gtx, button)
|
||||||
})
|
})
|
||||||
b3 := buttons.Rigid(gtx, func() {
|
}),
|
||||||
in.Layout(gtx, func() {
|
layout.Rigid(func() {
|
||||||
var btn material.Button
|
in.Layout(gtx, func() {
|
||||||
btn = th.Button("Green button")
|
var btn material.Button
|
||||||
if green {
|
btn = th.Button("Green button")
|
||||||
btn.Background = color.RGBA{A: 0xff, R: 0x9e, G: 0x9d, B: 0x24}
|
if green {
|
||||||
}
|
btn.Background = color.RGBA{A: 0xff, R: 0x9e, G: 0x9d, B: 0x24}
|
||||||
btn.Layout(gtx, greenButton)
|
}
|
||||||
})
|
btn.Layout(gtx, greenButton)
|
||||||
})
|
})
|
||||||
buttons.Layout(gtx, b1, b2, b3)
|
}),
|
||||||
|
)
|
||||||
},
|
},
|
||||||
func() {
|
func() {
|
||||||
th.CheckBox("Checkbox").Layout(gtx, checkbox)
|
th.CheckBox("Checkbox").Layout(gtx, checkbox)
|
||||||
},
|
},
|
||||||
func() {
|
func() {
|
||||||
group := layout.Flex{}
|
layout.Flex{}.Layout(gtx,
|
||||||
r1 := group.Rigid(gtx, func() {
|
layout.Rigid(func() {
|
||||||
th.RadioButton("r1", "RadioButton1").Layout(gtx, radioButtonsGroup)
|
th.RadioButton("r1", "RadioButton1").Layout(gtx, radioButtonsGroup)
|
||||||
})
|
}),
|
||||||
r2 := group.Rigid(gtx, func() {
|
layout.Rigid(func() {
|
||||||
th.RadioButton("r2", "RadioButton2").Layout(gtx, radioButtonsGroup)
|
th.RadioButton("r2", "RadioButton2").Layout(gtx, radioButtonsGroup)
|
||||||
})
|
}),
|
||||||
r3 := group.Rigid(gtx, func() {
|
layout.Rigid(func() {
|
||||||
th.RadioButton("r3", "RadioButton3").Layout(gtx, radioButtonsGroup)
|
th.RadioButton("r3", "RadioButton3").Layout(gtx, radioButtonsGroup)
|
||||||
})
|
}),
|
||||||
group.Layout(gtx, r1, r2, r3)
|
)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
list.Layout(gtx, len(widgets), func(i int) {
|
list.Layout(gtx, len(widgets), func(i int) {
|
||||||
|
|||||||
Reference in New Issue
Block a user