Detail panes: keep a margin between the poster and the text
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
coverGapCols = 2 // empty columns between the poster and the text left of it
|
||||
coverGapRows = 1 // empty rows between the poster and the text below it
|
||||
minCoverRows = 6 // a smaller poster is not worth showing
|
||||
minCoverCols = 8
|
||||
minTextRows = 6 // the poster never takes these rows from the text
|
||||
@@ -91,7 +93,9 @@ func (d *detailPane) Draw(screen tcell.Screen) {
|
||||
|
||||
narrow, rows := w, 0
|
||||
if d.coverW > 0 {
|
||||
narrow, rows = w-d.coverW-1, d.coverH // one column of space left of the poster
|
||||
// The text keeps clear of the poster: columns to its left, and one more
|
||||
// line is wrapped narrow so nothing sits right under it.
|
||||
narrow, rows = w-d.coverW-coverGapCols, d.coverH+coverGapRows
|
||||
}
|
||||
if !d.laidOut.valid || d.laidOut.width != w || d.laidOut.narrow != narrow || d.laidOut.rows != rows {
|
||||
d.laidOut.width, d.laidOut.narrow, d.laidOut.rows, d.laidOut.valid = w, narrow, rows, true
|
||||
|
||||
Reference in New Issue
Block a user