From 42149062c4331d706605b72e3911987b1a286531 Mon Sep 17 00:00:00 2001 From: harakeishi Date: Fri, 4 Nov 2022 15:08:33 +0900 Subject: [PATCH] =?UTF-8?q?details=E3=81=AE=E8=A1=A8=E7=A4=BA=E5=BD=A2?= =?UTF-8?q?=E5=BC=8F=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trv/trv.go | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/trv/trv.go b/trv/trv.go index f9b8d3c..486e607 100644 --- a/trv/trv.go +++ b/trv/trv.go @@ -20,7 +20,6 @@ type Trv struct { Pages *tview.Pages InfoLayout *tview.Grid InfoText *tview.TextView - InfoTable *tview.Table App *tview.Application Layout *tview.Grid Modal tview.Primitive @@ -48,7 +47,6 @@ func (t *Trv) Init() error { t.setSearcher() t.setTableViewer() t.setInfoText() - t.setInfoTable() t.setInfoLayout() t.setLayout() t.setForm() @@ -154,18 +152,6 @@ func (t *Trv) setInfoText() { t.InfoText.SetText("") } -// set Source Info Table -func (t *Trv) setInfoTable() { - t.InfoTable = tview.NewTable(). - SetBorders(true). - SetCell(0, 0, tview.NewTableCell("column").SetTextColor(tcell.ColorYellow).SetAlign(tview.AlignCenter)). - SetCell(0, 1, tview.NewTableCell("type").SetTextColor(tcell.ColorYellow).SetAlign(tview.AlignCenter)). - SetCell(0, 2, tview.NewTableCell("comment").SetTextColor(tcell.ColorYellow).SetAlign(tview.AlignCenter)). - SetCell(1, 0, tview.NewTableCell("")). - SetCell(1, 1, tview.NewTableCell("")). - SetCell(1, 2, tview.NewTableCell("")) -} - // set new source form func (t *Trv) setForm() { var source Source @@ -223,8 +209,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, 2, 5, 0, 0, true). - AddItem(t.InfoTable, 2, 0, 3, 5, 2, 5, true) + AddItem(t.InfoText, 0, 0, 5, 5, 0, 0, true) t.InfoLayout.SetOffset(1, 1) } @@ -250,14 +235,7 @@ func (t *Trv) filterList() { for _, v := range t.Tables { for a, b := range v.Columns { if v.getFullName(a) == s1 { - t.InfoText.SetText(fmt.Sprintf("table name: %s\ndetails: %s", v.Name, v.Description)) - t.InfoTable.RemoveRow(1) - t.InfoTable.SetCell(1, 0, tview.NewTableCell(b.Name)) - t.InfoTable.SetCell(1, 1, tview.NewTableCell(b.Type)) - comment := tview.NewTableCell(b.Comment) - comment.SetMaxWidth(10) - comment.SetExpansion(10) - t.InfoTable.SetCell(1, 2, comment) + t.InfoText.SetText(fmt.Sprintf("table name: %s\ndetails: %s\n\ncolumn: %s\ntype: %s\ncomment: %s", v.Name, v.Description, b.Name, b.Type, b.Comment)) } } }