mirror of https://github.com/ppy/osu
Add "onCurrentDirectoryChanged"
This commit is contained in:
parent
fb080284d2
commit
7104230ae3
|
@ -126,15 +126,17 @@ private void load(Storage storage)
|
|||
fileNameScroll.ScrollContent.Origin = Anchor.Centre;
|
||||
|
||||
currentFile.BindValueChanged(updateFileSelectionText, true);
|
||||
currentDirectory.BindValueChanged(_ =>
|
||||
{
|
||||
currentFile.Value = null;
|
||||
});
|
||||
currentDirectory.BindValueChanged(onCurrentDirectoryChanged);
|
||||
|
||||
currentDirectory.BindTo(fileSelector.CurrentPath);
|
||||
currentFile.BindTo(fileSelector.CurrentFile);
|
||||
}
|
||||
|
||||
private void onCurrentDirectoryChanged(ValueChangedEvent<DirectoryInfo> v)
|
||||
{
|
||||
currentFile.Value = null;
|
||||
}
|
||||
|
||||
private void updateFileSelectionText(ValueChangedEvent<FileInfo> v)
|
||||
{
|
||||
currentFileText.Text = v.NewValue?.Name ?? "Select a file";
|
||||
|
|
Loading…
Reference in New Issue