mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 20:02:57 +08:00
make loading indicator more visible by deleting panels preemptively
This commit is contained in:
parent
313dfd4d46
commit
52c2ba49cf
@ -93,12 +93,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private void recreatePanels(PanelDisplayStyle displayStyle)
|
private void recreatePanels(PanelDisplayStyle displayStyle)
|
||||||
{
|
{
|
||||||
if (panels != null)
|
clearPanels();
|
||||||
{
|
|
||||||
panels.FadeOut(200);
|
|
||||||
panels.Expire();
|
|
||||||
panels = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Users == null)
|
if (Users == null)
|
||||||
return;
|
return;
|
||||||
@ -139,6 +134,15 @@ namespace osu.Game.Overlays
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void clearPanels()
|
||||||
|
{
|
||||||
|
if (panels != null)
|
||||||
|
{
|
||||||
|
panels.Expire();
|
||||||
|
panels = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private APIRequest getUsersRequest;
|
private APIRequest getUsersRequest;
|
||||||
|
|
||||||
private readonly Bindable<string> currentQuery = new Bindable<string>();
|
private readonly Bindable<string> currentQuery = new Bindable<string>();
|
||||||
@ -153,10 +157,11 @@ namespace osu.Game.Overlays
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Users = null;
|
Users = null;
|
||||||
|
clearPanels();
|
||||||
loading.Hide();
|
loading.Hide();
|
||||||
getUsersRequest?.Cancel();
|
getUsersRequest?.Cancel();
|
||||||
|
|
||||||
if (api == null || api.State == APIState.Offline)
|
if (api?.IsLoggedIn == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (Header.Tabs.Current.Value)
|
switch (Header.Tabs.Current.Value)
|
||||||
@ -180,8 +185,8 @@ namespace osu.Game.Overlays
|
|||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
Users = newUsers;
|
Users = newUsers;
|
||||||
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
|
|
||||||
loading.Hide();
|
loading.Hide();
|
||||||
|
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user