app: add a basic browse tab UI
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
86f9ea5a28
commit
8c72ee9443
@ -65,8 +65,33 @@ func makeToolbar() *widget.Toolbar {
|
|||||||
|
|
||||||
func makeTabs() *container.AppTabs {
|
func makeTabs() *container.AppTabs {
|
||||||
tabs := container.NewAppTabs(
|
tabs := container.NewAppTabs(
|
||||||
container.NewTabItem("xkcd comic", widget.NewLabel("Latest comic...")),
|
container.NewTabItem("xkcd comic", makeBrowseUI()),
|
||||||
container.NewTabItem("what if?", widget.NewLabel("serious answers to absurd questions and absurd advice for common concerns from xkcd's Randall Munroe")),
|
container.NewTabItem("what if?", widget.NewLabel("serious answers to absurd questions and absurd advice for common concerns from xkcd's Randall Munroe")),
|
||||||
)
|
)
|
||||||
return tabs
|
return tabs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func makeBrowseUI() *fyne.Container {
|
||||||
|
// container for the image and surrounding elements
|
||||||
|
imgC := container.New(
|
||||||
|
layout.NewHBoxLayout(),
|
||||||
|
widget.NewButton("previous", func() {
|
||||||
|
log.Println("Previous comic")
|
||||||
|
}),
|
||||||
|
layout.NewSpacer(),
|
||||||
|
widget.NewLabel("img placeholder"),
|
||||||
|
layout.NewSpacer(),
|
||||||
|
widget.NewButton("next", func() {
|
||||||
|
log.Println("Next comic")
|
||||||
|
}))
|
||||||
|
|
||||||
|
browseTabLabel := "Latest comic..."
|
||||||
|
browseUI := container.New(
|
||||||
|
layout.NewVBoxLayout(),
|
||||||
|
widget.NewLabel(browseTabLabel),
|
||||||
|
layout.NewSpacer(),
|
||||||
|
imgC,
|
||||||
|
)
|
||||||
|
|
||||||
|
return browseUI
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user