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