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