Changeset - d7b40cfbe0f3
[Not reviewed]
Tess Snider (Malkyne) - 3 years ago 2021-07-21 09:24:41
this@malkyne.org
Analyzing a Mixture should no longer cause the Pending Tests lists to
scroll down a little, for no reason.
2 files changed with 24 insertions and 13 deletions:
0 comments (0 inline, 0 general)
Models/ReactionTest.cs
Show inline comments
...
 
@@ -222,2 +222,3 @@ namespace DesertPaintCodex.Models
 
            BadReaction = null;
 
            Clipped = ClipType.None;
 
            State = TestState.Untested;
ViewModels/ExperimentLogViewModel.cs
Show inline comments
...
 
@@ -97,6 +97,11 @@ namespace DesertPaintCodex.ViewModels
 
        {
 
            int oldPos = 0;
 
            ReactionTest test = TestView.ReactionTest;
 
            if (!CompletedTests.Contains(test)) return;
 
            if (RemainingTests.Contains(test))
 
            {
 
                SelectedRemainingTest = ResortTestInList(test, RemainingTests);
 
                return;
 
            }
 

	
 
            int oldPos = CompletedTests.IndexOf(test);
 
            oldPos = CompletedTests.IndexOf(test);
 
            
...
 
@@ -119,13 +124,6 @@ namespace DesertPaintCodex.ViewModels
 
        {
 
            ReactionTest? test = null;
 
            int selectedTest = SelectedRemainingTest;
 
            if (selectedTest >= 0)
 
            int newPos = ResortTestInList(TestView.ReactionTest, RemainingTests);
 
            if (newPos != SelectedRemainingTest)
 
            {
 
                test = RemainingTests[selectedTest];
 
            }
 
            ReactionTestService.PopulateRemainingTests(RemainingTests);
 
            if (test != null)
 
            {
 
                int newIndex = RemainingTests.IndexOf(test);
 
                SelectedRemainingTest = newIndex;
 
                SelectedRemainingTest = newPos;
 
            }
...
 
@@ -135,3 +133,14 @@ namespace DesertPaintCodex.ViewModels
 

	
 
        private static void InsertTestIntoList(ReactionTest test, IList<ReactionTest> list)
 
        private static int ResortTestInList(ReactionTest test, IList<ReactionTest> list)
 
        {
 
            int oldPos = list.IndexOf(test);
 

	
 
            if (((oldPos > 0) || (test.CompareTo(list[oldPos - 1]) > 0))
 
                && ((oldPos == list.Count - 1) || (test.CompareTo(list[oldPos + 1]) < 0))) return oldPos; // No need to move.
 

	
 
            list.RemoveAt(oldPos);
 
            return InsertTestIntoList(test, list);
 
        }
 
        
 
        private static int InsertTestIntoList(ReactionTest test, IList<ReactionTest> list)
 
        {
...
 
@@ -143,2 +152,3 @@ namespace DesertPaintCodex.ViewModels
 
            list.Insert(i, test);
 
            return i;
 
        }
0 comments (0 inline, 0 general)