Skip to content
Snippets Groups Projects
headerView.go 684 B
Newer Older
  • Learn to ignore specific revisions
  • Malte Bauch's avatar
    Malte Bauch committed
    import "github.com/rivo/tview"
    
    
    var goSDNAscii string = `			 ____  ____  _   _
       __ _  ___/ ___||  _ \| \ | |
      / _  |/ _ \___ \| | | |  \| |
     | (_| | (_) |__) | |_| | |\  |
      \__  |\___/____/|____/|_| \_|
      |___/                        `
    
    type HeaderView struct {
    
    Malte Bauch's avatar
    Malte Bauch committed
    	headerFlex *tview.Flex
    
    	titleView  *tview.TextView
    }
    
    func NewHeaderView() *HeaderView {
    	//TODO: change to uses FlexBox if there is more to display in the header
    
    Malte Bauch's avatar
    Malte Bauch committed
    	hv := &HeaderView{
    
    		titleView: tview.NewTextView(),
    	}
    
    Malte Bauch's avatar
    Malte Bauch committed
    	hv.titleView.
    
    		SetText(goSDNAscii).
    		SetTextAlign(tview.AlignCenter).
    		SetBorder(true)
    
    
    Malte Bauch's avatar
    Malte Bauch committed
    	return hv
    
    Malte Bauch's avatar
    Malte Bauch committed
    func (hv *HeaderView) GetContent() tview.Primitive {
    	return hv.titleView