feat: 진행 표시 보강 — 취소 버튼 + 큐 row inline progress bar
사이드바 진행 패널 - '취소' 버튼 추가 (FsSecondaryButtonStyle, ProcessingPercentLabel 우측) - 클릭 시 _cts.Cancel() + 라벨/버튼 '취소 중…'으로 전환 - finally에서 버튼 상태 복원 큐 row inline progress - QueueItem에 ProgressValue (0~100), ProgressVisibility 속성 추가 - SetState() 안에서 텍스트 파싱: 'queued'/'done'/'NN%' → 자동 갱신 - ItemTemplate에 Height=3 ProgressBar 추가 (MetaLine 아래) - 변환 중인 row만 시각적 bar 표시
This commit is contained in:
parent
ae897ea043
commit
81d0a04eb0
2 changed files with 67 additions and 7 deletions
|
|
@ -608,6 +608,24 @@ public partial class MainWindow : Wpf.Ui.Controls.FluentWindow
|
|||
{
|
||||
if (ProcessingProgressPanel is null) return;
|
||||
ProcessingProgressPanel.Visibility = Visibility.Collapsed;
|
||||
if (CancelProcessingButton is not null)
|
||||
{
|
||||
CancelProcessingButton.IsEnabled = true;
|
||||
CancelProcessingButton.Content = "취소";
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCancelProcessingClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_cts is null) return;
|
||||
try { _cts.Cancel(); } catch { }
|
||||
if (CancelProcessingButton is not null)
|
||||
{
|
||||
CancelProcessingButton.IsEnabled = false;
|
||||
CancelProcessingButton.Content = "취소 중…";
|
||||
}
|
||||
if (ProcessingFileLabel is not null)
|
||||
ProcessingFileLabel.Text = "취소 중…";
|
||||
}
|
||||
|
||||
// ============== History ==============
|
||||
|
|
@ -971,6 +989,8 @@ public partial class MainWindow : Wpf.Ui.Controls.FluentWindow
|
|||
public sealed class QueueItem : INotifyPropertyChanged
|
||||
{
|
||||
private string _state = "queued";
|
||||
private double _progressValue;
|
||||
private Visibility _progressVisibility = Visibility.Collapsed;
|
||||
|
||||
public required string SourcePath { get; init; }
|
||||
public required string FileName { get; init; }
|
||||
|
|
@ -993,11 +1013,38 @@ public sealed class QueueItem : INotifyPropertyChanged
|
|||
_ => (Brush)Application.Current.FindResource("FsAccentBlue"),
|
||||
};
|
||||
|
||||
public void SetPending() => StateText = "queued";
|
||||
public double ProgressValue
|
||||
{
|
||||
get => _progressValue;
|
||||
private set { _progressValue = value; Raise(nameof(ProgressValue)); }
|
||||
}
|
||||
|
||||
public Visibility ProgressVisibility
|
||||
{
|
||||
get => _progressVisibility;
|
||||
private set { _progressVisibility = value; Raise(nameof(ProgressVisibility)); }
|
||||
}
|
||||
|
||||
public void SetPending()
|
||||
{
|
||||
StateText = "queued";
|
||||
ProgressValue = 0;
|
||||
ProgressVisibility = Visibility.Collapsed;
|
||||
Raise(nameof(StateBrush));
|
||||
}
|
||||
|
||||
public void SetState(string s)
|
||||
{
|
||||
StateText = s;
|
||||
Raise(nameof(StateBrush));
|
||||
|
||||
if (s == "queued") { ProgressValue = 0; ProgressVisibility = Visibility.Collapsed; }
|
||||
else if (s == "done") { ProgressValue = 100; ProgressVisibility = Visibility.Visible; }
|
||||
else if (s.EndsWith('%') && double.TryParse(s.TrimEnd('%'), out var pct))
|
||||
{
|
||||
ProgressValue = pct;
|
||||
ProgressVisibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
public static QueueItem FromPath(string path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue