Fix image viewer content assignment and cursor check

This commit is contained in:
ema
2025-06-30 06:48:32 +08:00
parent 9cef4d9830
commit 0dc8c03446
2 changed files with 3 additions and 5 deletions

View File

@@ -152,12 +152,11 @@ public class Plugin : IViewer
var sizeSvg = _metaSvg.GetSize();
context.ViewerContent = _ip;
context.ViewerContent = _ipSvg;
context.Title = sizeSvg.IsEmpty
? $"{Path.GetFileName(path)}"
: $"{sizeSvg.Width}×{sizeSvg.Height}: {Path.GetFileName(path)}";
context.ViewerContent = _ipSvg;
context.IsBusy = false;
return;
}
@@ -174,7 +173,7 @@ public class Plugin : IViewer
_ip.ImageUriSource = Helper.FilePathToFileUrl(path);
// Load the custom cursor into the preview panel
if (new string[] { ".cur", ".ani" }.Any(path.ToLower().EndsWith))
if (new[] { ".cur", ".ani" }.Any(ext => path.EndsWith(ext, StringComparison.OrdinalIgnoreCase)))
{
_ip.Cursor = CursorProvider.GetCursor(path) ?? Cursors.Arrow;
}