app: add stuff to 'browse' tab
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
37bdd08e41
commit
53be19912a
@ -4,7 +4,9 @@
|
||||
package xkcdreader
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/app"
|
||||
@ -77,7 +79,7 @@ func makeToolbar() *widget.Toolbar {
|
||||
|
||||
func makeTabs() *container.AppTabs {
|
||||
tabs := container.NewAppTabs(
|
||||
container.NewTabItem("xkcd comic", makeBrowseUI()),
|
||||
container.NewTabItem("browse", makeBrowseUI()),
|
||||
container.NewTabItem("what if?", widget.NewLabel("serious answers to absurd questions and absurd advice for common concerns from xkcd's Randall Munroe")),
|
||||
container.NewTabItemWithIcon("search", theme.SearchIcon(), makeSearchTab()),
|
||||
)
|
||||
@ -98,12 +100,23 @@ func makeBrowseUI() *fyne.Container {
|
||||
log.Println("Next comic")
|
||||
}))
|
||||
|
||||
browseTabLabel := "Latest comic..."
|
||||
browseUI := container.New(
|
||||
layout.NewVBoxLayout(),
|
||||
widget.NewLabel(browseTabLabel),
|
||||
layout.NewSpacer(),
|
||||
container.NewCenter(
|
||||
container.NewVBox(
|
||||
&widget.Label{Text: "published on " + fmt.Sprint(time.Now().Date()), TextStyle: fyne.TextStyle{Italic: true}},
|
||||
container.NewHBox(
|
||||
&widget.Label{Text: "Comic Title", TextStyle: fyne.TextStyle{Bold: true}},
|
||||
&widget.Label{Text: "(#1234)", TextStyle: fyne.TextStyle{Monospace: true}},
|
||||
),
|
||||
),
|
||||
),
|
||||
imgC,
|
||||
layout.NewSpacer(),
|
||||
container.NewCenter(
|
||||
&widget.Label{Text: "Comic 'title text'", TextStyle: fyne.TextStyle{Italic: true}},
|
||||
),
|
||||
)
|
||||
|
||||
return browseUI
|
||||
|
Loading…
Reference in New Issue
Block a user