Fixed taskbar highlight issue when editor is open and another task completes upload

This commit is contained in:
Jaex 2017-11-10 03:55:17 +03:00
parent 69d57b07bd
commit 7648485341
2 changed files with 7 additions and 19 deletions

View file

@ -250,9 +250,6 @@ public override Image Apply(Image img)
}
}
float centerX = watermarkRectangle.Width / 2f - (Padding.Right - Padding.Left);
float centerY = watermarkRectangle.Height / 2f - (Padding.Bottom - Padding.Top);
if (DrawTextShadow)
{
using (Brush textShadowBrush = new SolidBrush(TextShadowColor))

View file

@ -457,14 +457,14 @@ private static void Task_UploadersConfigWindowRequested(IUploaderService uploade
public static void UpdateProgressUI()
{
bool isWorkingTasks = false;
bool isTasksWorking = false;
double averageProgress = 0;
IEnumerable<WorkerTask> workingTasks = Tasks.Where(x => x != null && x.Status == TaskStatus.Working && x.Info != null);
if (workingTasks.Count() > 0)
{
isWorkingTasks = true;
isTasksWorking = true;
workingTasks = workingTasks.Where(x => x.Info.Progress != null);
@ -474,25 +474,16 @@ public static void UpdateProgressUI()
}
}
int progress = isWorkingTasks ? (int)averageProgress : -1;
UpdateTrayIcon(progress);
string title;
if (isWorkingTasks)
if (isTasksWorking)
{
title = string.Format("{0} - {1:0.0}%", Program.Title, averageProgress);
Program.MainForm.Text = string.Format("{0} - {1:0.0}%", Program.Title, averageProgress);
UpdateTrayIcon((int)averageProgress);
TaskbarManager.SetProgressValue(Program.MainForm, (int)averageProgress);
}
else
{
title = Program.Title;
}
Program.MainForm.Text = title;
if (!IsBusy)
{
Program.MainForm.Text = Program.Title;
UpdateTrayIcon(-1);
TaskbarManager.SetProgressState(Program.MainForm, TaskbarProgressBarStatus.NoProgress);
}
}