update thumbnail style in PdfViewer

This commit is contained in:
Paddy Xu
2017-04-27 00:56:25 +03:00
parent fc5b2742d1
commit 7dcb0e615b
6 changed files with 74 additions and 8 deletions

View File

@@ -11,6 +11,7 @@ public:
DESKTOP = 1, DESKTOP = 1,
EXPLORER = 2, EXPLORER = 2,
}; };
static FocusedWindowType GetFocusedWindowType(); static FocusedWindowType GetFocusedWindowType();
static void SaveCurrentSelection(); static void SaveCurrentSelection();
static UINT GetCurrentSelectionCount(); static UINT GetCurrentSelectionCount();

View File

@@ -0,0 +1,52 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="ListBoxItemStyleNoFocusedBorder" TargetType="{x:Type ListBoxItem}">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="Transparent" />
<Setter Property="BorderBrush" TargetName="Bd" Value="Transparent" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelectionActive" Value="False" />
<Condition Property="IsSelected" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="Transparent" />
<Setter Property="BorderBrush" TargetName="Bd" Value="Transparent" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelectionActive" Value="True" />
<Condition Property="IsSelected" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="Transparent" />
<Setter Property="BorderBrush" TargetName="Bd" Value="Transparent" />
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="TextElement.Foreground" TargetName="Bd"
Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@@ -12,9 +12,9 @@
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
<local:PageIdToImageConverter x:Key="PageIdToImageConverter" /> <local:PageIdToImageConverter x:Key="PageIdToImageConverter" />
<Style x:Key="ListBoxItemStyleNoFocusedBorder" TargetType="{x:Type ListBoxItem}"> <ResourceDictionary.MergedDictionaries>
<Setter Property="FocusVisualStyle" Value="{x:Null}" /> <ResourceDictionary Source="ListBoxItemStyleNoFocusedBorder.xaml" />
</Style> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</UserControl.Resources> </UserControl.Resources>
<Grid> <Grid>
@@ -44,7 +44,7 @@
<RowDefinition Height="*" /> <RowDefinition Height="*" />
<RowDefinition Height="10" /> <RowDefinition Height="10" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Grid.Row="1" Grid.Column="1" BorderThickness="1" BorderBrush="#FFE1E1E1"> <Border x:Name="bbd" Grid.Row="1" Grid.Column="1" BorderThickness="1" BorderBrush="#FFE1E1E1">
<Image> <Image>
<Image.Source> <Image.Source>
<MultiBinding Converter="{StaticResource PageIdToImageConverter}"> <MultiBinding Converter="{StaticResource PageIdToImageConverter}">
@@ -58,6 +58,13 @@
<Label Grid.Row="1" Grid.Column="1" Content="{Binding Mode=OneWay, Converter={StaticResource MathConverter}, ConverterParameter=@VALUE+1}" FontSize="14" /> <Label Grid.Row="1" Grid.Column="1" Content="{Binding Mode=OneWay, Converter={StaticResource MathConverter}, ConverterParameter=@VALUE+1}" FontSize="14" />
--> -->
</Grid> </Grid>
<DataTemplate.Triggers>
<DataTrigger
Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}"
Value="True">
<Setter TargetName="bbd" Property="BorderBrush" Value="#FF0040FF" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ListBox.ItemTemplate>
</ListBox> </ListBox>

View File

@@ -281,6 +281,7 @@ namespace QuickLook.Plugin.PDFViewer
ZoomFactor = newZoom; ZoomFactor = newZoom;
ReRenderCurrentPage(); ReRenderCurrentPage();
scrolling = false;
}; };
} }

View File

@@ -74,6 +74,10 @@
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="ListBoxItemStyleNoFocusedBorder.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="PdfViewerControl.xaml"> <Page Include="PdfViewerControl.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>

View File

@@ -7,15 +7,16 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:plugin="clr-namespace:QuickLook.Plugin" xmlns:plugin="clr-namespace:QuickLook.Plugin"
mc:Ignorable="d" x:Class="QuickLook.MainWindow" x:Name="mainWindow" AllowsTransparency="True" WindowStyle="None" mc:Ignorable="d" x:Class="QuickLook.MainWindow" x:Name="mainWindow"
UseLayoutRounding="True" UseLayoutRounding="True"
Topmost="True" d:DesignWidth="624" d:DesignHeight="700" Topmost="True" d:DesignWidth="624" d:DesignHeight="700"
MinWidth="275" MinHeight="150" MinWidth="275" MinHeight="150"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
ResizeMode="CanResizeWithGrip" x:ClassModifier="internal" Focusable="False"
x:ClassModifier="internal" Focusable="False" ShowActivated="False" ShowInTaskbar="False"> ShowActivated="False" ShowInTaskbar="False" WindowStyle="None"
ResizeMode="CanResizeWithGrip" AllowsTransparency="True">
<Window.Background> <Window.Background>
<SolidColorBrush Color="#BFFFFFFF" /> <SolidColorBrush Color="#DFFFFFFF" />
</Window.Background> </Window.Background>
<Border x:Name="windowBorder" BorderThickness="1" BorderBrush="#FF7B7B7B"> <Border x:Name="windowBorder" BorderThickness="1" BorderBrush="#FF7B7B7B">
<Grid> <Grid>