Add deprecation notice to SetBorderPadding, GetBorderPadding and Pages

This commit is contained in:
Trevor Slocum 2020-10-26 11:21:25 -07:00
parent 36671ba7d3
commit 62c7289449
2 changed files with 15 additions and 8 deletions

14
box.go
View File

@ -579,16 +579,18 @@ func (b *Box) GetFocusable() Focusable {
return b.focus
}
// GetBorderPadding returns the size of the padding around the box content. It
// is provided for backwards compatibility. Application developers should use
// GetPadding instead.
// GetBorderPadding returns the size of the padding around the box content.
//
// Deprecated: This function is provided for backwards compatibility.
// Developers should use GetPadding instead.
func (b *Box) GetBorderPadding() (top, bottom, left, right int) {
return b.GetPadding()
}
// SetBorderPadding sets the size of the padding around the box content. It
// is provided for backwards compatibility. Application developers should use
// SetPadding instead.
// SetBorderPadding sets the size of the padding around the box content.
//
// Deprecated: This function is provided for backwards compatibility.
// Developers should use SetPadding instead.
func (b *Box) SetBorderPadding(top, bottom, left, right int) {
b.SetPadding(top, bottom, left, right)
}

View File

@ -380,13 +380,18 @@ func (p *Panels) MouseHandler() func(action MouseAction, event *tcell.EventMouse
// Support backwards compatibility with Pages.
type page = panel
// Pages is a wrapper around Panels. It is provided for backwards compatibility.
// Application developers should use Panels instead.
// Pages is a wrapper around Panels.
//
// Deprecated: This type is provided for backwards compatibility.
// Developers should use Panels instead.
type Pages struct {
*Panels
}
// NewPages returns a new Panels object.
//
// Deprecated: This function is provided for backwards compatibility.
// Developers should use NewPanels instead.
func NewPages() *Pages {
return &Pages{NewPanels()}
}