mirror of
https://github.com/Stone-Red-Code/Markdowser.git
synced 2026-09-09 07:46:29 +02:00
Small UI improvements
This commit is contained in:
@@ -49,7 +49,7 @@ internal partial class HtmlProcessor : IContentProcessor
|
|||||||
{
|
{
|
||||||
_ = html.AppendLine(await streamReader.ReadLineAsync());
|
_ = 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();
|
HtmlDocument htmlDoc = new HtmlDocument();
|
||||||
@@ -68,7 +68,7 @@ internal partial class HtmlProcessor : IContentProcessor
|
|||||||
|
|
||||||
foreach (string line in lines)
|
foreach (string line in lines)
|
||||||
{
|
{
|
||||||
progress.Report(new ProcessingProgress(lines.Length, currentLine));
|
progress.Report(new ProcessingProgress(currentLine, lines.Length, "Processing markdown..."));
|
||||||
currentLine++;
|
currentLine++;
|
||||||
|
|
||||||
string trimmedLine = line.Trim();
|
string trimmedLine = line.Trim();
|
||||||
|
|||||||
@@ -381,9 +381,6 @@ public partial class MainWindowViewModel : ViewModelBase
|
|||||||
|
|
||||||
private void UpdateProgress(ProcessingProgress progress)
|
private void UpdateProgress(ProcessingProgress progress)
|
||||||
{
|
{
|
||||||
Progress = progress.Current;
|
|
||||||
ProgressMax = progress.Total;
|
|
||||||
|
|
||||||
if (progress.IsBytes)
|
if (progress.IsBytes)
|
||||||
{
|
{
|
||||||
ProgressText = $"{progress.Message} ({{1:0}}%) {BytesToString.Convert((long)Progress)}/{BytesToString.Convert((long)ProgressMax)}";
|
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}}";
|
ProgressText = $"{progress.Message} ({{1:0}}%) {{0}}/{{3}}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProgressMax = progress.Total;
|
||||||
|
Progress = progress.Current;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UrlChanged(object? sender, EventArgs e)
|
private void UrlChanged(object? sender, EventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user