feat: unified navigation
fix: install script copying build binary chore: updated readme
This commit is contained in:
@@ -10,34 +10,28 @@ import (
|
||||
)
|
||||
|
||||
// RenderCue renders a single cue with optional highlighting
|
||||
func RenderCue(cue *srt.Cue, isCurrent, isSelected bool, width int) string {
|
||||
func RenderCue(cue *srt.Cue, isActive bool, width int) string {
|
||||
// Format timestamp
|
||||
timestamp := formatTimestamp(cue.Start, cue.End)
|
||||
|
||||
// Apply styles based on state
|
||||
var textStyle, timestampStyle lipgloss.Style
|
||||
if isSelected {
|
||||
// Selected cue (navigation cursor) - use accent color
|
||||
textStyle = ui.SelectedCueStyle
|
||||
timestampStyle = ui.SelectedTimestampStyle
|
||||
} else if isCurrent {
|
||||
// Current cue (playback position)
|
||||
textStyle = ui.CurrentCueStyle
|
||||
timestampStyle = ui.TimestampStyle
|
||||
var prefix string
|
||||
|
||||
if isActive {
|
||||
// Active cue (playback position + navigation cursor)
|
||||
textStyle = ui.ActiveCueStyle
|
||||
timestampStyle = ui.ActiveTimestampStyle
|
||||
prefix = "> "
|
||||
} else {
|
||||
textStyle = ui.BaseStyle
|
||||
timestampStyle = ui.TimestampStyle
|
||||
prefix = " "
|
||||
}
|
||||
|
||||
timestampStr := timestampStyle.Render(timestamp)
|
||||
textStr := textStyle.Render(cue.Text)
|
||||
|
||||
// Add selection indicator
|
||||
prefix := " "
|
||||
if isSelected {
|
||||
prefix = "> "
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s%s\n%s%s\n", prefix, timestampStr, prefix, textStr)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user