mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-12 18:39:45 +00:00
let pdfviewer accepts streams
This commit is contained in:
@@ -73,9 +73,9 @@ namespace QuickLook.Plugin.PDFViewer
|
||||
{
|
||||
_pdfControl.LoadPdf(path);
|
||||
|
||||
context.Title = $"{Path.GetFileName(path)} (1 / {_pdfControl.TotalPages})";
|
||||
context.Title = $"1 / {_pdfControl.TotalPages}: {Path.GetFileName(path)}";
|
||||
|
||||
_pdfControl.CurrentPageChanged += UpdateVindowCaption;
|
||||
_pdfControl.CurrentPageChanged += UpdateWindowCaption;
|
||||
context.IsBusy = false;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -91,18 +91,16 @@ namespace QuickLook.Plugin.PDFViewer
|
||||
public void Cleanup()
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
if (_pdfControl != null)
|
||||
_pdfControl.CurrentPageChanged -= UpdateVindowCaption;
|
||||
|
||||
_pdfControl?.Dispose();
|
||||
_pdfControl = null;
|
||||
|
||||
_context = null;
|
||||
}
|
||||
|
||||
private void UpdateVindowCaption(object sender, EventArgs e2)
|
||||
private void UpdateWindowCaption(object sender, EventArgs e2)
|
||||
{
|
||||
_context.Title = $"{Path.GetFileName(_path)} ({_pdfControl.CurrentPage + 1} / {_pdfControl.TotalPages})";
|
||||
_context.Title = $"{_pdfControl.CurrentPage + 1} / {_pdfControl.TotalPages}: {Path.GetFileName(_path)}";
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user