From b93dea2e1c18752b89b09790b390e54c33dda1bf Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 22 Mar 2018 23:03:36 +0200 Subject: Refactoring and documentation --- ui/widget/center.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ui/widget/center.go') diff --git a/ui/widget/center.go b/ui/widget/center.go index 41181a2..45312e2 100644 --- a/ui/widget/center.go +++ b/ui/widget/center.go @@ -20,6 +20,8 @@ import ( "maunium.net/go/tview" ) +// Center wraps the given tview primitive into a Flex element in order to +// vertically and horizontally center the given primitive. func Center(width, height int, p tview.Primitive) tview.Primitive { return tview.NewFlex(). AddItem(tview.NewBox(), 0, 1, false). -- cgit v1.2.3