New style for options.

This commit is contained in:
gmp
2019-08-20 12:39:28 -04:00
parent 5bef5fc95a
commit 491f26dcfe
3 changed files with 108 additions and 74 deletions
+8 -8
View File
@@ -35,8 +35,8 @@ var (
)
func NewButton(face text.Face, t string, c color.RGBA) giowrap.Clickable {
lbl := giowrap.NewLabel(t, giowrap.LabelFace(face), giowrap.LabelAlignment(text.Center))
bg := giowrap.NewBackground(giowrap.BgColor(c), giowrap.BgRadius(ui.Dp(4)))
lbl := giowrap.NewLabel(t, giowrap.Face(face), giowrap.Align(text.Center))
bg := giowrap.NewBackground(giowrap.Color(c), giowrap.Radius(ui.Dp(4)))
return giowrap.AsClickable(bg(lbl))
}
@@ -86,16 +86,16 @@ func main1() {
}
ctx := giowrap.NewContext(w)
t := time.NewTicker(time.Second/time.Duration(FPS))
e1 := giowrap.NewEditor("text 1",giowrap.EditorFace(ctx.Faces.For(regular, ui.Sp(24))))
e1 := giowrap.NewEditor("text 1",giowrap.Face(ctx.Faces.For(regular, ui.Sp(24))))
e1.Focus()
e2 := giowrap.NewEditor("text 2",giowrap.EditorFace(ctx.Faces.For(regular, ui.Sp(24))))
e2 := giowrap.NewEditor("text 2",giowrap.Face(ctx.Faces.For(regular, ui.Sp(24))))
f1 := giowrap.NewFlex(giowrap.FlexAxis(layout.Vertical))
OuterInset := giowrap.NewInset(giowrap.InsetSize(ui.Dp(10)))
InnerInset := giowrap.NewInset(giowrap.InsetSize(ui.Dp(10)))
f1 := giowrap.NewFlex(giowrap.Axis(layout.Vertical))
OuterInset := giowrap.NewInset(giowrap.Size(ui.Dp(10)))
InnerInset := giowrap.NewInset(giowrap.Size(ui.Dp(10)))
f2 := giowrap.NewFlex(giowrap.FlexAxis(layout.Horizontal))
f2 := giowrap.NewFlex(giowrap.Axis(layout.Horizontal))
btn1 := NewButton(ctx.Faces.For(regular, ui.Sp(24)),
"push1", color.RGBA{A: 0xff, R: 0x3c, G: 0x98, B: 0xc6})