File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -105,18 +105,21 @@ impl DrawableComponent for TextInputComponent {
105
105
) -> Result < ( ) > {
106
106
if self . visible {
107
107
let mut txt: Vec < tui:: widgets:: Text > = Vec :: new ( ) ;
108
+
108
109
if self . msg . is_empty ( ) {
109
110
txt. push ( Text :: styled (
110
111
self . default_msg . as_str ( ) ,
111
112
self . theme . text ( false , false ) ,
112
113
) ) ;
113
114
} else {
115
+ let style = self . theme . text ( true , false ) ;
116
+
114
117
// the portion of the text before the cursor is added
115
118
// if the cursor is not at the first character
116
119
if self . cursor_position > 0 {
117
120
txt. push ( Text :: styled (
118
121
& self . msg [ ..self . cursor_position ] ,
119
- Style :: default ( ) ,
122
+ style ,
120
123
) ) ;
121
124
}
122
125
@@ -128,7 +131,7 @@ impl DrawableComponent for TextInputComponent {
128
131
// a whitespace is used to underline
129
132
" "
130
133
} ,
131
- Style :: default ( ) . modifier ( Modifier :: UNDERLINED ) ,
134
+ style . modifier ( Modifier :: UNDERLINED ) ,
132
135
) ) ;
133
136
134
137
// the final portion of the text is added if there is
@@ -137,7 +140,7 @@ impl DrawableComponent for TextInputComponent {
137
140
if pos < self . msg . len ( ) {
138
141
txt. push ( Text :: styled (
139
142
& self . msg [ pos..] ,
140
- Style :: default ( ) ,
143
+ style ,
141
144
) ) ;
142
145
}
143
146
}
You can’t perform that action at this time.
0 commit comments