mirror of
https://github.com/Kyren223/eko.git
synced 2026-07-16 16:41:03 +00:00
Fixed overflow in frequency list
This commit is contained in:
@@ -87,7 +87,7 @@ func New(network snowflake.ID) Model {
|
||||
name.FocusedStyle = fieldFocusedStyle
|
||||
name.BlurredStyle = fieldBlurredStyle
|
||||
name.ErrorStyle = lipgloss.NewStyle().Foreground(colors.Error)
|
||||
name.Input.CharLimit = width
|
||||
name.Input.CharLimit = packet.MaxFrequencyName
|
||||
name.Focus()
|
||||
name.Input.Validate = func(s string) error {
|
||||
if strings.TrimSpace(s) == "" {
|
||||
@@ -116,7 +116,7 @@ func New(network snowflake.ID) Model {
|
||||
lastColor: lipgloss.Color("#" + color.Value()),
|
||||
perms: packet.PermReadWrite,
|
||||
create: blurredCreate,
|
||||
network: network,
|
||||
network: network,
|
||||
|
||||
nameWidth: nameWidth,
|
||||
precomputedStyle: lipgloss.NewStyle().Width(nameWidth / 3),
|
||||
|
||||
@@ -19,7 +19,7 @@ var (
|
||||
nameStyle = lipgloss.NewStyle().
|
||||
Margin(0, 0, 1).Padding(1).Width(width).Align(lipgloss.Center).
|
||||
Border(lipgloss.ThickBorder(), false, false, true)
|
||||
margin = 3
|
||||
margin = 2
|
||||
frequencyStyle = lipgloss.NewStyle().
|
||||
Margin(0, margin).Padding(0, 1).Width(width - (margin * 2)).
|
||||
Align(lipgloss.Left)
|
||||
@@ -67,7 +67,11 @@ func (m Model) View() string {
|
||||
if m.index == i {
|
||||
frequencyStyle = frequencyStyle.Background(colors.BackgroundHighlight)
|
||||
}
|
||||
builder.WriteString(frequencyStyle.Render(symbol + frequency.Name))
|
||||
|
||||
frequencyName := lipgloss.NewStyle().
|
||||
MaxWidth(width - (margin * 2) - 4).
|
||||
Render(frequency.Name)
|
||||
builder.WriteString(frequencyStyle.Render(symbol + frequencyName))
|
||||
builder.WriteString("\n")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user