diff options
Diffstat (limited to '')
-rw-r--r-- | gui.go | 34 |
1 files changed, 28 insertions, 6 deletions
@@ -18,6 +18,10 @@ import ( //go:generate goversioninfo -64 -o resource_amd64.syso res/versioninfo.json +/* + * Embedded Resources + */ + //go:embed res/monitor_48.png var icon []byte @@ -25,6 +29,10 @@ var icon []byte var icomoon []byte var icomoonFI *g.FontInfo +/* + * Data / State + */ + type entryCfg struct { inputFile string target string @@ -59,6 +67,11 @@ var ( entries []entryCfg ) +/* + * Grid Layout + */ +// GridLayout is used to calculate the maximum width for labels, +// so that the following widgets all start at the same offset. type GridLayout struct { widgets []g.Widget labels []*g.LabelWidget @@ -103,6 +116,10 @@ func (grid *GridLayout) Build() { } } +/* + * Further additions to Giu + */ + func Layout(widgets ...g.Widget) g.Layout { return widgets } @@ -115,8 +132,17 @@ func PopID() g.Widget { return g.Custom(imgui.PopID) } -const comboSize = 120 -const chooseStr = "Wähle..." +func shouldQuit() { + g.Context.GetPlatform().SetShouldStop(true) +} + +/* + * Putting together the GUI + */ +const ( + comboSize = 120 + chooseStr = "Wähle..." +) func buildEntry(idx int) g.Widget { entry := &entries[idx] @@ -183,10 +209,6 @@ func entryBuilder() g.Widget { }) } -func shouldQuit() { - g.Context.GetPlatform().SetShouldStop(true) -} - func loop() { g.SingleWindow().Layout( g.Align(g.AlignCenter).To(g.Label("Engarde Importer")), |