mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-11 17:59:17 +00:00
Do not show page list for single-page PDFs
This commit is contained in:
@@ -20,11 +20,11 @@
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListBox x:Name="listThumbnails" Grid.Column="0" VirtualizingPanel.ScrollUnit="Item"
|
||||
VirtualizingPanel.IsVirtualizing="True"
|
||||
VirtualizingPanel.IsVirtualizing="True" Width="150"
|
||||
SelectedIndex="0"
|
||||
Focusable="False"
|
||||
Background="#00FFFFFF"
|
||||
|
@@ -197,7 +197,8 @@ namespace QuickLook.Plugin.PDFViewer
|
||||
var size = tempHandle.GetPageSize(0, 1d);
|
||||
tempHandle.Dispose();
|
||||
|
||||
size.Width += /*listThumbnails.ActualWidth*/ 150;
|
||||
if (tempHandle.TotalPages > 1)
|
||||
size.Width += /*listThumbnails.ActualWidth*/ 150;
|
||||
|
||||
return size;
|
||||
}
|
||||
@@ -214,6 +215,9 @@ namespace QuickLook.Plugin.PDFViewer
|
||||
Enumerable.Range(0, PdfHandle.TotalPages).ForEach(PageIds.Add);
|
||||
OnPropertyChanged(nameof(PageIds));
|
||||
|
||||
if (PdfHandle.TotalPages < 2)
|
||||
listThumbnails.Visibility = Visibility.Collapsed;
|
||||
|
||||
CurrentPage = 0;
|
||||
pagePanel.DoZoomToFit();
|
||||
}
|
||||
|
Reference in New Issue
Block a user