From 07de1e30259a16f5f084253495062adf51e9ff9d Mon Sep 17 00:00:00 2001 From: Tyler C <18288340+TylerCode@users.noreply.github.com> Date: Fri, 19 Jan 2024 15:37:21 -0700 Subject: [PATCH] Some formatting and documentation --- main.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index cdd9cb1..3595013 100644 --- a/main.go +++ b/main.go @@ -22,6 +22,15 @@ import ( "image" ) +type CoreTile struct { + CoreLabel *widget.Label + UtilLabel *widget.Label + ClockLabel *widget.Label + container *fyne.Container + UtilHistory []float64 // Slice to store utilization history + GraphImg *canvas.Image +} + func main() { myApp := app.New() @@ -188,7 +197,7 @@ func drawLine(img *image.RGBA, x1, y1, x2, y2 int, col color.RGBA) { } } -// simple abs so that I don't need a whole math import +// simple abs so that I don't need a whole math import for one function func abs(x int) int { if x < 0 { return -x @@ -196,15 +205,6 @@ func abs(x int) int { return x } -type CoreTile struct { - CoreLabel *widget.Label - UtilLabel *widget.Label - ClockLabel *widget.Label - container *fyne.Container - UtilHistory []float64 // Slice to store utilization history - GraphImg *canvas.Image -} - func NewCoreTile() *CoreTile { coreLabel := widget.NewLabel("Core #") utilLabel := widget.NewLabel("Util %") @@ -236,6 +236,7 @@ func (t *CoreTile) GetContainer() fyne.CanvasObject { return t.container } +// Theme table, mostly for graphs, need to move out of this into a real theme var ( GreenLight = color.RGBA{R: 26, G: 155, B: 12, A: 255} // Light theme green YellowLight = color.RGBA{R: 190, G: 161, B: 14, A: 255} // Light theme yellow