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
|
package xkcdreader
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
"time"
|
||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/app"
|
"fyne.io/fyne/v2/app"
|
||||||
@ -77,7 +79,7 @@ func makeToolbar() *widget.Toolbar {
|
|||||||
|
|
||||||
func makeTabs() *container.AppTabs {
|
func makeTabs() *container.AppTabs {
|
||||||
tabs := container.NewAppTabs(
|
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.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()),
|
container.NewTabItemWithIcon("search", theme.SearchIcon(), makeSearchTab()),
|
||||||
)
|
)
|
||||||
@ -98,12 +100,23 @@ func makeBrowseUI() *fyne.Container {
|
|||||||
log.Println("Next comic")
|
log.Println("Next comic")
|
||||||
}))
|
}))
|
||||||
|
|
||||||
browseTabLabel := "Latest comic..."
|
|
||||||
browseUI := container.New(
|
browseUI := container.New(
|
||||||
layout.NewVBoxLayout(),
|
layout.NewVBoxLayout(),
|
||||||
widget.NewLabel(browseTabLabel),
|
|
||||||
layout.NewSpacer(),
|
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,
|
imgC,
|
||||||
|
layout.NewSpacer(),
|
||||||
|
container.NewCenter(
|
||||||
|
&widget.Label{Text: "Comic 'title text'", TextStyle: fyne.TextStyle{Italic: true}},
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
return browseUI
|
return browseUI
|
||||||
|
Loading…
Reference in New Issue
Block a user