mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-12-11 16:05:02 +00:00
Now using hbox to more easily append unit label
This commit is contained in:
parent
8b19a7511c
commit
4f7c2cd511
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue