Compare commits

..

No commits in common. "c17f2d202b9e1ece40b558feab8f753bde28304c" and "d08af465256943a7653aaac9368903b36971bee6" have entirely different histories.

2 changed files with 28 additions and 71 deletions

View file

@ -1,16 +1,16 @@
NAME = rexclient NAME = rexclient
build: commit.txt
go build -tags no_emoji -trimpath -ldflags="-s -w" -buildvcs=false -o $(NAME)
run: commit.txt run: commit.txt
go run . go run .
debug: commit.txt debug: commit.txt
go run -tags debug,hints . go run -tags debug,hints .
build: commit.txt
go build -tags no_emoji -trimpath -ldflags="-s -w" -buildvcs=false -o $(NAME)
commit.txt: commit.txt:
go generate go generate
clean: clean:
rm -f $(NAME) rm -f rexclient

View file

@ -1,15 +1,14 @@
package main package main
import ( import (
_ "embed"
"fmt" "fmt"
"time" "time"
_ "embed"
"fyne.io/fyne/v2" "fyne.io/fyne/v2"
"fyne.io/fyne/v2/app" "fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container" "fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/layout" "fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/widget"
) )
@ -32,39 +31,6 @@ func (s *MyStruct) Download() {
fmt.Printf("Downloading %s...\n", s.Name) fmt.Printf("Downloading %s...\n", s.Name)
} }
var myList = []MyStruct{
{"AtlasLoot"},
{"Bartender4"},
{"Deadly Boss Mods"},
{"Details! Damage Meter"},
{"WeakAuras"},
{"ElvUI"},
{"BigWigs"},
{"Recount"},
{"GatherMate2"},
{"TomTom"},
{"Questie"},
{"TradeSkillMaster"},
{"HandyNotes"},
{"Bagnon"},
{"Threat Plates"},
{"GTFO"},
{"Plater Nameplates"},
{"Rarity"},
{"Pawn"},
{"Auctioneer"},
{"Shadowed Unit Frames"},
{"SexyMap"},
{"TidyPlates"},
{"MoveAnything"},
{"Postal"},
{"OmniCC"},
{"Leatrix Plus"},
{"SimulationCraft"},
{"VuhDo"},
{"KuiNameplates"},
}
func main() { func main() {
clock := widget.NewLabel("") clock := widget.NewLabel("")
formatted := time.Now().Format("Time: 03:04:05") formatted := time.Now().Format("Time: 03:04:05")
@ -74,29 +40,26 @@ func main() {
w := a.NewWindow(fmt.Sprintf("RexForge %s", git_rev)) w := a.NewWindow(fmt.Sprintf("RexForge %s", git_rev))
w.Resize(fyne.NewSize(900, 600)) w.Resize(fyne.NewSize(900, 600))
list := widget.NewList( myList := []MyStruct{
func() int { {"AtlasLoot"},
return len(myList) {"Bartender4"},
}, {"Deadly Boss Mods"},
func() fyne.CanvasObject { }
btn := widget.NewButton("", func() {})
label := widget.NewLabel("")
return container.NewBorder(nil, nil, label, btn) listContainer := container.NewVBox()
},
func(i widget.ListItemID, o fyne.CanvasObject) {
o.(*fyne.Container).RemoveAll()
btn := widget.NewButtonWithIcon("Download", theme.DownloadIcon(), func() { for _, item := range myList {
myList[i].Download() current := item
namelabel := widget.NewLabel(current.Name)
dlbutton := widget.NewButton("Download", func() {
current.Download()
}) })
btn.Importance = widget.LowImportance dlbutton.Importance = widget.LowImportance
label := widget.NewLabel(myList[i].Name) spacer := layout.NewSpacer()
ct := container.NewHBox(namelabel, spacer, dlbutton)
row := container.NewBorder(nil, nil, label, btn) listContainer.Add(ct)
o.(*fyne.Container).Add(row) }
})
go func() { go func() {
for range time.Tick(time.Second) { for range time.Tick(time.Second) {
@ -104,31 +67,25 @@ func main() {
} }
}() }()
refresh_button := widget.NewButtonWithIcon("Refresh", theme.ViewRefreshIcon(), func() { refresh_button := widget.NewButton("Refresh", func() {
println("Refresh") println("Refresh")
}) })
upall_button := widget.NewButtonWithIcon("Update All", theme.DownloadIcon(), func() { upall_button := widget.NewButton("Update All", func() {
println("Update All") println("Update All")
}) })
about_button := widget.NewButtonWithIcon("About", theme.InfoIcon(), func() { about_button := widget.NewButton("About", func() {
println("About") println("About")
}) })
settings_button := widget.NewButtonWithIcon("Settings", theme.SettingsIcon(), func() { settings_button := widget.NewButton("Settings", func() {
println("Settings") println("Settings")
}) })
toprow := container.NewVBox(container.NewHBox(refresh_button, upall_button, toprow := container.NewHBox(refresh_button, upall_button, clock, layout.NewSpacer(), about_button, settings_button)
clock, layout.NewSpacer(), about_button, settings_button),
widget.NewSeparator())
c := container.New( c := container.New(layout.NewVBoxLayout(), toprow, widget.NewSeparator(), listContainer)
layout.NewBorderLayout(toprow, nil, nil, nil),
toprow,
container.NewStack(list),
)
w.SetContent(c) w.SetContent(c)