app: use 'latestComic' to set comic fields in UI
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-05-31 21:21:06 +02:00
parent 0b5559336e
commit 755a7c07b1
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -7,7 +7,6 @@ import (
"fmt" "fmt"
"log" "log"
"os" "os"
"time"
"fyne.io/fyne/v2" "fyne.io/fyne/v2"
"fyne.io/fyne/v2/app" "fyne.io/fyne/v2/app"
@ -125,17 +124,35 @@ func makeBrowseUI() *fyne.Container {
layout.NewSpacer(), layout.NewSpacer(),
container.NewCenter( container.NewCenter(
container.NewVBox( container.NewVBox(
&widget.Label{Text: "published on " + fmt.Sprint(time.Now().Date()), TextStyle: fyne.TextStyle{Italic: true}}, &widget.Label{
Text: "published on " +
fmt.Sprint(
latestComic.Year, "-",
latestComic.Month, "-",
latestComic.Day,
),
TextStyle: fyne.TextStyle{Italic: true},
},
container.NewHBox( container.NewHBox(
&widget.Label{Text: "Comic Title", TextStyle: fyne.TextStyle{Bold: true}}, &widget.Label{
&widget.Label{Text: "(#1234)", TextStyle: fyne.TextStyle{Monospace: true}}, Text: latestComic.Title,
TextStyle: fyne.TextStyle{Bold: true},
},
&widget.Label{
Text: "(#" + fmt.Sprint(latestComic.Num) + ")",
TextStyle: fyne.TextStyle{Monospace: true},
},
), ),
), ),
), ),
imgC, imgC,
layout.NewSpacer(), layout.NewSpacer(),
container.NewCenter( container.NewCenter(
&widget.Label{Text: "Comic 'title text'", TextStyle: fyne.TextStyle{Italic: true}}, // comic "alt text"
&widget.Label{
Text: latestComic.Alt,
TextStyle: fyne.TextStyle{Italic: true},
},
), ),
) )