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,
EXPLORER = 2,
};
static FocusedWindowType GetFocusedWindowType();
static void SaveCurrentSelection();
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>
<ResourceDictionary>
<local:PageIdToImageConverter x:Key="PageIdToImageConverter" />
<Style x:Key="ListBoxItemStyleNoFocusedBorder" TargetType="{x:Type ListBoxItem}">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
</Style>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ListBoxItemStyleNoFocusedBorder.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
@@ -44,7 +44,7 @@
<RowDefinition Height="*" />
<RowDefinition Height="10" />
</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.Source>
<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" />
-->
</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>
</ListBox.ItemTemplate>
</ListBox>

View File

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

View File

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

View File

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