From a8a54aa4438a02096ab30fac1d270e608f0e1d0c Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo Date: Sun, 15 May 2022 11:26:07 -0600 Subject: [PATCH] Revert "Make scrll look more natural when removing items from control" This reverts commit 88cbcf6baff112f89b96d1296ce37fde41a3b08b. --- Source/AppScaffolding/AppScaffolding.csproj | 2 +- Source/LibationWinForms/Form1.ProcessQueue.cs | 17 ++--------------- .../ProcessQueue/VirtualFlowControl.cs | 5 +---- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/Source/AppScaffolding/AppScaffolding.csproj b/Source/AppScaffolding/AppScaffolding.csproj index 36492330..ad40a990 100644 --- a/Source/AppScaffolding/AppScaffolding.csproj +++ b/Source/AppScaffolding/AppScaffolding.csproj @@ -3,7 +3,7 @@ net6.0-windows - 7.5.0.5 + 7.5.0.1 diff --git a/Source/LibationWinForms/Form1.ProcessQueue.cs b/Source/LibationWinForms/Form1.ProcessQueue.cs index bb0456c4..acf4ac66 100644 --- a/Source/LibationWinForms/Form1.ProcessQueue.cs +++ b/Source/LibationWinForms/Form1.ProcessQueue.cs @@ -1,4 +1,5 @@ -using LibationFileManager; +using ApplicationServices; +using LibationFileManager; using LibationWinForms.ProcessQueue; using System; using System.Linq; @@ -13,20 +14,6 @@ namespace LibationWinForms { productsGrid.LiberateClicked += (_, lb) => processBookQueue1.AddDownloadDecrypt(lb); processBookQueue1.popoutBtn.Click += ProcessBookQueue1_PopOut; - - Task.Run(() => - { - Task.Delay(3000).Wait(); - var lb = ApplicationServices.DbContexts.GetLibrary_Flat_NoTracking().Select(lb => lb.Book).ToList(); - - foreach (var b in lb) - { - b.UserDefinedItem.BookStatus = DataLayer.LiberatedStatus.NotLiberated; - } - ApplicationServices.LibraryCommands.UpdateUserDefinedItem(lb); - - }); - } int WidthChange = 0; diff --git a/Source/LibationWinForms/ProcessQueue/VirtualFlowControl.cs b/Source/LibationWinForms/ProcessQueue/VirtualFlowControl.cs index d031d191..e942def1 100644 --- a/Source/LibationWinForms/ProcessQueue/VirtualFlowControl.cs +++ b/Source/LibationWinForms/ProcessQueue/VirtualFlowControl.cs @@ -190,10 +190,7 @@ namespace LibationWinForms.ProcessQueue vScrollBar1.LargeChange = LargeScrollChange; //https://stackoverflow.com/a/2882878/3335599 - int newMaximum = VirtualHeight + vScrollBar1.LargeChange - 1; - if (newMaximum < vScrollBar1.Maximum) - vScrollBar1.Value = Math.Max(vScrollBar1.Value - (vScrollBar1.Maximum - newMaximum), 0); - vScrollBar1.Maximum = newMaximum; + vScrollBar1.Maximum = VirtualHeight + vScrollBar1.LargeChange - 1; } }