Skip to content

Commit

Permalink
Some formatting and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerCode authored Jan 19, 2024
1 parent b41dc8c commit 07de1e3
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -188,23 +197,14 @@ 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
}
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 %")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 07de1e3

Please sign in to comment.