fix reordering
This commit is contained in:
@@ -4,7 +4,7 @@ public class AppState
|
|||||||
{
|
{
|
||||||
public string? LastOpenSolutionFilePath { get; set; }
|
public string? LastOpenSolutionFilePath { get; set; }
|
||||||
public IdeSettings IdeSettings { get; set; } = new IdeSettings();
|
public IdeSettings IdeSettings { get; set; } = new IdeSettings();
|
||||||
public HashSet<RecentSln> RecentSlns { get; set; } = [];
|
public List<RecentSln> RecentSlns { get; set; } = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public class IdeSettings
|
public class IdeSettings
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public partial class SlnPicker : Control
|
|||||||
private void PopulatePreviousSolutions()
|
private void PopulatePreviousSolutions()
|
||||||
{
|
{
|
||||||
_previousSlnsVBoxContainer.QueueFreeChildren();
|
_previousSlnsVBoxContainer.QueueFreeChildren();
|
||||||
foreach (var previousSln in Singletons.AppState.RecentSlns.Reverse())
|
foreach (var previousSln in Singletons.AppState.RecentSlns.AsEnumerable().Reverse())
|
||||||
{
|
{
|
||||||
var node = _previousSlnEntryScene.Instantiate<PreviousSlnEntry>();
|
var node = _previousSlnEntryScene.Instantiate<PreviousSlnEntry>();
|
||||||
node.RecentSln = previousSln;
|
node.RecentSln = previousSln;
|
||||||
|
|||||||
@@ -79,7 +79,9 @@ public partial class IdeWindow : Control
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ideRoot.SetSlnFilePath(slnPath);
|
ideRoot.SetSlnFilePath(slnPath);
|
||||||
Singletons.AppState.RecentSlns.Add(new RecentSln { FilePath = slnPath, Name = Path.GetFileName(slnPath) });
|
var recentSln = new RecentSln { FilePath = slnPath, Name = Path.GetFileName(slnPath) };
|
||||||
|
Singletons.AppState.RecentSlns.RemoveAll(s => s == recentSln); // Move to end (most recent)
|
||||||
|
Singletons.AppState.RecentSlns.Add(recentSln);
|
||||||
|
|
||||||
await this.InvokeAsync(() =>
|
await this.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user