storiesListHeight calculates how many story lines fit in the panel. Must match the calculation in renderStoriesPanel.
()
| 2125 | // storiesListHeight calculates how many story lines fit in the panel. |
| 2126 | // Must match the calculation in renderStoriesPanel. |
| 2127 | func (a *App) storiesListHeight() int { |
| 2128 | fh := footerHeight |
| 2129 | if a.height < 12 { |
| 2130 | fh = 0 |
| 2131 | } |
| 2132 | contentHeight := a.height - a.effectiveHeaderHeight() - fh - 2 |
| 2133 | if a.isNarrowMode() { |
| 2134 | storiesHeight := max((contentHeight*40)/100, 5) |
| 2135 | return storiesHeight - 5 |
| 2136 | } |
| 2137 | return contentHeight - 5 |
| 2138 | } |
| 2139 | |
| 2140 | // adjustStoriesScroll ensures the selected index is visible in the scroll window. |
| 2141 | func (a *App) adjustStoriesScroll() { |