Minor UI tweak

This commit is contained in:
Michael Bucari-Tovo 2022-05-14 04:11:44 -06:00
parent 9d81c86c1b
commit dec1035258
3 changed files with 13 additions and 7 deletions

View File

@ -14,6 +14,7 @@ namespace LibationWinForms.ProcessQueue
public int ControlNumber { get; } public int ControlNumber { get; }
private ProcessBookStatus Status { get; set; } = ProcessBookStatus.Queued; private ProcessBookStatus Status { get; set; } = ProcessBookStatus.Queued;
private readonly int CancelBtnDistanceFromEdge; private readonly int CancelBtnDistanceFromEdge;
private readonly int ProgressBarDistanceFromEdge;
public ProcessBookControl() public ProcessBookControl()
{ {
InitializeComponent(); InitializeComponent();
@ -23,6 +24,7 @@ namespace LibationWinForms.ProcessQueue
etaLbl.Visible = false; etaLbl.Visible = false;
CancelBtnDistanceFromEdge = Width - cancelBtn.Location.X; CancelBtnDistanceFromEdge = Width - cancelBtn.Location.X;
ProgressBarDistanceFromEdge = Width - progressBar1.Location.X - progressBar1.Width;
ControlNumber = ControlNumberCounter++; ControlNumber = ControlNumberCounter++;
} }
@ -60,7 +62,7 @@ namespace LibationWinForms.ProcessQueue
Status = ProcessBookStatus.Queued; Status = ProcessBookStatus.Queued;
break; break;
case ProcessBookResult.FailedSkip: case ProcessBookResult.FailedSkip:
statusText = "Error, Skip"; statusText = "Error, Skippping";
Status = ProcessBookStatus.Failed; Status = ProcessBookStatus.Failed;
break; break;
case ProcessBookResult.FailedAbort: case ProcessBookResult.FailedAbort:
@ -68,7 +70,7 @@ namespace LibationWinForms.ProcessQueue
Status = ProcessBookStatus.Failed; Status = ProcessBookStatus.Failed;
break; break;
case ProcessBookResult.ValidationFail: case ProcessBookResult.ValidationFail:
statusText = "Validate fail"; statusText = "Validion fail";
Status = ProcessBookStatus.Failed; Status = ProcessBookStatus.Failed;
break; break;
case ProcessBookResult.None: case ProcessBookResult.None:
@ -124,14 +126,18 @@ namespace LibationWinForms.ProcessQueue
if (Status is ProcessBookStatus.Queued or ProcessBookStatus.Working && deltaX != 0) if (Status is ProcessBookStatus.Queued or ProcessBookStatus.Working && deltaX != 0)
{ {
//If the last book to occupy this control before resizing was not queued, //If the last book to occupy this control before resizing was not
//the buttons were not Visible so the Anchor property was ignored. //queued, the buttons were not Visible so the Anchor property was
//ignored. Manually resize and reposition everyhting
cancelBtn.Location = new Point(cancelBtn.Location.X + deltaX, cancelBtn.Location.Y); cancelBtn.Location = new Point(cancelBtn.Location.X + deltaX, cancelBtn.Location.Y);
moveFirstBtn.Location = new Point(moveFirstBtn.Location.X + deltaX, moveFirstBtn.Location.Y); moveFirstBtn.Location = new Point(moveFirstBtn.Location.X + deltaX, moveFirstBtn.Location.Y);
moveUpBtn.Location = new Point(moveUpBtn.Location.X + deltaX, moveUpBtn.Location.Y); moveUpBtn.Location = new Point(moveUpBtn.Location.X + deltaX, moveUpBtn.Location.Y);
moveDownBtn.Location = new Point(moveDownBtn.Location.X + deltaX, moveDownBtn.Location.Y); moveDownBtn.Location = new Point(moveDownBtn.Location.X + deltaX, moveDownBtn.Location.Y);
moveLastBtn.Location = new Point(moveLastBtn.Location.X + deltaX, moveLastBtn.Location.Y); moveLastBtn.Location = new Point(moveLastBtn.Location.X + deltaX, moveLastBtn.Location.Y);
etaLbl.Location = new Point(etaLbl.Location.X + deltaX, etaLbl.Location.Y);
remainingTimeLbl.Location = new Point(remainingTimeLbl.Location.X + deltaX, remainingTimeLbl.Location.Y);
progressBar1.Width = Width - ProgressBarDistanceFromEdge - progressBar1.Location.X;
} }
if (status == ProcessBookStatus.Working) if (status == ProcessBookStatus.Working)

View File

@ -174,10 +174,10 @@ namespace LibationWinForms.ProcessQueue
public void AddDownloadDecrypt(IEnumerable<GridEntry> entries) public void AddDownloadDecrypt(IEnumerable<GridEntry> entries)
{ {
foreach (var entry in entries) foreach (var entry in entries)
AddDownloadDecryptAsync(entry); AddDownloadDecrypt(entry);
} }
public void AddDownloadDecryptAsync(GridEntry gridEntry) public void AddDownloadDecrypt(GridEntry gridEntry)
{ {
if (Queue.Any(b => b?.LibraryBook?.Book?.AudibleProductId == gridEntry.AudibleProductId)) if (Queue.Any(b => b?.LibraryBook?.Book?.AudibleProductId == gridEntry.AudibleProductId))
return; return;

View File

@ -86,7 +86,7 @@ namespace LibationWinForms.ProcessQueue
LargeChange = SCROLL_LARGE_CHANGE, LargeChange = SCROLL_LARGE_CHANGE,
Dock = DockStyle.Right Dock = DockStyle.Right
}; };
panel1.Width -= vScrollBar1.Width; panel1.Width -= vScrollBar1.Width + panel1.Margin.Right;
Controls.Add(vScrollBar1); Controls.Add(vScrollBar1);