This commit is contained in:
2024-09-28 19:29:01 +02:00
parent 90f106f127
commit 8592b1cc50
12 changed files with 222 additions and 47 deletions
+8 -8
View File
@@ -18,6 +18,14 @@ func centerText(text string, width int) string {
return fmt.Sprintf("%s%s%s", leftPadding, text, rightPadding)
}
func fnLogicValue(f func(*ButtonComponent) bool) func(*ButtonComponent) bool {
if f == nil {
return func(*ButtonComponent) bool { return false }
} else {
return f
}
}
func WithPosition(x, y int, c osui.Component) osui.Component {
data := c.GetComponentData()
data.X = x
@@ -36,11 +44,3 @@ func WithSize(width, height int, c osui.Component) osui.Component {
data.Height = height
return c
}
func fnLogicValue(f func(*ButtonComponent) bool) func(*ButtonComponent) bool {
if f == nil {
return func(*ButtonComponent) bool { return false }
} else {
return f
}
}