tview icon indicating copy to clipboard operation
tview copied to clipboard

add setdontclear for cases where padding and borders on primitives

Open digitallyserviced opened this issue 1 year ago • 0 comments

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 https://github.com/rivo/tview/compare/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)

digitallyserviced avatar Jul 03 '23 20:07 digitallyserviced