Small UI improvements

This commit is contained in:
Stone_Red
2024-06-04 16:52:56 +02:00
parent e943ed0bd7
commit 813f3b39a0
2 changed files with 5 additions and 5 deletions
@@ -49,7 +49,7 @@ internal partial class HtmlProcessor : IContentProcessor
{
_ = html.AppendLine(await streamReader.ReadLineAsync());
progress.Report(new ProcessingProgress(contentStream.Position, length));
progress.Report(new ProcessingProgress(Encoding.Default.GetByteCount(html.ToString()), length, "Downloading HTML...", true));
}
HtmlDocument htmlDoc = new HtmlDocument();
@@ -68,7 +68,7 @@ internal partial class HtmlProcessor : IContentProcessor
foreach (string line in lines)
{
progress.Report(new ProcessingProgress(lines.Length, currentLine));
progress.Report(new ProcessingProgress(currentLine, lines.Length, "Processing markdown..."));
currentLine++;
string trimmedLine = line.Trim();
@@ -381,9 +381,6 @@ public partial class MainWindowViewModel : ViewModelBase
private void UpdateProgress(ProcessingProgress progress)
{
Progress = progress.Current;
ProgressMax = progress.Total;
if (progress.IsBytes)
{
ProgressText = $"{progress.Message} ({{1:0}}%) {BytesToString.Convert((long)Progress)}/{BytesToString.Convert((long)ProgressMax)}";
@@ -392,6 +389,9 @@ public partial class MainWindowViewModel : ViewModelBase
{
ProgressText = $"{progress.Message} ({{1:0}}%) {{0}}/{{3}}";
}
ProgressMax = progress.Total;
Progress = progress.Current;
}
private void UrlChanged(object? sender, EventArgs e)