Skip to content

Commit

Permalink
Merge pull request #37 from termkit/dynamic-resize-for-trigger-tab
Browse files Browse the repository at this point in the history
Dynamic resize for keys
  • Loading branch information
canack authored Jan 24, 2024
2 parents 5821690 + d08b74e commit 90338d0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/terminal/handler/ghtrigger/ghtrigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,13 @@ func (m *ModelGithubTrigger) View() string {
newTableColumns := tableColumnsTrigger
widthDiff := termWidth - tableWidth
if widthDiff > 0 {
newTableColumns[4].Width += widthDiff - 17
keyWidth := &newTableColumns[2].Width
valueWidth := &newTableColumns[4].Width

*valueWidth += widthDiff - 17
if *valueWidth%2 == 0 {
*keyWidth = *valueWidth / 2
}
m.tableTrigger.SetColumns(newTableColumns)
m.tableTrigger.SetHeight(termHeight - 17)
}
Expand Down

0 comments on commit 90338d0

Please sign in to comment.