1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 23:13:20 +08:00

Split group selection to separate method

This commit is contained in:
Dan Balasescu 2022-06-21 12:53:06 +09:00
parent 93ce6fc981
commit 046b848bcd

View File

@ -44,7 +44,6 @@ namespace osu.Game.Screens.Edit.Timing
{
BackgroundFlow.Add(new RowBackground(group)
{
Selected = ReferenceEquals(group, selectedGroup?.Value),
Action = () =>
{
selectedGroup.Value = group;
@ -55,6 +54,8 @@ namespace osu.Game.Screens.Edit.Timing
Columns = createHeaders();
Content = value.Select(createContent).ToArray().ToRectangular();
updateSelectedGroup();
}
}
@ -65,11 +66,17 @@ namespace osu.Game.Screens.Edit.Timing
selectedGroup.BindValueChanged(group =>
{
// TODO: This should scroll the selected row into view.
foreach (var b in BackgroundFlow)
b.Selected = ReferenceEquals(b.Item, group.NewValue);
updateSelectedGroup();
}, true);
}
private void updateSelectedGroup()
{
// TODO: This should scroll the selected row into view.
foreach (var b in BackgroundFlow)
b.Selected = ReferenceEquals(b.Item, selectedGroup?.Value);
}
private TableColumn[] createHeaders()
{
var columns = new List<TableColumn>