From fd73421c3b4dda6cc139a55c2a5a97e8242acb75 Mon Sep 17 00:00:00 2001 From: ema Date: Mon, 19 Jan 2026 03:16:47 +0800 Subject: [PATCH] Refactor PakInfoPanel file list and improve icon converter Replaces ArchiveFileListView with a custom ListView in PakInfoPanel.xaml, adds detailed column templates, and updates resource bindings. Refactors PakInfoPanel.xaml.cs to set DataContext directly and improves hierarchical file entry creation with modified dates. Updates FileExtToIconConverter to ensure only ImageSource results are returned. --- .../ArchiveFile/Converters.cs | 8 +- .../ChromiumResourcePackage/PakInfoPanel.xaml | 186 +++++++++++++++++- .../PakInfoPanel.xaml.cs | 40 +++- 3 files changed, 220 insertions(+), 14 deletions(-) diff --git a/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/Converters.cs b/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/Converters.cs index b407c85..858272f 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/Converters.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ArchiveFile/Converters.cs @@ -20,6 +20,7 @@ using System; using System.Globalization; using System.Windows; using System.Windows.Data; +using System.Windows.Media; namespace QuickLook.Plugin.ArchiveViewer.ArchiveFile; @@ -142,10 +143,13 @@ public sealed class FileExtToIconConverter : DependencyObject, IMultiValueConver var name = (string)values[0]; var isFolder = (bool)values[1]; + object result; if (isFolder) - return IconManager.FindIconForDir(false); + result = IconManager.FindIconForDir(false); + else + result = IconManager.FindIconForFilename(name, false); - return IconManager.FindIconForFilename(name, false); + return result is ImageSource img ? img : DependencyProperty.UnsetValue; } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) diff --git a/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ChromiumResourcePackage/PakInfoPanel.xaml b/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ChromiumResourcePackage/PakInfoPanel.xaml index 64546c3..39eaf65 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ChromiumResourcePackage/PakInfoPanel.xaml +++ b/QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/ChromiumResourcePackage/PakInfoPanel.xaml @@ -16,10 +16,14 @@ + + + + - +