mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
Project/solution export (and other RunInNewTabAsync work) opened a tab with a static title and a permanently indeterminate progress bar, even though the whole-project decompiler already produces per-file DecompilationProgress that was being dropped. Wire that progress through: DecompilationOptions carries an IProgress<DecompilationProgress> that DecompileAsProject sets on the WholeProjectDecompiler; a new RunInNewTabAsync overload hands the work a UI-thread-marshaled Progress<T> feeding the tab. The tab now animates the braille spinner over its title (the operation name) and shows a determinate bar plus the file currently being written and an "N of M" count. Solution export reports per-assembly rather than per-file, since its assemblies decompile in parallel and per-file reports would race. The determinate bar is pinned to 75% of the overlay width so it doesn't jitter as the status text changes. Assisted-by: Claude:claude-opus-4-8:Claude Codepull/3755/head
11 changed files with 223 additions and 19 deletions
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
// Copyright (c) 2026 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Globalization; |
||||
|
||||
using Avalonia.Data.Converters; |
||||
|
||||
namespace ILSpy.TextView |
||||
{ |
||||
/// <summary>
|
||||
/// Width for the determinate progress bar in the decompile/operation overlay: a fixed fraction
|
||||
/// (75%) of the overlay width, so the bar is a stable size instead of shrinking and growing with
|
||||
/// the status text underneath it. While the bar is indeterminate it returns <c>NaN</c> (auto),
|
||||
/// leaving that mode's natural sizing untouched.
|
||||
/// </summary>
|
||||
public sealed class DeterminateProgressWidthConverter : IMultiValueConverter |
||||
{ |
||||
public static readonly DeterminateProgressWidthConverter Instance = new(); |
||||
|
||||
const double Fraction = 0.75; |
||||
|
||||
public object Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture) |
||||
{ |
||||
if (values.Count == 2 && values[0] is double overlayWidth && values[1] is bool isIndeterminate |
||||
&& !isIndeterminate && overlayWidth > 0) |
||||
{ |
||||
return overlayWidth * Fraction; |
||||
} |
||||
return double.NaN; |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue