mirror of
https://github.com/rivo/tview.git
synced 2025-05-01 22:18:30 +08:00
This commit is contained in:
parent
7dd0754cc6
commit
967b863aac
@ -17,7 +17,10 @@ const logo = `
|
|||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
const subtitle = `tview - Rich Widgets for Terminal UIs`
|
const (
|
||||||
|
subtitle = `tview - Rich Widgets for Terminal UIs`
|
||||||
|
navigation = `Ctrl-N: Next slide Ctrl-P: Previous slide`
|
||||||
|
)
|
||||||
|
|
||||||
// Cover returns the cover page.
|
// Cover returns the cover page.
|
||||||
func Cover(nextSlide func()) (title string, content tview.Primitive) {
|
func Cover(nextSlide func()) (title string, content tview.Primitive) {
|
||||||
@ -37,10 +40,12 @@ func Cover(nextSlide func()) (title string, content tview.Primitive) {
|
|||||||
})
|
})
|
||||||
fmt.Fprint(logoBox, logo)
|
fmt.Fprint(logoBox, logo)
|
||||||
|
|
||||||
// Create a frame for the subtitle.
|
// Create a frame for the subtitle and navigation infos.
|
||||||
frame := tview.NewFrame(tview.NewBox()).
|
frame := tview.NewFrame(tview.NewBox()).
|
||||||
SetBorders(0, 0, 0, 0, 0, 0).
|
SetBorders(0, 0, 0, 0, 0, 0).
|
||||||
AddText(subtitle, true, tview.AlignCenter, tcell.ColorWhite)
|
AddText(subtitle, true, tview.AlignCenter, tcell.ColorWhite).
|
||||||
|
AddText("", true, tview.AlignCenter, tcell.ColorWhite).
|
||||||
|
AddText(navigation, true, tview.AlignCenter, tcell.ColorBlue)
|
||||||
|
|
||||||
// Create a Flex layout that centers the logo and subtitle.
|
// Create a Flex layout that centers the logo and subtitle.
|
||||||
flex := tview.NewFlex().
|
flex := tview.NewFlex().
|
||||||
|
Loading…
x
Reference in New Issue
Block a user