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

add setdontclear for cases where padding and borders on primitives #860

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

Conversation

digitallyserviced
Copy link
Contributor

@digitallyserviced digitallyserviced commented Jul 3, 2023

some primitives set Box.dontClear = true which screws up padding/borders that arent including a bg color in Flex and i believe Frame/Table. it definitely should be available outside regardless... it is not just here it becomes an issue. This is why it is included in my fork master...digitallyserviced:tview:master

This is in reference to #833

For a flex there should be no reason you need to sest a item as a Box instead of nil just to get the BG color. It also doesn't solve padding issues.

	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)

    // re-enable dontClear for this padding on a flex
    layoutCol2.SetDontClear(false)

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

1 participant