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;
|
fileNameScroll.ScrollContent.Origin = Anchor.Centre;
|
||||||
|
|
||||||
currentFile.BindValueChanged(updateFileSelectionText, true);
|
currentFile.BindValueChanged(updateFileSelectionText, true);
|
||||||
currentDirectory.BindValueChanged(_ =>
|
currentDirectory.BindValueChanged(onCurrentDirectoryChanged);
|
||||||
{
|
|
||||||
currentFile.Value = null;
|
|
||||||
});
|
|
||||||
|
|
||||||
currentDirectory.BindTo(fileSelector.CurrentPath);
|
currentDirectory.BindTo(fileSelector.CurrentPath);
|
||||||
currentFile.BindTo(fileSelector.CurrentFile);
|
currentFile.BindTo(fileSelector.CurrentFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onCurrentDirectoryChanged(ValueChangedEvent<DirectoryInfo> v)
|
||||||
|
{
|
||||||
|
currentFile.Value = null;
|
||||||
|
}
|
||||||
|
|
||||||
private void updateFileSelectionText(ValueChangedEvent<FileInfo> v)
|
private void updateFileSelectionText(ValueChangedEvent<FileInfo> v)
|
||||||
{
|
{
|
||||||
currentFileText.Text = v.NewValue?.Name ?? "Select a file";
|
currentFileText.Text = v.NewValue?.Name ?? "Select a file";
|
||||||
|
|
Loading…
Reference in New Issue