@@ -15,9 +15,9 @@ func HighlightRange(t *TermGrid, blockMode bool, startRow, startCol, endRow, end
1515 // Check if already highlighted
1616 if h , ok := cell .Style .(* TermTextGridStyle ); ! ok {
1717 if cell .Style != nil {
18- cell .Style = NewTermTextGridStyle (cell .Style .TextColor (), cell .Style .BackgroundColor (), bitmask , false )
18+ cell .Style = NewTermTextGridStyle (cell .Style .TextColor (), cell .Style .BackgroundColor (), bitmask , false , false , false )
1919 } else {
20- cell .Style = NewTermTextGridStyle (nil , nil , bitmask , false )
20+ cell .Style = NewTermTextGridStyle (nil , nil , bitmask , false , false , false )
2121 }
2222 cell .Style .(* TermTextGridStyle ).Highlighted = true
2323
@@ -174,6 +174,8 @@ type TermTextGridStyle struct {
174174 InvertedBackgroundColor color.Color
175175 Highlighted bool
176176 BlinkEnabled bool
177+ IsBold bool
178+ IsUnderlined bool
177179}
178180
179181// Style is the text style a cell should use.
@@ -197,6 +199,16 @@ func (h *TermTextGridStyle) BackgroundColor() color.Color {
197199 return h .OriginalBackgroundColor
198200}
199201
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+
200212// HighlightOption defines a function type that can modify a TermTextGridStyle.
201213type HighlightOption func (h * TermTextGridStyle )
202214
@@ -214,7 +226,7 @@ type HighlightOption func(h *TermTextGridStyle)
214226// Returns:
215227//
216228// 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 {
218230 // calculate the inverted colors
219231 var invertedFg , invertedBg color.Color
220232 if fg == nil {
@@ -235,6 +247,8 @@ func NewTermTextGridStyle(fg, bg color.Color, bitmask byte, blinkEnabled bool) w
235247 InvertedBackgroundColor : invertedBg ,
236248 Highlighted : false ,
237249 BlinkEnabled : blinkEnabled ,
250+ IsBold : bold ,
251+ IsUnderlined : underlined ,
238252 }
239253}
240254
0 commit comments