Skip to content

Commit

Permalink
maintenance(input(text)):, remove BackgroundStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
fzdwx committed Jun 7, 2023
1 parent 57aa8bf commit ef56197
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
1 change: 0 additions & 1 deletion components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func NewInput() *Input {
DefaultValueStyle: InputDefaultPlaceholderStyle,
PromptStyle: InputDefaultPromptStyle,
TextStyle: InputDefaultTextStyle,
BackgroundStyle: InputDefaultBackgroundStyle,
CursorStyle: InputDefaultCursorStyle,
FocusSymbolStyle: style.New(),
UnFocusSymbolStyle: style.New(),
Expand Down
11 changes: 4 additions & 7 deletions components/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ var (
InputDefaultPlaceholderStyle = style.New().Fg(color.Gray)
InputDefaultPromptStyle = style.New()
InputDefaultTextStyle = style.New()
InputDefaultBackgroundStyle = style.New()
InputDefaultCursorStyle = style.New()
cleanRequiredMsg = func(i int) func(t time.Time) tea.Msg {
return func(t time.Time) tea.Msg {
Expand Down Expand Up @@ -89,10 +88,9 @@ type (
FocusIntervalStyle *style.Style
UnFocusIntervalStyle *style.Style

TextStyle *style.Style
BackgroundStyle *style.Style
CursorStyle *style.Style
KeyMap InputKeyMap
TextStyle *style.Style
CursorStyle *style.Style
KeyMap InputKeyMap
}
)

Expand Down Expand Up @@ -193,9 +191,8 @@ func (i *Input) Init() tea.Cmd {
i.Model.EchoMode = textinput.EchoMode(i.EchoMode)
i.Model.EchoCharacter = i.EchoCharacter
i.Model.TextStyle = i.TextStyle.Inner()
i.Model.BackgroundStyle = i.BackgroundStyle.Inner()
i.Model.PlaceholderStyle = i.DefaultValueStyle.Inner()
i.Model.CursorStyle = i.CursorStyle.Inner()
i.Model.Cursor.Style = i.CursorStyle.Inner()
i.Model.CharLimit = i.CharLimit

return tea.Batch(textinput.Blink, func() tea.Msg {
Expand Down
7 changes: 0 additions & 7 deletions components/input/text/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ func WithTextStyle(style *style.Style) Option {
}
}

// WithBackgroundStyle set the background style
func WithBackgroundStyle(style *style.Style) Option {
return func(i *Text) {
i.inner.BackgroundStyle = style
}
}

// WithDefaultValueStyle set the default value style
func WithDefaultValueStyle(style *style.Style) Option {
return func(i *Text) {
Expand Down
1 change: 0 additions & 1 deletion components/input/text/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func New(ops ...Option) *Text {
i.inner.UnFocusIntervalStyle = style.Empty
i.inner.PromptStyle = components.InputDefaultPromptStyle
i.inner.TextStyle = components.InputDefaultTextStyle
i.inner.BackgroundStyle = components.InputDefaultBackgroundStyle
i.inner.DefaultValueStyle = components.InputDefaultPlaceholderStyle
i.inner.CursorStyle = components.InputDefaultCursorStyle
}
Expand Down

0 comments on commit ef56197

Please sign in to comment.