From fa29ee9eaf71881fa7b4e69f9bfc00256a65f63f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20Kov=C3=A1cs?= Date: Tue, 22 Aug 2023 17:03:02 +0200 Subject: [PATCH] Fixes --- src/ConsoleApp/FileTime.ConsoleUI.App/Startup.cs | 2 +- src/Library/TerminalUI/Controls/BinaryView.cs | 4 ++++ src/Library/TerminalUI/Controls/ItemsControl.cs | 4 +++- src/Library/TerminalUI/Controls/View.cs | 7 ------- src/Tools/FileTime.Tools.Compression/DecompressCommand.cs | 5 +++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ConsoleApp/FileTime.ConsoleUI.App/Startup.cs b/src/ConsoleApp/FileTime.ConsoleUI.App/Startup.cs index e85d036..40374a9 100644 --- a/src/ConsoleApp/FileTime.ConsoleUI.App/Startup.cs +++ b/src/ConsoleApp/FileTime.ConsoleUI.App/Startup.cs @@ -40,7 +40,7 @@ public static class Startup services.TryAddSingleton(); services.TryAddSingleton(); services.TryAddSingleton(sp => sp.GetRequiredService()); - services.TryAddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.TryAddSingleton(); diff --git a/src/Library/TerminalUI/Controls/BinaryView.cs b/src/Library/TerminalUI/Controls/BinaryView.cs index f0bfb22..bfa6ecd 100644 --- a/src/Library/TerminalUI/Controls/BinaryView.cs +++ b/src/Library/TerminalUI/Controls/BinaryView.cs @@ -66,6 +66,10 @@ public partial class BinaryView : View, T>, IDisplayView _lastRenderState = renderState; if (data is null) return false; + + var driver = renderContext.ConsoleDriver; + driver.ResetStyle(); + SetStyleColor(renderContext, foreground, background); var lineI = 0; var textSize = size with {Height = 1}; diff --git a/src/Library/TerminalUI/Controls/ItemsControl.cs b/src/Library/TerminalUI/Controls/ItemsControl.cs index 89c9d88..a026062 100644 --- a/src/Library/TerminalUI/Controls/ItemsControl.cs +++ b/src/Library/TerminalUI/Controls/ItemsControl.cs @@ -112,14 +112,16 @@ public sealed partial class ItemsControl { var neededRerender = false; IReadOnlyList forceRerenderChildren; + IReadOnlyList children; lock (_forceRerenderChildrenLock) { forceRerenderChildren = _forceRerenderChildren.ToList(); _forceRerenderChildren.Clear(); + children = _children.ToList(); } var delta = 0; - foreach (var child in _children) + foreach (var child in children) { if (!child.IsVisible) continue; diff --git a/src/Library/TerminalUI/Controls/View.cs b/src/Library/TerminalUI/Controls/View.cs index 61a7038..a6fa3a6 100644 --- a/src/Library/TerminalUI/Controls/View.cs +++ b/src/Library/TerminalUI/Controls/View.cs @@ -396,13 +396,6 @@ public abstract partial class View : IView where TConcrete : Vi } } - protected void SetColorsForDriver(in RenderContext renderContext) - { - var foreground = Foreground ?? renderContext.Foreground; - var background = Background ?? renderContext.Background; - SetStyleColor(renderContext, foreground, background); - } - public TChild CreateChild() where TChild : IView, new() { var child = new TChild(); diff --git a/src/Tools/FileTime.Tools.Compression/DecompressCommand.cs b/src/Tools/FileTime.Tools.Compression/DecompressCommand.cs index d414b5a..1fc583c 100644 --- a/src/Tools/FileTime.Tools.Compression/DecompressCommand.cs +++ b/src/Tools/FileTime.Tools.Compression/DecompressCommand.cs @@ -69,6 +69,7 @@ public class DecompressCommand : CommandBase, IExecutableCommand, ITransportatio foreach (var archiveContext in _archives) { await DecompressFile(archiveContext, resolvedTarget, contentWriterFactory, itemCreator); + await _commandSchedulerNotifier.RefreshContainer(Target); } } @@ -81,9 +82,9 @@ public class DecompressCommand : CommandBase, IExecutableCommand, ITransportatio var archive = archiveContext.Archive; foreach (var archiveEntry in archive.Entries) { - var subPath = string.Join(Constants.SeparatorChar, archiveEntry.Key.Split('\\')); + var subPath = archiveContext.TargetContainerName + Constants.SeparatorChar + string.Join(Constants.SeparatorChar, archiveEntry.Key.Split('\\')); var entryPath = Target.GetChild(subPath); - + if (archiveEntry.IsDirectory) { await itemCreator.CreateContainerAsync(resolvedTarget.Provider, entryPath);