gizak / termui

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

Refactor examples #215

Open cjbassi opened 5 years ago

cjbassi commented 5 years ago
keithknott26 commented 5 years ago

Would it be possible to include the use of a theme in your example? I see that termui.UseTheme is no longer available in v2 and above.

cjbassi commented 5 years ago

Sure, that could be added.

The wiki should have an explanation of how the theme works now too. But the basic idea is that the theme allows you to define global colors that are inherited by widgets that you create. So you should be able do something like

ui.Theme.Block.Title.Fg = ui.ColorBlue

and the rest of the widgets you create should default to having a blue title.

DannyBen commented 4 years ago

I agree with @keithknott26 - it would be nice to have an example with this piece of code, and a mention in the Theming section of the Wiki page