protected override Drawable CreateComponent() { var drawable = base.CreateComponent(); FlowContainer.Insert(-1, dropdown = new OsuDropdown <string> { Width = 510 }); return(drawable); }
protected override Drawable CreateComponent() { var drawable = base.CreateComponent(); FlowContainer.Insert(-1, folderButton = new TriangleButton { Text = "Open folder", Width = 100 }); FlowContainer.Insert(-2, dropdown = new OsuDropdown <string> { Width = 510 }); return(drawable); }
protected override Drawable CreateComponent() { var drawable = base.CreateComponent(); FlowContainer.Insert(-1, numberBox = new OsuNumberBox { Text = "1080", Width = 100 }); base.Action = () => { if (string.IsNullOrEmpty(numberBox.Text)) { return; } // box contains text if (!int.TryParse(numberBox.Text, out var number)) { // at this point, the only reason we can arrive here is if the input number was too big to parse into an int // so clamp to max allowed value number = maximum_window_height; } else { number = Math.Clamp(number, minimum_window_height, maximum_window_height); } // in case number got clamped, reset number in numberBox numberBox.Text = number.ToString(); Action?.Invoke(number); }; return(drawable); }