diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-05-10 13:17:02 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-05-10 13:17:02 -0400 |
| commit | 15c9618700dc681e6b94e83a1aaeea6cbcd0c2c2 (patch) | |
| tree | bd92f064527f8897c41e294df10efaaaef5f50fd /gui | |
| parent | 97a7a7cd2afa18b73f5982ecb3ec08c0392b6d1e (diff) | |
| download | volute-15c9618700dc681e6b94e83a1aaeea6cbcd0c2c2.zip | |
separate label widget and style constants
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/widget/image.go | 3 | ||||
| -rw-r--r-- | gui/widget/label.go (renamed from gui/widget/widget.go) | 12 | ||||
| -rw-r--r-- | gui/widget/style.go | 10 |
3 files changed, 13 insertions, 12 deletions
diff --git a/gui/widget/image.go b/gui/widget/image.go index c5712c4..daf76aa 100644 --- a/gui/widget/image.go +++ b/gui/widget/image.go @@ -3,6 +3,7 @@ package widget import ( "sync" + xdraw "golang.org/x/image/draw" "image" "image/draw" @@ -10,6 +11,8 @@ import ( "volute/gui/win" ) +var interpolator = xdraw.ApproxBiLinear + func Image(imChan <-chan image.Image, r image.Rectangle, env gui.Env, wg *sync.WaitGroup) { defer wg.Done() defer close(env.Draw()) diff --git a/gui/widget/widget.go b/gui/widget/label.go index 84e7175..cc2010f 100644 --- a/gui/widget/widget.go +++ b/gui/widget/label.go @@ -2,10 +2,7 @@ package widget import ( "sync" - - xdraw "golang.org/x/image/draw" "image" - "image/color" "image/draw" "volute/gui" @@ -13,15 +10,6 @@ import ( "volute/gui/win" ) -var ( - FOCUS_COLOR = color.RGBA{179, 217, 255, 255} - GREEN = color.RGBA{51, 102, 0, 255} - BLACK = color.Gray{0} - WHITE = color.Gray{255} - - interpolator = xdraw.ApproxBiLinear -) - func Label(str string, r image.Rectangle, env gui.Env, wg *sync.WaitGroup) { defer wg.Done() defer close(env.Draw()) diff --git a/gui/widget/style.go b/gui/widget/style.go new file mode 100644 index 0000000..b2bd3f9 --- /dev/null +++ b/gui/widget/style.go @@ -0,0 +1,10 @@ +package widget + +import "image/color" + +var ( + FOCUS_COLOR = color.RGBA{179, 217, 255, 255} + GREEN = color.RGBA{51, 102, 0, 255} + BLACK = color.Gray{0} + WHITE = color.Gray{255} +) |