From 3b2ff24c1fc09c5126201a6535c7c11d413d5f35 Mon Sep 17 00:00:00 2001 From: Leo Date: Thu, 26 Sep 2024 23:03:24 +0200 Subject: [PATCH] bug fix but still a new one :( --- cutils/cutils.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 cutils/cutils.go diff --git a/cutils/cutils.go b/cutils/cutils.go new file mode 100644 index 0000000..84a650e --- /dev/null +++ b/cutils/cutils.go @@ -0,0 +1,22 @@ +package cutils + +import "github.com/orus-dev/osui" + +func WithPosition(x, y int, c osui.Component) osui.Component { + data := c.GetComponentData() + data.X = x + data.Y = y + return c +} + +func WithStyle(style interface{}, c osui.Component) osui.Component { + c.SetStyle(style) + return c +} + +func WithSize(width, height int, c osui.Component) osui.Component { + data := c.GetComponentData() + data.Width = width + data.Height = height + return c +}