adapt to minimize problem

This commit is contained in:
lemz 2024-06-22 14:49:04 +02:00 committed by EliteMasterEric
parent 93475ae8aa
commit 437cc68ba7

View file

@ -17,8 +17,18 @@ import funkin.play.notes.notekind.NoteKindManager;
@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/note-data.xml"))
class ChartEditorNoteDataToolbox extends ChartEditorBaseToolbox
{
// 100 is the height used in note-data.xml
static final DIALOG_HEIGHT:Int = 100;
// toolboxNotesGrid.height + 45
// this is what i found out by printing this.height and grid.height
// and then seeing that this.height is 100 and grid.height is 55
static final HEIGHT_OFFSET:Int = 45;
// minimizing creates a gray bar the bottom, which would obscure the components,
// which is why we use an extra offset of 20
static final MINIMIZE_FIX:Int = 20;
var toolboxNotesGrid:Grid;
var toolboxNotesNoteKind:DropDown;
var toolboxNotesCustomKind:TextField;
@ -176,9 +186,7 @@ class ChartEditorNoteDataToolbox extends ChartEditorBaseToolbox
return;
}
// toolboxNotesGrid.height + 45
// this is what i found out is the calculation by printing this.height and grid.height
var heightToSet:Int = Std.int(Math.max(DIALOG_HEIGHT, toolboxNotesGrid.height + 45));
var heightToSet:Int = Std.int(Math.max(DIALOG_HEIGHT, toolboxNotesGrid.height + HEIGHT_OFFSET)) + MINIMIZE_FIX;
if (this.height != heightToSet)
{
this.height = heightToSet;