Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always fill Box background #395

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Always fill Box background #395

wants to merge 1 commit into from

Conversation

tslocum
Copy link
Contributor

@tslocum tslocum commented Jan 28, 2020

This resolves rendering issues with TextViews which have their background
color set to ColorDefault.

This resolves rendering issues with TextViews which have their background
color set to ColorDefault.
@tslocum
Copy link
Contributor Author

tslocum commented Jan 28, 2020

Without this change, when setting the content of a TextView with its background set to ColorDefault to a shorter length than it previously was, anywhere not drawn upon with new text will continue displaying the previous text.

@rivo
Copy link
Owner

rivo commented Feb 19, 2020

Can you give an example where ColorDefault is a good idea for the background colour of a TextView?

@tslocum
Copy link
Contributor Author

tslocum commented Feb 20, 2020

Setting the foreground and background to ColorDefault allows the usage of users' default terminal colors. Filling with a solid color instead may affect terminal transparency (Alacritty+Linux) and/or not combine aesthetically with users' terminal colors, as they are unknown. It's best to have a choice of whether or not to specify a set of colors to use, which this PR allows. Using the colors chosen by the user is simple:

tview.Styles.TitleColor = tcell.ColorDefault
tview.Styles.BorderColor = tcell.ColorDefault
tview.Styles.PrimaryTextColor = tcell.ColorDefault
tview.Styles.PrimitiveBackgroundColor = tcell.ColorDefault

@ajisaac
Copy link

ajisaac commented Mar 1, 2020

I also have this issue, where I want the background to use ColorDefault to have a semi transparent background, but then it won't update those portions of the widget.

@problame
Copy link

Also hit this issue, with the same motivation as @tslocum : the tui we're building ( zrepl/zrepl#297 ) is monochromatic and thus we want to use the user's default terminal emulator colors. The effect for the end user is that the tui feels like it automatically respects the user's preference for light / dark terminal emulator theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants