Sidebar - Added profile reordering and moving to different categories

This commit is contained in:
Robert committed 2022-05-27 10:06:47 +02:00
1 parent cd97ed420c
commit bcd03becc7
8 files changed
+333 -16

No files matched your search

@@ -98,7 +98,10 @@ namespace Artemis.Core
configuration.Category.RemoveProfileConfiguration(configuration);
if (targetIndex != null)
_profileConfigurations.Insert(Math.Clamp(targetIndex.Value, 0, _profileConfigurations.Count), configuration);
{
targetIndex = Math.Clamp(targetIndex.Value, 0, _profileConfigurations.Count);
_profileConfigurations.Insert(targetIndex.Value, configuration);
}
else
_profileConfigurations.Add(configuration);
configuration.Category = this;
@@ -116,7 +119,8 @@ namespace Artemis.Core
internal void RemoveProfileConfiguration(ProfileConfiguration configuration)
{
if (!_profileConfigurations.Remove(configuration)) return;
if (!_profileConfigurations.Remove(configuration))
return;
for (int index = 0; index < _profileConfigurations.Count; index++)
_profileConfigurations[index].Order = index;