@@ -13,52 +13,50 @@ import (
1313)
1414
1515var (
16- inputsTitleBarStyle = lipgloss .NewStyle ().
16+ inputsTitleLayout = lipgloss .NewStyle ().
1717 Padding (1 , 0 , 1 , 2 )
1818
1919 inputsTitleStyle = lipgloss .NewStyle ().
2020 Foreground (lipgloss .Color ("#FFFDF5" )).
2121 Background (lipgloss .Color ("#7653FF" )).
2222 Bold (true ).
23- Padding (0 , 1 )
23+ Padding (0 , 1 , 0 , 1 )
2424
25- inputsBlockStyle = lipgloss .NewStyle ().
25+ inputsBlockLayout = lipgloss .NewStyle ().
2626 Padding (0 , 0 , 1 , 0 )
2727
28- inputsTextStyle = lipgloss .NewStyle ().
29- Foreground (lipgloss.AdaptiveColor {Light : "#1A1A1A" , Dark : "#FFFDF5" }).
30- Bold (true )
31-
32- inputsTextNormalStyle = lipgloss .NewStyle ().
33- Foreground (lipgloss.AdaptiveColor {Light : "#313131" , Dark : "#DDDDDD" })
34-
3528 inputsCursorStyle = lipgloss .NewStyle ().
3629 Foreground (lipgloss .Color ("#25A065" ))
3730
38- inputsPromptNormalStyle = lipgloss .NewStyle ().
39- Padding (0 , 0 , 0 , 2 )
40-
41- inputsPromptStyle = lipgloss .NewStyle ().
31+ inputsPromptFocusStyle = lipgloss .NewStyle ().
4232 Border (lipgloss .NormalBorder (), false , false , false , true ).
4333 BorderForeground (lipgloss.AdaptiveColor {Light : "#F793FF" , Dark : "#AD58B4" }).
4434 Foreground (lipgloss.AdaptiveColor {Light : "#EE6FF8" , Dark : "#EE6FF8" }).
4535 Bold (true ).
4636 Padding (0 , 0 , 0 , 1 )
4737
48- inputsButtonBlockStyle = lipgloss .NewStyle ().
38+ inputsPromptNormalStyle = lipgloss .NewStyle ().
39+ Padding (0 , 0 , 0 , 2 )
40+
41+ inputsTextFocusStyle = lipgloss .NewStyle ().
42+ Foreground (lipgloss.AdaptiveColor {Light : "#1A1A1A" , Dark : "#FFFDF5" }).
43+ Bold (true )
44+
45+ inputsTextNormalStyle = lipgloss .NewStyle ().
46+ Foreground (lipgloss.AdaptiveColor {Light : "#313131" , Dark : "#DDDDDD" })
47+
48+ inputsButtonLayout = lipgloss .NewStyle ().
4949 Padding (2 , 0 , 1 , 2 )
5050
51- inputsButtonStyle = lipgloss .NewStyle ().
51+ inputsButtonFocusStyle = lipgloss .NewStyle ().
5252 Foreground (lipgloss .Color ("#FFFDF5" )).
5353 Background (lipgloss .Color ("#25A065" )).
5454 Padding (0 , 1 , 0 , 1 ).
5555 Bold (true )
5656
57- inputsButtonNormalStyle = lipgloss . NewStyle ().
57+ inputsButtonNormalStyle = inputsButtonFocusStyle . Copy ().
5858 Foreground (lipgloss.AdaptiveColor {Light : "#626262" , Dark : "#DDDDDD" }).
59- Background (lipgloss.AdaptiveColor {Light : "#DDDDDD" , Dark : "#626262" }).
60- Padding (0 , 1 , 0 , 1 ).
61- Bold (true )
59+ Background (lipgloss.AdaptiveColor {Light : "#DDDDDD" , Dark : "#626262" })
6260
6361 inputsErrLayout = lipgloss .NewStyle ().
6462 Padding (0 , 0 , 0 , 1 )
@@ -135,8 +133,8 @@ func (m inputsModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
135133 if i == m .focusIndex {
136134 // Set focused state
137135 cmds [i ] = m .inputs [i ].input .Focus ()
138- m .inputs [i ].input .PromptStyle = inputsPromptStyle
139- m .inputs [i ].input .TextStyle = inputsTextStyle
136+ m .inputs [i ].input .PromptStyle = inputsPromptFocusStyle
137+ m .inputs [i ].input .TextStyle = inputsTextFocusStyle
140138 continue
141139 }
142140 // Remove focused state
@@ -186,7 +184,7 @@ func (m inputsModel) View() string {
186184
187185 button := inputsButtonNormalStyle .Render ("➜ Submit" )
188186 if m .focusIndex == len (m .inputs ) {
189- button = inputsButtonStyle .Render ("➜ Submit" )
187+ button = inputsButtonFocusStyle .Render ("➜ Submit" )
190188 }
191189
192190 // check input value
@@ -200,10 +198,10 @@ func (m inputsModel) View() string {
200198 }
201199 }
202200
203- b .WriteString (inputsButtonBlockStyle .Render (button ))
201+ b .WriteString (inputsButtonLayout .Render (button ))
204202
205- title := inputsTitleBarStyle .Render (inputsTitleStyle .Render (m .title ))
206- inputs := inputsBlockStyle .Render (b .String ())
203+ title := inputsTitleLayout .Render (inputsTitleStyle .Render (m .title ))
204+ inputs := inputsBlockLayout .Render (b .String ())
207205
208206 return lipgloss .JoinVertical (lipgloss .Left , title , inputs )
209207}
@@ -224,8 +222,8 @@ func newInputsModel() inputsModel {
224222 case 0 :
225223 iwc .input .Prompt = "1. SCOPE "
226224 iwc .input .Placeholder = "Specifying place of the commit change."
227- iwc .input .PromptStyle = inputsPromptStyle
228- iwc .input .TextStyle = inputsTextStyle
225+ iwc .input .PromptStyle = inputsPromptFocusStyle
226+ iwc .input .TextStyle = inputsTextFocusStyle
229227 iwc .input .Focus ()
230228 iwc .checker = func (s string ) error {
231229 if strings .TrimSpace (s ) == "" {
0 commit comments