Center navbar buttons

This commit is contained in:
Brahim Hadriche committed 2023-11-19 21:42:12 -05:00
1 parent 3b35adeae9
commit 2639267e1f
1 file changed
+12
@@ -47,6 +47,18 @@ function PopulateButtons() as void
m.top.focusable = buttons.Count() > 0
m.top.focusIndex = m.top.focusIndex
CenterButtons()
end function
function CenterButtons()
parent = m.buttonGroup.getParent()
parentWidth = parent.width
parentHeight = parent.height
rect = m.buttonGroup.boundingRect()
m.buttonGroup.translation = [parentWidth / 2 - rect.width / 2, parentHeight / 2 - rect.height / 2]
end function
function onKeyEvent(key as string, press as boolean) as boolean