From 4f7c2cd511e3cf0087466bc810978cfadc8e8571 Mon Sep 17 00:00:00 2001 From: Jenny Crowe Date: Fri, 26 Jan 2024 18:30:41 -0700 Subject: [PATCH] Now using hbox to more easily append unit label --- .../toolboxes/ChartEditorEventDataToolbox.hx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorEventDataToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorEventDataToolbox.hx index 9ae4cbb01..7b163ad3d 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorEventDataToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorEventDataToolbox.hx @@ -18,6 +18,7 @@ import haxe.ui.core.Component; import funkin.data.event.SongEventRegistry; import haxe.ui.components.TextField; import haxe.ui.containers.Box; +import haxe.ui.containers.HBox; import haxe.ui.containers.Frame; import haxe.ui.events.UIEvent; import haxe.ui.data.ArrayDataSource; @@ -214,18 +215,21 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox input.text = field.type; } - target.addComponent(input); + // Putting in a box so we can add a unit label easily if there is one. + var inputBox:HBox = new HBox(); + inputBox.addComponent(input); + // Add a unit label if applicable. if (field.units != null && field.units != "") { var units:Label = new Label(); units.text = field.units; units.verticalAlign = "center"; - units.left = 85; - units.top = 4; - input.addComponent(units); + inputBox.addComponent(units); } + target.addComponent(inputBox); + // Update the value of the event data. input.onChange = function(event:UIEvent) { var value = event.target.value;