Cleanups and comments.

This commit is contained in:
gmp
2019-08-15 18:32:01 -04:00
parent 74951e8ce5
commit 92cb4d20a4
2 changed files with 19 additions and 37 deletions
+4 -4
View File
@@ -3,6 +3,7 @@ package main
import (
"git.wow.st/gmp/giowrap"
"image/color"
"log"
"time"
@@ -40,7 +41,7 @@ func main() {
"push",
text.Center,
)
bg := giowrap.NewBackground(giowrap.Rgb(0x3c98c6), ui.Dp(4))
bg := giowrap.NewBackground(color.RGBA{A: 0xff, R: 0x3c, G: 0x98, B: 0xc6}, ui.Dp(4))
btn := giowrap.Clickable(bg(lbl))
for {
@@ -53,15 +54,14 @@ func main() {
return
case app.DrawEvent:
ctx = ctx.Reset(e)
ctx = giowrap.LayoutWithContext(ctx,
OuterInset(
ctx = OuterInset(
f(
e1,
giowrap.Flexible(5),
InnerInset(e2),
giowrap.Flexible(10),
btn,
)))
)).Layout(ctx)
ctx.Draw()
if btn.Clicked(ctx) {
log.Print("Clicked: " + e2.Text() )