This commit is contained in:
Imbus 2025-01-25 06:11:26 +01:00
parent 9240e1dfea
commit f697ff43c9
3 changed files with 9 additions and 8 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
commit.txt

View file

@ -1 +0,0 @@
HEAD

View file

@ -3,8 +3,8 @@ package main
import (
"encoding/json"
"fmt"
"embed"
"time"
_ "embed"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
@ -23,9 +23,9 @@ type MyStruct struct {
Name string
}
//go:generate sh -c "printf %s $(git rev-parse HEAD) > commit.txt"
//go:generate sh -c "printf %s $(git rev-parse --short HEAD) > commit.txt"
//go:embed commit.txt
var Commit string
var git_rev string
// Download method for the struct
func (s *MyStruct) Download() {
@ -38,13 +38,13 @@ func main() {
clock.SetText(formatted)
a := app.New()
w := a.NewWindow("RexForge")
w := a.NewWindow(fmt.Sprintf("RexForge %s", git_rev))
w.Resize(fyne.NewSize(900, 600))
myList := []MyStruct{
{"File1"},
{"File2"},
{"File3"},
{"AtlasLoot"},
{"Bartender4"},
{"Deadly Boss Mods"},
}
enc, err := json.MarshalIndent(myList, "", " ")
@ -60,6 +60,7 @@ func main() {
dlbutton := widget.NewButton("Download", func() {
current.Download()
})
dlbutton.Importance = widget.LowImportance
spacer := layout.NewSpacer()
ct := container.NewHBox(namelabel, spacer, dlbutton)