Skip to content

Commit 09325fd

Browse files
committed
Remember window size across Quicklook launches not just while running.
1 parent cfd8a4e commit 09325fd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Plugin.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Linq;
55
using System.Windows;
66
using System.Windows.Threading;
7+
using QuickLook.Common.Helpers;
78
using QuickLook.Common.Plugin;
89

910
namespace QuickLook.Plugin.WebViewPlus
@@ -13,8 +14,8 @@ public class Plugin : IViewer
1314
private WebpagePanel _panel;
1415

1516
public int Priority => 1;
16-
private static double _width = 1000;
17-
private static double _height = 1200;
17+
private static double _width = SettingHelper.Get("WindowWidth", 1000, "QuickLook.Plugin.WebViewPlus");
18+
private static double _height = SettingHelper.Get("WindowHeight", 1200, "QuickLook.Plugin.WebViewPlus");
1819

1920
public void Init()
2021
{
@@ -47,6 +48,9 @@ public void Cleanup()
4748
_width = _panel.ActualWidth;
4849
_height = _panel.ActualHeight;
4950

51+
SettingHelper.Set("WindowWidth", _width, "QuickLook.Plugin.WebViewPlus");
52+
SettingHelper.Set("WindowHeight", _height, "QuickLook.Plugin.WebViewPlus");
53+
5054
_panel?.Dispose();
5155
_panel = null;
5256
}

0 commit comments

Comments
 (0)