Compare commits
2 commits
d08af46525
...
c17f2d202b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c17f2d202b | ||
![]() |
5ace5f0c97 |
2 changed files with 71 additions and 28 deletions
|
@ -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 rexclient
|
rm -f $(NAME)
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -31,6 +32,39 @@ 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")
|
||||||
|
@ -40,26 +74,29 @@ 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))
|
||||||
|
|
||||||
myList := []MyStruct{
|
list := widget.NewList(
|
||||||
{"AtlasLoot"},
|
func() int {
|
||||||
{"Bartender4"},
|
return len(myList)
|
||||||
{"Deadly Boss Mods"},
|
},
|
||||||
}
|
func() fyne.CanvasObject {
|
||||||
|
btn := widget.NewButton("", func() {})
|
||||||
|
label := widget.NewLabel("")
|
||||||
|
|
||||||
listContainer := container.NewVBox()
|
return container.NewBorder(nil, nil, label, btn)
|
||||||
|
},
|
||||||
|
func(i widget.ListItemID, o fyne.CanvasObject) {
|
||||||
|
o.(*fyne.Container).RemoveAll()
|
||||||
|
|
||||||
for _, item := range myList {
|
btn := widget.NewButtonWithIcon("Download", theme.DownloadIcon(), func() {
|
||||||
current := item
|
myList[i].Download()
|
||||||
namelabel := widget.NewLabel(current.Name)
|
|
||||||
dlbutton := widget.NewButton("Download", func() {
|
|
||||||
current.Download()
|
|
||||||
})
|
})
|
||||||
dlbutton.Importance = widget.LowImportance
|
btn.Importance = widget.LowImportance
|
||||||
|
|
||||||
spacer := layout.NewSpacer()
|
label := widget.NewLabel(myList[i].Name)
|
||||||
ct := container.NewHBox(namelabel, spacer, dlbutton)
|
|
||||||
listContainer.Add(ct)
|
row := container.NewBorder(nil, nil, label, btn)
|
||||||
}
|
o.(*fyne.Container).Add(row)
|
||||||
|
})
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
for range time.Tick(time.Second) {
|
for range time.Tick(time.Second) {
|
||||||
|
@ -67,25 +104,31 @@ func main() {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
refresh_button := widget.NewButton("Refresh", func() {
|
refresh_button := widget.NewButtonWithIcon("Refresh", theme.ViewRefreshIcon(), func() {
|
||||||
println("Refresh")
|
println("Refresh")
|
||||||
})
|
})
|
||||||
|
|
||||||
upall_button := widget.NewButton("Update All", func() {
|
upall_button := widget.NewButtonWithIcon("Update All", theme.DownloadIcon(), func() {
|
||||||
println("Update All")
|
println("Update All")
|
||||||
})
|
})
|
||||||
|
|
||||||
about_button := widget.NewButton("About", func() {
|
about_button := widget.NewButtonWithIcon("About", theme.InfoIcon(), func() {
|
||||||
println("About")
|
println("About")
|
||||||
})
|
})
|
||||||
|
|
||||||
settings_button := widget.NewButton("Settings", func() {
|
settings_button := widget.NewButtonWithIcon("Settings", theme.SettingsIcon(), func() {
|
||||||
println("Settings")
|
println("Settings")
|
||||||
})
|
})
|
||||||
|
|
||||||
toprow := container.NewHBox(refresh_button, upall_button, clock, layout.NewSpacer(), about_button, settings_button)
|
toprow := container.NewVBox(container.NewHBox(refresh_button, upall_button,
|
||||||
|
clock, layout.NewSpacer(), about_button, settings_button),
|
||||||
|
widget.NewSeparator())
|
||||||
|
|
||||||
c := container.New(layout.NewVBoxLayout(), toprow, widget.NewSeparator(), listContainer)
|
c := container.New(
|
||||||
|
layout.NewBorderLayout(toprow, nil, nil, nil),
|
||||||
|
toprow,
|
||||||
|
container.NewStack(list),
|
||||||
|
)
|
||||||
|
|
||||||
w.SetContent(c)
|
w.SetContent(c)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue