mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-10-21 19:25:14 +00:00
Add cross-plugin 'Reopen as' menu for SVG and HTML
Introduces 'Reopen as source code' and 'Reopen as image preview' options in the MoreMenu for SVG and HTML files, enabling users to switch between ImageViewer and TextViewer plugins. Updates translation files to support new menu items in multiple languages and refactors related plugin code for extensibility.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
using QuickLook.Common.Helpers;
|
||||
using QuickLook.Common.Plugin;
|
||||
using QuickLook.Common.Plugin.MoreMenu;
|
||||
using QuickLook.Plugin.ImageViewer.AnimatedImage.Providers;
|
||||
using QuickLook.Plugin.ImageViewer.Webview;
|
||||
using System;
|
||||
@@ -28,7 +29,7 @@ using System.Windows.Input;
|
||||
|
||||
namespace QuickLook.Plugin.ImageViewer;
|
||||
|
||||
public class Plugin : IViewer
|
||||
public partial class Plugin : IViewer, IMoreMenu
|
||||
{
|
||||
private static readonly HashSet<string> WellKnownExtensions = new(
|
||||
[
|
||||
@@ -56,6 +57,7 @@ public class Plugin : IViewer
|
||||
]);
|
||||
|
||||
private ImagePanel _ip;
|
||||
private string _currentPath;
|
||||
private MetaProvider _meta;
|
||||
|
||||
private IWebImagePanel _ipWeb;
|
||||
@@ -63,6 +65,8 @@ public class Plugin : IViewer
|
||||
|
||||
public int Priority => 0;
|
||||
|
||||
public IEnumerable<IMenuItem> MenuItems => GetMenuItems();
|
||||
|
||||
public void Init()
|
||||
{
|
||||
// Option of UseColorProfile:
|
||||
@@ -137,6 +141,8 @@ public class Plugin : IViewer
|
||||
|
||||
public void View(string path, ContextObject context)
|
||||
{
|
||||
_currentPath = path;
|
||||
|
||||
if (WebHandler.TryView(path, context, _metaWeb, out _ipWeb))
|
||||
return;
|
||||
|
||||
|
Reference in New Issue
Block a user