Make scrll look more natural when removing items from control
This commit is contained in:
parent
8d6d26c9d2
commit
88cbcf6baf
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0-windows</TargetFramework>
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
<Version>7.5.0.1</Version>
|
<Version>7.5.0.5</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using ApplicationServices;
|
using LibationFileManager;
|
||||||
using LibationFileManager;
|
|
||||||
using LibationWinForms.ProcessQueue;
|
using LibationWinForms.ProcessQueue;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -14,6 +13,20 @@ namespace LibationWinForms
|
|||||||
{
|
{
|
||||||
productsGrid.LiberateClicked += (_, lb) => processBookQueue1.AddDownloadDecrypt(lb);
|
productsGrid.LiberateClicked += (_, lb) => processBookQueue1.AddDownloadDecrypt(lb);
|
||||||
processBookQueue1.popoutBtn.Click += ProcessBookQueue1_PopOut;
|
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;
|
int WidthChange = 0;
|
||||||
|
|||||||
@ -190,7 +190,10 @@ namespace LibationWinForms.ProcessQueue
|
|||||||
vScrollBar1.LargeChange = LargeScrollChange;
|
vScrollBar1.LargeChange = LargeScrollChange;
|
||||||
|
|
||||||
//https://stackoverflow.com/a/2882878/3335599
|
//https://stackoverflow.com/a/2882878/3335599
|
||||||
vScrollBar1.Maximum = VirtualHeight + vScrollBar1.LargeChange - 1;
|
int newMaximum = VirtualHeight + vScrollBar1.LargeChange - 1;
|
||||||
|
if (newMaximum < vScrollBar1.Maximum)
|
||||||
|
vScrollBar1.Value = Math.Max(vScrollBar1.Value - (vScrollBar1.Maximum - newMaximum), 0);
|
||||||
|
vScrollBar1.Maximum = newMaximum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user