mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-12-12 02:00:27 +08:00
Compare commits
11 Commits
copilot/su
...
copilot/pr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d91ef677f2 | ||
|
|
9a768b2401 | ||
|
|
ef17dc5dcc | ||
|
|
7211c2ebdd | ||
|
|
76dfa34928 | ||
|
|
bf7de3bd8e | ||
|
|
1adb7ce980 | ||
|
|
d7edd92204 | ||
|
|
cbf3e566d9 | ||
|
|
f41fb0a68e | ||
|
|
1f96cf5745 |
@@ -30,7 +30,7 @@
|
|||||||
HWND hMsgWnd;
|
HWND hMsgWnd;
|
||||||
HANDLE hGetResultEvent;
|
HANDLE hGetResultEvent;
|
||||||
|
|
||||||
PCHAR pXmlBuffer;
|
PCHAR pXmlBuffer = nullptr;
|
||||||
|
|
||||||
void DOpus::GetSelected(PWCHAR buffer)
|
void DOpus::GetSelected(PWCHAR buffer)
|
||||||
{
|
{
|
||||||
@@ -72,9 +72,12 @@ void DOpus::GetSelected(PWCHAR buffer)
|
|||||||
|
|
||||||
WaitForSingleObject(hGetResultEvent, 2000);
|
WaitForSingleObject(hGetResultEvent, 2000);
|
||||||
|
|
||||||
ParseXmlBuffer(buffer);
|
if (pXmlBuffer != nullptr)
|
||||||
|
{
|
||||||
delete[] pXmlBuffer;
|
ParseXmlBuffer(buffer);
|
||||||
|
delete[] pXmlBuffer;
|
||||||
|
pXmlBuffer = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DOpus::ParseXmlBuffer(PWCHAR buffer)
|
void DOpus::ParseXmlBuffer(PWCHAR buffer)
|
||||||
@@ -88,6 +91,9 @@ void DOpus::ParseXmlBuffer(PWCHAR buffer)
|
|||||||
* ...
|
* ...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (pXmlBuffer == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
using namespace rapidxml;
|
using namespace rapidxml;
|
||||||
|
|
||||||
xml_document<> doc;
|
xml_document<> doc;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="FreeTypeSharp" Version="3.0.1" />
|
<PackageReference Include="FreeTypeSharp" Version="3.0.1" />
|
||||||
<PackageReference Include="QuickLook.Typography.OpenFont" Version="1.0.1" />
|
<PackageReference Include="QuickLook.Typography.OpenFont" Version="1.0.1" />
|
||||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3537.50">
|
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3537.50">
|
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ internal class ImageMagickProvider : AnimationProvider
|
|||||||
{
|
{
|
||||||
if (mi.ColorSpace == ColorSpace.RGB || mi.ColorSpace == ColorSpace.sRGB || mi.ColorSpace == ColorSpace.scRGB)
|
if (mi.ColorSpace == ColorSpace.RGB || mi.ColorSpace == ColorSpace.sRGB || mi.ColorSpace == ColorSpace.scRGB)
|
||||||
{
|
{
|
||||||
mi.SetProfile(ColorProfile.SRGB);
|
mi.SetProfile(ColorProfiles.SRGB);
|
||||||
if (ContextObject.ColorProfileName != null)
|
if (ContextObject.ColorProfileName != null)
|
||||||
mi.SetProfile(new ColorProfile(ContextObject.ColorProfileName)); // map to monitor color
|
mi.SetProfile(new ColorProfile(ContextObject.ColorProfileName)); // map to monitor color
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,10 +62,10 @@
|
|||||||
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.9.1">
|
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.9.1">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3537.50">
|
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Google.Protobuf" Version="3.33.0">
|
<PackageReference Include="Google.Protobuf" Version="3.33.1">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="System.Memory" Version="4.6.3">
|
<PackageReference Include="System.Memory" Version="4.6.3">
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MsgReader" Version="6.0.5" />
|
<PackageReference Include="MsgReader" Version="6.0.6" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="UTF.Unknown" Version="2.6.0" />
|
<PackageReference Include="UTF.Unknown" Version="2.6.0" />
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3537.50">
|
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -108,19 +108,32 @@ public class Plugin : IViewer
|
|||||||
{
|
{
|
||||||
context.Title = $"[PROTECTED VIEW] {Path.GetFileName(path)}";
|
context.Title = $"[PROTECTED VIEW] {Path.GetFileName(path)}";
|
||||||
|
|
||||||
MessageBoxResult result = MessageBox.Show(
|
// Check if user has a saved preference
|
||||||
"""
|
var savedPreference = SettingHelper.Get<bool?>("AlwaysUnblockProtectedView", null, "QuickLook.Plugin.OfficeViewer");
|
||||||
Be careful - files from the Internet can contain viruses.
|
|
||||||
The Office interface prevents loading in Protected View.
|
|
||||||
|
|
||||||
Would you like OfficeViewer-Native to unblock the ZoneIdentifier of Internet?
|
bool shouldUnblock;
|
||||||
""",
|
|
||||||
"PROTECTED VIEW",
|
|
||||||
MessageBoxButton.YesNo,
|
|
||||||
MessageBoxImage.Question
|
|
||||||
);
|
|
||||||
|
|
||||||
if (result == MessageBoxResult.Yes)
|
if (savedPreference.HasValue)
|
||||||
|
{
|
||||||
|
// Use saved preference
|
||||||
|
shouldUnblock = savedPreference.Value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Show dialog to ask user
|
||||||
|
var dialog = new ProtectedViewDialog();
|
||||||
|
var dialogResult = dialog.ShowDialog();
|
||||||
|
|
||||||
|
shouldUnblock = dialogResult == true;
|
||||||
|
|
||||||
|
// Save preference if user checked "Remember my choice"
|
||||||
|
if (dialog.RememberChoice)
|
||||||
|
{
|
||||||
|
SettingHelper.Set("AlwaysUnblockProtectedView", shouldUnblock, "QuickLook.Plugin.OfficeViewer");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldUnblock)
|
||||||
{
|
{
|
||||||
_ = ZoneIdentifierManager.UnblockZone(path);
|
_ = ZoneIdentifierManager.UnblockZone(path);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<Window x:Class="QuickLook.Plugin.OfficeViewer.ProtectedViewDialog"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
Title="PROTECTED VIEW"
|
||||||
|
Width="500"
|
||||||
|
Height="250"
|
||||||
|
WindowStartupLocation="CenterScreen"
|
||||||
|
ResizeMode="NoResize"
|
||||||
|
ShowInTaskbar="False">
|
||||||
|
<Grid Margin="20">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="0"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
FontSize="14"
|
||||||
|
Margin="0,0,0,10">
|
||||||
|
<Run FontWeight="Bold">Be careful - files from the Internet can contain viruses.</Run>
|
||||||
|
</TextBlock>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="1"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Margin="0,0,0,10">
|
||||||
|
The Office interface prevents loading in Protected View.
|
||||||
|
</TextBlock>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="2"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Margin="0,0,0,20">
|
||||||
|
Would you like OfficeViewer-Native to unblock the ZoneIdentifier of Internet?
|
||||||
|
</TextBlock>
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="3">
|
||||||
|
<CheckBox x:Name="RememberCheckBox"
|
||||||
|
Content="Remember my choice"
|
||||||
|
Margin="0,0,0,15" />
|
||||||
|
|
||||||
|
<StackPanel Orientation="Horizontal"
|
||||||
|
HorizontalAlignment="Right">
|
||||||
|
<Button x:Name="YesButton"
|
||||||
|
Content="Yes"
|
||||||
|
Width="80"
|
||||||
|
Height="30"
|
||||||
|
Margin="0,0,10,0"
|
||||||
|
IsDefault="True"
|
||||||
|
Click="YesButton_Click" />
|
||||||
|
<Button x:Name="NoButton"
|
||||||
|
Content="No"
|
||||||
|
Width="80"
|
||||||
|
Height="30"
|
||||||
|
IsCancel="True"
|
||||||
|
Click="NoButton_Click" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
// Copyright © 2017-2025 QL-Win Contributors
|
||||||
|
//
|
||||||
|
// This file is part of QuickLook program.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace QuickLook.Plugin.OfficeViewer;
|
||||||
|
|
||||||
|
public partial class ProtectedViewDialog : Window
|
||||||
|
{
|
||||||
|
public bool RememberChoice => RememberCheckBox.IsChecked ?? false;
|
||||||
|
public bool UserSelectedYes { get; private set; }
|
||||||
|
|
||||||
|
public ProtectedViewDialog()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void YesButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
UserSelectedYes = true;
|
||||||
|
DialogResult = true;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NoButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
DialogResult = false;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="PdfiumViewer.Updated" Version="2.14.5" />
|
<PackageReference Include="PdfiumViewer.Updated" Version="2.14.5" />
|
||||||
<PackageReference Include="bblanchon.PDFiumV8.Win32" Version="143.0.7497" />
|
<PackageReference Include="bblanchon.PDFiumV8.Win32" Version="144.0.7543" />
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
<Key word="workflow"/>
|
<Key word="workflow"/>
|
||||||
</KeyWords>
|
</KeyWords>
|
||||||
|
|
||||||
<KeyWords name="Keywords2" color="Purple" bold="false" italic="false">
|
<KeyWords name="Keywords2" color="#D8A0DF" bold="false" italic="false">
|
||||||
<Key word="Add-Computer"/>
|
<Key word="Add-Computer"/>
|
||||||
<Key word="Add-Content"/>
|
<Key word="Add-Content"/>
|
||||||
<Key word="Add-History"/>
|
<Key word="Add-History"/>
|
||||||
@@ -439,7 +439,7 @@
|
|||||||
<Key word="Write-Zip"/>
|
<Key word="Write-Zip"/>
|
||||||
</KeyWords>
|
</KeyWords>
|
||||||
|
|
||||||
<KeyWords name="Keywords3" color="Teal" bold="false" italic="false">
|
<KeyWords name="Keywords3" color="#80CBC4" bold="false" italic="false">
|
||||||
<Key word="ac"/>
|
<Key word="ac"/>
|
||||||
<Key word="asnp"/>
|
<Key word="asnp"/>
|
||||||
<Key word="cat"/>
|
<Key word="cat"/>
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<SyntaxDefinition name="Svelte" extensions=".svelte" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
|
||||||
|
<Color name="Comment" foreground="#6A9955" />
|
||||||
|
<Color name="Tag" foreground="#569CD6" exampleText="div" />
|
||||||
|
<Color name="Attribute" foreground="#9CDCFE" exampleText="on:click" />
|
||||||
|
<Color name="String" foreground="#CE9178" exampleText=""text"" />
|
||||||
|
<Color name="Directive" foreground="#DCDCAA" exampleText="bind:" />
|
||||||
|
<Color name="Keyword" foreground="#C586C0" exampleText="import" />
|
||||||
|
<Color name="Script" foreground="#D4D4D4" />
|
||||||
|
<Color name="Style" foreground="#4EC9B0" />
|
||||||
|
|
||||||
|
<RuleSet name="Html">
|
||||||
|
<Span color="Comment" begin="<!--" end="-->" />
|
||||||
|
<Span color="String" begin=""" end=""" />
|
||||||
|
<Span color="String" begin="'" end="'" />
|
||||||
|
|
||||||
|
<!-- Tags -->
|
||||||
|
<Span color="Tag" begin="<" end=">">
|
||||||
|
<RuleSet>
|
||||||
|
<Keywords color="Tag">
|
||||||
|
<Word>script</Word>
|
||||||
|
<Word>style</Word>
|
||||||
|
<Word>div</Word>
|
||||||
|
<Word>span</Word>
|
||||||
|
<Word>input</Word>
|
||||||
|
<Word>button</Word>
|
||||||
|
<Word>section</Word>
|
||||||
|
<Word>article</Word>
|
||||||
|
<Word>header</Word>
|
||||||
|
<Word>footer</Word>
|
||||||
|
<Word>main</Word>
|
||||||
|
<Word>nav</Word>
|
||||||
|
<Word>aside</Word>
|
||||||
|
<Word>p</Word>
|
||||||
|
<Word>h1</Word>
|
||||||
|
<Word>h2</Word>
|
||||||
|
<Word>h3</Word>
|
||||||
|
<Word>ul</Word>
|
||||||
|
<Word>li</Word>
|
||||||
|
<Word>a</Word>
|
||||||
|
<Word>img</Word>
|
||||||
|
</Keywords>
|
||||||
|
<Keywords color="Directive">
|
||||||
|
<Word>bind:</Word>
|
||||||
|
<Word>on:</Word>
|
||||||
|
<Word>use:</Word>
|
||||||
|
<Word>transition:</Word>
|
||||||
|
<Word>in:</Word>
|
||||||
|
<Word>out:</Word>
|
||||||
|
<Word>animate:</Word>
|
||||||
|
<Word>class:</Word>
|
||||||
|
<Word>style:</Word>
|
||||||
|
</Keywords>
|
||||||
|
<Keywords color="Attribute">
|
||||||
|
<Word>export</Word>
|
||||||
|
<Word>let</Word>
|
||||||
|
<Word>const</Word>
|
||||||
|
</Keywords>
|
||||||
|
</RuleSet>
|
||||||
|
</Span>
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet name="JavaScript">
|
||||||
|
<Span color="Comment" begin="//" end="\n" />
|
||||||
|
<Span color="Comment" begin="/\*" end="\*/" />
|
||||||
|
<Span color="String" begin=""" end=""" />
|
||||||
|
<Span color="String" begin="'" end="'" />
|
||||||
|
<Keywords color="Keyword">
|
||||||
|
<Word>import</Word>
|
||||||
|
<Word>export</Word>
|
||||||
|
<Word>default</Word>
|
||||||
|
<Word>return</Word>
|
||||||
|
<Word>const</Word>
|
||||||
|
<Word>let</Word>
|
||||||
|
<Word>var</Word>
|
||||||
|
<Word>if</Word>
|
||||||
|
<Word>else</Word>
|
||||||
|
<Word>for</Word>
|
||||||
|
<Word>while</Word>
|
||||||
|
<Word>function</Word>
|
||||||
|
<Word>async</Word>
|
||||||
|
<Word>await</Word>
|
||||||
|
<Word>new</Word>
|
||||||
|
<Word>this</Word>
|
||||||
|
<Word>true</Word>
|
||||||
|
<Word>false</Word>
|
||||||
|
<Word>null</Word>
|
||||||
|
<Word>undefined</Word>
|
||||||
|
<Word>each</Word>
|
||||||
|
<Word>if</Word>
|
||||||
|
<Word>else</Word>
|
||||||
|
<Word>await</Word>
|
||||||
|
<Word>then</Word>
|
||||||
|
<Word>catch</Word>
|
||||||
|
</Keywords>
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet name="CSS">
|
||||||
|
<Span color="Comment" begin="/\*" end="\*/" />
|
||||||
|
<Span color="String" begin=""" end=""" />
|
||||||
|
<Span color="String" begin="'" end="'" />
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet name="MainRuleSet">
|
||||||
|
<Import ruleSet="Html" />
|
||||||
|
<Import ruleSet="JavaScript" />
|
||||||
|
<Import ruleSet="CSS" />
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet>
|
||||||
|
<Import ruleSet="MainRuleSet" />
|
||||||
|
</RuleSet>
|
||||||
|
</SyntaxDefinition>
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<SyntaxDefinition name="Svelte" extensions=".svelte" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
|
||||||
|
<Color name="Comment" foreground="#008000" />
|
||||||
|
<Color name="Tag" foreground="#800000" exampleText="div" />
|
||||||
|
<Color name="Attribute" foreground="#0000FF" exampleText="on:click" />
|
||||||
|
<Color name="String" foreground="#A31515" exampleText=""text"" />
|
||||||
|
<Color name="Directive" foreground="#B000B0" exampleText="bind:" />
|
||||||
|
<Color name="Keyword" foreground="#000080" exampleText="import" />
|
||||||
|
<Color name="Script" foreground="#333333" />
|
||||||
|
<Color name="Style" foreground="#0055A5" />
|
||||||
|
|
||||||
|
<RuleSet name="Html">
|
||||||
|
<Span color="Comment" begin="<!--" end="-->" />
|
||||||
|
<Span color="String" begin=""" end=""" />
|
||||||
|
<Span color="String" begin="'" end="'" />
|
||||||
|
|
||||||
|
<!-- Tags -->
|
||||||
|
<Span color="Tag" begin="<" end=">">
|
||||||
|
<RuleSet>
|
||||||
|
<Keywords color="Tag">
|
||||||
|
<Word>script</Word>
|
||||||
|
<Word>style</Word>
|
||||||
|
<Word>div</Word>
|
||||||
|
<Word>span</Word>
|
||||||
|
<Word>input</Word>
|
||||||
|
<Word>button</Word>
|
||||||
|
<Word>section</Word>
|
||||||
|
<Word>article</Word>
|
||||||
|
<Word>header</Word>
|
||||||
|
<Word>footer</Word>
|
||||||
|
<Word>main</Word>
|
||||||
|
<Word>nav</Word>
|
||||||
|
<Word>aside</Word>
|
||||||
|
<Word>p</Word>
|
||||||
|
<Word>h1</Word>
|
||||||
|
<Word>h2</Word>
|
||||||
|
<Word>h3</Word>
|
||||||
|
<Word>ul</Word>
|
||||||
|
<Word>li</Word>
|
||||||
|
<Word>a</Word>
|
||||||
|
<Word>img</Word>
|
||||||
|
</Keywords>
|
||||||
|
<Keywords color="Directive">
|
||||||
|
<Word>bind:</Word>
|
||||||
|
<Word>on:</Word>
|
||||||
|
<Word>use:</Word>
|
||||||
|
<Word>transition:</Word>
|
||||||
|
<Word>in:</Word>
|
||||||
|
<Word>out:</Word>
|
||||||
|
<Word>animate:</Word>
|
||||||
|
<Word>class:</Word>
|
||||||
|
<Word>style:</Word>
|
||||||
|
</Keywords>
|
||||||
|
<Keywords color="Attribute">
|
||||||
|
<Word>export</Word>
|
||||||
|
<Word>let</Word>
|
||||||
|
<Word>const</Word>
|
||||||
|
</Keywords>
|
||||||
|
</RuleSet>
|
||||||
|
</Span>
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet name="JavaScript">
|
||||||
|
<Span color="Comment" begin="//" end="\n" />
|
||||||
|
<Span color="Comment" begin="/\*" end="\*/" />
|
||||||
|
<Span color="String" begin=""" end=""" />
|
||||||
|
<Span color="String" begin="'" end="'" />
|
||||||
|
<Keywords color="Keyword">
|
||||||
|
<Word>import</Word>
|
||||||
|
<Word>export</Word>
|
||||||
|
<Word>default</Word>
|
||||||
|
<Word>return</Word>
|
||||||
|
<Word>const</Word>
|
||||||
|
<Word>let</Word>
|
||||||
|
<Word>var</Word>
|
||||||
|
<Word>if</Word>
|
||||||
|
<Word>else</Word>
|
||||||
|
<Word>for</Word>
|
||||||
|
<Word>while</Word>
|
||||||
|
<Word>function</Word>
|
||||||
|
<Word>async</Word>
|
||||||
|
<Word>await</Word>
|
||||||
|
<Word>new</Word>
|
||||||
|
<Word>this</Word>
|
||||||
|
<Word>true</Word>
|
||||||
|
<Word>false</Word>
|
||||||
|
<Word>null</Word>
|
||||||
|
<Word>undefined</Word>
|
||||||
|
<Word>each</Word>
|
||||||
|
<Word>if</Word>
|
||||||
|
<Word>else</Word>
|
||||||
|
<Word>await</Word>
|
||||||
|
<Word>then</Word>
|
||||||
|
<Word>catch</Word>
|
||||||
|
</Keywords>
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet name="CSS">
|
||||||
|
<Span color="Comment" begin="/\*" end="\*/" />
|
||||||
|
<Span color="String" begin=""" end=""" />
|
||||||
|
<Span color="String" begin="'" end="'" />
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet name="MainRuleSet">
|
||||||
|
<Import ruleSet="Html" />
|
||||||
|
<Import ruleSet="JavaScript" />
|
||||||
|
<Import ruleSet="CSS" />
|
||||||
|
</RuleSet>
|
||||||
|
|
||||||
|
<RuleSet>
|
||||||
|
<Import ruleSet="MainRuleSet" />
|
||||||
|
</RuleSet>
|
||||||
|
</SyntaxDefinition>
|
||||||
@@ -351,7 +351,7 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan
|
|||||||
|
|
||||||
private void ChangeVolume(double delta)
|
private void ChangeVolume(double delta)
|
||||||
{
|
{
|
||||||
LinearVolume += delta;
|
LinearVolume = Math.Max(0d, Math.Min(1d, LinearVolume + delta));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TogglePlayPause(object sender, EventArgs e)
|
private void TogglePlayPause(object sender, EventArgs e)
|
||||||
@@ -385,16 +385,16 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan
|
|||||||
UpdateMeta(path, info);
|
UpdateMeta(path, info);
|
||||||
|
|
||||||
// detect rotation
|
// detect rotation
|
||||||
double.TryParse(info?.Get(StreamKind.Video, 0, "Rotation"), out var rotation);
|
_ = double.TryParse(info?.Get(StreamKind.Video, 0, "Rotation"), out var rotation);
|
||||||
// Correct rotation: on some machine the value "90" becomes "90000" by some reason
|
// Correct rotation: on some machine the value "90" becomes "90000" by some reason
|
||||||
if (rotation > 360)
|
if (rotation > 360d)
|
||||||
rotation /= 1e3;
|
rotation /= 1e3;
|
||||||
if (Math.Abs(rotation) > 0.1)
|
if (Math.Abs(rotation) > 0.1d)
|
||||||
mediaElement.LayoutTransform = new RotateTransform(rotation, 0.5, 0.5);
|
mediaElement.LayoutTransform = new RotateTransform(rotation, 0.5d, 0.5d);
|
||||||
|
|
||||||
mediaElement.Source = new Uri(path);
|
mediaElement.Source = new Uri(path);
|
||||||
// old plugin use an int-typed "Volume" config key ranged from 0 to 100. Let's use a new one here.
|
// old plugin use an int-typed "Volume" config key ranged from 0 to 100. Let's use a new one here.
|
||||||
LinearVolume = SettingHelper.Get("VolumeDouble", 1d, "QuickLook.Plugin.VideoViewer");
|
LinearVolume = Math.Max(0d, Math.Min(1d, SettingHelper.Get("VolumeDouble", 1d, "QuickLook.Plugin.VideoViewer")));
|
||||||
|
|
||||||
mediaElement.Play();
|
mediaElement.Play();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -259,6 +259,9 @@ public partial class App : Application
|
|||||||
|
|
||||||
private void CheckUpdate()
|
private void CheckUpdate()
|
||||||
{
|
{
|
||||||
|
if (SettingHelper.Get("DisableAutoUpdateCheck", false))
|
||||||
|
return;
|
||||||
|
|
||||||
if (DateTime.Now.Ticks - SettingHelper.Get<long>("LastUpdateTicks") < TimeSpan.FromDays(30).Ticks)
|
if (DateTime.Now.Ticks - SettingHelper.Get<long>("LastUpdateTicks") < TimeSpan.FromDays(30).Ticks)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
<PackageReference Include="WPF-UI.Violeta" Version="4.0.3.6">
|
<PackageReference Include="WPF-UI.Violeta" Version="4.0.3.6">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Lib.Harmony" Version="2.4.1">
|
<PackageReference Include="Lib.Harmony" Version="2.4.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="UnblockZoneIdentifier" Version="1.0.0">
|
<PackageReference Include="UnblockZoneIdentifier" Version="1.0.0">
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ public partial class ViewerWindow : Window
|
|||||||
Topmost = SettingHelper.Get("Topmost", false);
|
Topmost = SettingHelper.Get("Topmost", false);
|
||||||
buttonTop.Tag = Topmost ? "Top" : "Auto";
|
buttonTop.Tag = Topmost ? "Top" : "Auto";
|
||||||
|
|
||||||
|
ShowInTaskbar = SettingHelper.Get("ShowInTaskbar", false);
|
||||||
|
|
||||||
buttonTop.Click += (_, _) =>
|
buttonTop.Click += (_, _) =>
|
||||||
{
|
{
|
||||||
Topmost = !Topmost;
|
Topmost = !Topmost;
|
||||||
|
|||||||
Reference in New Issue
Block a user