@@ -14,9 +14,9 @@ func HighlightRange(t *widget.TextGrid, blockMode bool, startRow, startCol, endR
14
14
// Check if already highlighted
15
15
if h , ok := cell .Style .(* TermTextGridStyle ); ! ok {
16
16
if cell .Style != nil {
17
- cell .Style = NewTermTextGridStyle (cell .Style .TextColor (), cell .Style .BackgroundColor (), bitmask , false )
17
+ cell .Style = NewTermTextGridStyle (cell .Style .TextColor (), cell .Style .BackgroundColor (), bitmask , false , false , false )
18
18
} else {
19
- cell .Style = NewTermTextGridStyle (nil , nil , bitmask , false )
19
+ cell .Style = NewTermTextGridStyle (nil , nil , bitmask , false , false , false )
20
20
}
21
21
cell .Style .(* TermTextGridStyle ).Highlighted = true
22
22
@@ -173,6 +173,8 @@ type TermTextGridStyle struct {
173
173
Highlighted bool
174
174
BlinkEnabled bool
175
175
Blink bool
176
+ IsBold bool
177
+ IsUnderlined bool
176
178
}
177
179
178
180
// TextColor returns the color of the text, depending on whether it is highlighted.
@@ -197,6 +199,16 @@ func (h *TermTextGridStyle) BackgroundColor() color.Color {
197
199
return h .OriginalBackgroundColor
198
200
}
199
201
202
+ // Bold is the text bold or not.
203
+ func (h * TermTextGridStyle ) Bold () bool {
204
+ return h .IsBold
205
+ }
206
+
207
+ // Underlined is the text underlined or not.
208
+ func (h * TermTextGridStyle ) Underlined () bool {
209
+ return h .IsUnderlined
210
+ }
211
+
200
212
// HighlightOption defines a function type that can modify a TermTextGridStyle.
201
213
type HighlightOption func (h * TermTextGridStyle )
202
214
@@ -214,7 +226,7 @@ type HighlightOption func(h *TermTextGridStyle)
214
226
// Returns:
215
227
//
216
228
// A pointer to a TermTextGridStyle initialized with the provided colors and inversion settings.
217
- func NewTermTextGridStyle (fg , bg color.Color , bitmask byte , blinkEnabled bool ) widget.TextGridStyle {
229
+ func NewTermTextGridStyle (fg , bg color.Color , bitmask byte , blinkEnabled , bold , underlined bool ) widget.TextGridStyle {
218
230
// calculate the inverted colors
219
231
var invertedFg , invertedBg color.Color
220
232
if fg == nil {
@@ -236,6 +248,8 @@ func NewTermTextGridStyle(fg, bg color.Color, bitmask byte, blinkEnabled bool) w
236
248
Highlighted : false ,
237
249
BlinkEnabled : blinkEnabled ,
238
250
Blink : false ,
251
+ IsBold : bold ,
252
+ IsUnderlined : underlined ,
239
253
}
240
254
}
241
255
0 commit comments