Skip to content

Commit

Permalink
InfoText->DetailsText
Browse files Browse the repository at this point in the history
  • Loading branch information
harakeishi committed Apr 21, 2024
1 parent d036d22 commit 36ef2e5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions trv/trv.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ type Trv struct {
Searcher *tview.InputField
Pages *tview.Pages
InfoLayout *tview.Grid
InfoText *tview.TextView
DetailsText *tview.TextView
Info *tview.TextView
App *tview.Application
Layout *tview.Grid
Modal tview.Primitive
Expand Down Expand Up @@ -54,7 +55,7 @@ func (t *Trv) Init() error {
}
t.setSearcher()
t.setTableViewer()
t.setInfoText()
t.setDetailsText()
t.setInfoLayout()
t.setLayout()
t.setForm()
Expand Down Expand Up @@ -153,7 +154,7 @@ func (t *Trv) setTableViewer() {
t.TableViewer.SetSelectedFunc(func(row int, column int) {
cell := t.TableViewer.GetCell(row, column)
info := cell.GetReference().(Info)
t.InfoText.SetText(fmt.Sprintf("table name: %s\ndetails: %s\n\ncolumn: %s\ntype: %s\ncomment: %s", info.Table.Name, info.Table.Description, info.Column.Name, info.Column.Type, info.Column.Comment))
t.DetailsText.SetText(fmt.Sprintf("table name: %s\ndetails: %s\n\ncolumn: %s\ntype: %s\ncomment: %s", info.Table.Name, info.Table.Description, info.Column.Name, info.Column.Type, info.Column.Comment))
})
}

Expand All @@ -169,9 +170,9 @@ func (t *Trv) setSearcher() {
}

// set Source Info Text
func (t *Trv) setInfoText() {
t.InfoText = tview.NewTextView()
t.InfoText.SetText("")
func (t *Trv) setDetailsText() {
t.DetailsText = tview.NewTextView()
t.DetailsText.SetText("")
}

// set new source form
Expand Down Expand Up @@ -252,7 +253,7 @@ func (t *Trv) setInfoLayout() {
t.InfoLayout = tview.NewGrid()
t.InfoLayout.SetTitle("details").SetBorder(true)
t.InfoLayout.SetSize(5, 5, 0, 0).
AddItem(t.InfoText, 0, 0, 5, 5, 0, 0, true)
AddItem(t.DetailsText, 0, 0, 5, 5, 0, 0, true)
t.InfoLayout.SetOffset(1, 1)
}

Expand Down

0 comments on commit 36ef2e5

Please sign in to comment.