gizak / termui

Golang terminal dashboard
MIT License
13.07k stars 783 forks source link

selected rows in list should merge style with inline style #230

Open jigish opened 5 years ago

jigish commented 5 years ago

List SelectedRowStyle should be merged with inline styles. This change does two things:

  1. Use ParseStyles for SelectedRowStyle.
  2. Merge modifiers in readStyle instead of inline styles clearing any default modifiers.

I'm not sure if it was intended for SelectedRowStyle to completely override the inline styles. If it was, please feel free to disregard and reject this pull request 😃

cjbassi commented 5 years ago

Thanks for bringing this up. So I think I intentionally made the colors override instead of merge, but now I'm trying to figure out which is the better solution. I guess it would be good to make that an option for the user? But then we would probably have to add an argument to ParseStyles which might be a breaking change unless we do it with interface{}s. And then we have to figure out whether inline colors should be merged vs overridden like with the paragraph widget etc. So I'm not totally sure what the best method here is :smiley: Probably best to get more opinions.