diff --git a/tests/screen_test.go b/tests/screen_test.go index 2f25eb3..8c6099c 100644 --- a/tests/screen_test.go +++ b/tests/screen_test.go @@ -86,8 +86,7 @@ func TestFlowLayout(t *testing.T) { textView := views.NewTextView("hello world!") textView.SetStyle(tui.StyleDefault.Background(tcell.ColorRed).Foreground(tcell.ColorBlack)) - marginView := views.NewMarginView(textView) - marginView.SetMargin(3, 1, 1, 0) + marginView := views.NewMarginView(textView, 3, 1, 1, 0) //borderView := views.NewBorderView(textView) diff --git a/views/view_margin.go b/views/view_margin.go index a312bd9..015570d 100644 --- a/views/view_margin.go +++ b/views/view_margin.go @@ -10,10 +10,10 @@ type MarginView struct { var _ tui.Wrapper = &MarginView{} -func NewMarginView(view tui.View) *MarginView { +func NewMarginView(view tui.View, top, right, bottom, left int) *MarginView { v := new(MarginView) v.SetView(view) - v.SetMargin(0, 0, 0, 0) + v.SetMargin(top, right, bottom, left) return v }