diff --git a/App.xaml.cs b/App.xaml.cs index 4a72634..0e8f6c4 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -30,7 +30,7 @@ public static string BuildConfig { get { public static Version Version => System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; public static readonly HashSet ImageExtensions = new HashSet(new[] { - ".jpg", ".jpeg", ".png", ".tiff", ".tif", ".gif", ".bmp", ".ico", ".dds", ".jxr", ".hdp", ".wdp", ".heic", "heif" + ".jpg", ".jpeg", ".png", ".tiff", ".tif", ".gif", ".bmp", ".ico", ".dds", ".jxr", ".hdp", ".wdp", ".heic", ".heif" }); public static readonly HashSet ZipExtensions = new HashSet(new[] { @@ -78,6 +78,13 @@ private void App_Startup(object sender, StartupEventArgs e) { //handle setting changes Setting.StaticPropertyChanged += Setting_StaticPropertyChanged; + //add custom extensions + foreach (var ext in Setting.CustomImageExt?.Split(' ') + .Where(s => !string.IsNullOrWhiteSpace(s)) + .Select(s => '.' + s.Trim('.').ToLowerInvariant())) { + if (!ImageExtensions.Contains(ext)) ImageExtensions.Add(ext); + } + //check arguments if (e.Args?.Length > 0) { #if DEBUG diff --git a/Helpers/Setting.cs b/Helpers/Setting.cs index f142e12..8482568 100644 --- a/Helpers/Setting.cs +++ b/Helpers/Setting.cs @@ -97,6 +97,18 @@ private enum ConfigSection private static string sevenZipDllPath => Path.Combine(App.ExeDir, $@"7z_{(Environment.Is64BitProcess ? @"x64" : @"x86")}.dll"); + private static string customImageExt = string.Empty; + [AppConfig] + public static string CustomImageExt + { + get => customImageExt; + set { + if (customImageExt == value) return; + customImageExt = value; + OnStaticPropertyChanged(nameof(CustomImageExt)); + } + } + private static string databaseDir = @".\"; [AppConfig] public static string DatabaseDir { diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index f3cda7b..578d5a2 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -148,6 +148,9 @@ private void MainWin_KeyDown(object sender, KeyEventArgs e) { case Key.PageUp: virWrapPanel.ScrollOwner.PageUp(); break; + case Key.F5: + Task.Run(() => LoadPath(CurrentPath)); + break; } } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 3bbf51a..671f5f3 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.9.0")] -[assembly: AssemblyFileVersion("1.2.9.0")] +[assembly: AssemblyVersion("1.2.10.0")] +[assembly: AssemblyFileVersion("1.2.10.0")] diff --git a/Resources/Localization.en.xaml b/Resources/Localization.en.xaml index d0132f5..c9e4400 100644 --- a/Resources/Localization.en.xaml +++ b/Resources/Localization.en.xaml @@ -16,6 +16,13 @@ Thumbnail Format Thumbnail Swap Delay Multiplier The delay of thumbnail change on folders and archives. Higher value results in longer delay. + Custom Image Extensions + + Space-separated list of additional image extensions to load as images. + Whether the additional formats can be loaded depends on the operating system support. + Restart the program for this setting to take effect. + For example: .abc .def .ghi + Database Directory The folder to save the all database files (thumbnail cache etc.). Thumbnail Cache Size (Current: {0}) diff --git a/Resources/Localization.zh.xaml b/Resources/Localization.zh.xaml index dd10340..70acc8d 100644 --- a/Resources/Localization.zh.xaml +++ b/Resources/Localization.zh.xaml @@ -16,6 +16,13 @@ 缩略图格式 缩略图切换延迟速率 目录和压缩文件缩略图的切换延迟。数值越高延迟越高。 + 自定义图片扩展名 + + 定义要作为图像加载的文件扩展名,以空格分隔。 + 图片格式是否支持取决于操作系统。 + 需要重启程序生效。 + 例如:.abc .def .ghi + 数据库目录 存放数据库文件(缩略图缓存数据库等)的目录 缩略图缓存大小 (当前: {0}) diff --git a/SettingsWindow.xaml b/SettingsWindow.xaml index 715a4f2..6261eef 100644 --- a/SettingsWindow.xaml +++ b/SettingsWindow.xaml @@ -39,6 +39,7 @@ + @@ -108,6 +109,18 @@ + + + + + + + + + + + + @@ -118,9 +131,9 @@ - + - +