-
-
Notifications
You must be signed in to change notification settings - Fork 598
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
padding reveals an area without background color #833
Comments
I tried to reproduce this but couldn't. Please post a small code snippet that reproduces this issue. |
@tcurdt Sometimes this can be caused by certain containers not having their base I have had to hack a method to allow this to be modified so that I could ensure that existing, and any custom primitives I developed I could make sure that it cleared the background or not... My fork which has the method to set this property... The current part of the draw function that uses this when filling backgrounds in why this property is not modifiable externally I am not sure, but is very useful when developing custom primitives background := def.Background(b.backgroundColor).Reverse(b.reverse)
if !b.dontClear {
for y := b.y; y < b.y+b.height; y++ {
for x := b.x; x < b.x+b.width; x++ {
screen.SetContent(x, y, ' ', nil, background)
}
}
} |
Here is a snippet from the code.
Let me know if that already helps. |
@tcurdt ya your code doesnt really help, because i am already pretty sure of the problem... you need to make dontClear available to your code because Flex is one of the primitives that defines I do not agree with the idea in the comment for NewFlex stating that you need to define nil flex areas with an empty box to set a bG color... specifically because of what you have experienced without having anything to do with nil flex areas... // Note that Box, the superclass of Flex, will not clear its contents so that
// any nil flex items will leave their background unchanged. To clear a Flex's
// background before any items are drawn, set it to a box with the desired
// color:
//
func NewFlex() *Flex {
f := &Flex{
direction: FlexColumn,
}
f.Box = NewBox()
f.Box.dontClear = true
return f
} I already provided the link to what needs to be added to make this modifiable from outside tview |
@tcurdt @rivo @tcurdt layoutCol2 := tview.NewFlex().
SetDirection(tview.FlexRow).
AddItem(identificationTextview, 3, 0, false).
AddItem(valueInput, 1, 0, false).
AddItem(detailsTextview, 6, 0, false)
layoutCol2.SetBorder(true)
layoutCol2.SetBorderPadding(0, 0, 1, 1)
// dontClear disables bg wipes, so set to false for this padding on a flex
// previous comments show where this is set to `true`
layoutCol2.SetDontClear(false) |
@digitallyserviced So far it feels a little unintuitive having to bother with this though. |
i agree but there are a lot of things in life that are unintitive or bothersome... and you're still alive |
Unfortunately setting a padding reveals an area where I cannot set a background color.
Here the left and right padding is just white instead of black.
Why isn't the background color being used?
Originally posted by @tcurdt in #831 (comment)
The text was updated successfully, but these errors were encountered: