WIP #56: adjust shadows; add Gaussian blur, try out the new InfoPanel

This commit is contained in:
Paddy Xu
2017-08-04 22:02:32 +03:00
parent 15d94d2c4b
commit 8d59e7138c
17 changed files with 491 additions and 222 deletions

View File

@@ -6,6 +6,7 @@
xmlns:local="clr-namespace:QuickLook.Plugin.ImageViewer"
xmlns:animatedImage="clr-namespace:QuickLook.Plugin.ImageViewer.AnimatedImage"
mc:Ignorable="d"
Background="White"
x:Name="imagePanel"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
@@ -13,7 +14,7 @@
VerticalScrollBarVisibility="Auto" Focusable="False" IsManipulationEnabled="True">
<animatedImage:AnimatedImage x:Name="viewPanelImage" Stretch="None"
RenderOptions.BitmapScalingMode="{Binding RenderMode, ElementName=imagePanel}"
AnimationUri="{Binding ImageUriSource, ElementName=imagePanel}" />
AnimationUri="{Binding ImageUriSource, ElementName=imagePanel}" Margin="0,28,0,0" />
</ScrollViewer>
</Grid>
</UserControl>

View File

@@ -22,7 +22,7 @@ using System.Windows;
using System.Windows.Media;
using System.Windows.Threading;
namespace QuickLook.Controls
namespace QuickLook.Controls.BusyDecorator
{
public delegate Visual CreateContentFunction();

View File

@@ -22,7 +22,7 @@ using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
namespace QuickLook.Controls
namespace QuickLook.Controls.BusyDecorator
{
[StyleTypedProperty(Property = "BusyStyle", StyleTargetType = typeof(Control))]
public class BusyDecorator : Decorator, IDisposable

View File

@@ -18,7 +18,7 @@
using System.Windows;
using System.Windows.Media;
namespace QuickLook.Controls
namespace QuickLook.Controls.BusyDecorator
{
public class VisualTargetPresentationSource : PresentationSource
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,48 @@
sampler2D Texture1Sampler : register(S0);
float2 Direction : register(C0);
float4 DdxDdy : register(C1);
// http://dev.theomader.com/gaussian-kernel-calculator/
static const float HalfWidth = 80;
static const float poisson[161] =
{
0.004411,0.004466,0.004521,0.004576,0.004631,0.004686,0.004741,0.004796,0.004851,0.004905,
0.004959,0.005014,0.005067,0.005121,0.005175,0.005228,0.005281,0.005334,0.005386,0.005438,
0.00549,0.005541,0.005592,0.005642,0.005692,0.005742,0.005791,0.005839,0.005888,0.005935,
0.005982,0.006029,0.006074,0.00612,0.006164,0.006208,0.006252,0.006294,0.006336,0.006377,
0.006418,0.006458,0.006497,0.006535,0.006572,0.006609,0.006644,0.006679,0.006713,0.006746,
0.006779,0.00681,0.00684,0.00687,0.006898,0.006926,0.006952,0.006978,0.007003,0.007026,
0.007049,0.00707,0.007091,0.00711,0.007128,0.007146,0.007162,0.007177,0.007191,0.007204,
0.007216,0.007227,0.007236,0.007245,0.007252,0.007258,0.007263,0.007267,0.00727,0.007272,
0.007272,
0.007272,0.00727,0.007267,0.007263,0.007258,0.007252,0.007245,0.007236,0.007227,0.007216,
0.007204,0.007191,0.007177,0.007162,0.007146,0.007128,0.00711,0.007091,0.00707,0.007049,
0.007026,0.007003,0.006978,0.006952,0.006926,0.006898,0.00687,0.00684,0.00681,0.006779,
0.006746,0.006713,0.006679,0.006644,0.006609,0.006572,0.006535,0.006497,0.006458,0.006418,
0.006377,0.006336,0.006294,0.006252,0.006208,0.006164,0.00612,0.006074,0.006029,0.005982,
0.005935,0.005888,0.005839,0.005791,0.005742,0.005692,0.005642,0.005592,0.005541,0.00549,
0.005438,0.005386,0.005334,0.005281,0.005228,0.005175,0.005121,0.005067,0.005014,0.004959,
0.004905,0.004851,0.004796,0.004741,0.004686,0.004631,0.004576,0.004521,0.004466,0.004411
};
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 color = { 0, 0, 0, 1 };
for (int delta = -HalfWidth; delta <= HalfWidth; delta++)
{
float2 coord;
coord.x = uv.x + delta * DdxDdy.x * Direction.x;
coord.y = uv.y + delta * DdxDdy.w * Direction.y;
coord = saturate(coord);
// Sample pixel
color += tex2D(Texture1Sampler, coord) * poisson[delta + HalfWidth];
}
return(color);
}

Binary file not shown.

View File

@@ -0,0 +1,59 @@
// Copyright © 2017 Paddy Xu
//
// This file is part of QuickLook program.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Effects;
namespace QuickLook.Controls.GlassLayer
{
public class GaussianBlurEffect : ShaderEffect
{
public static readonly DependencyProperty InputProperty =
RegisterPixelShaderSamplerProperty("Input", typeof(GaussianBlurEffect), 0);
public static readonly DependencyProperty DirectionProperty =
DependencyProperty.Register("Direction", typeof(Point), typeof(GaussianBlurEffect),
new UIPropertyMetadata(new Point(0, 1), PixelShaderConstantCallback(0)));
public GaussianBlurEffect()
{
var pixelShader = new PixelShader
{
UriSource = new Uri("pack://application:,,,/QuickLook;component/Controls/GlassLayer/GaussianBlur.ps",
UriKind.Absolute)
};
PixelShader = pixelShader;
DdxUvDdyUvRegisterIndex = 1;
UpdateShaderValue(InputProperty);
UpdateShaderValue(DirectionProperty);
}
public Brush Input
{
get => (Brush) GetValue(InputProperty);
set => SetValue(InputProperty, value);
}
public Point Direction
{
get => (Point) GetValue(DirectionProperty);
set => SetValue(DirectionProperty, value);
}
}
}

View File

@@ -0,0 +1,36 @@
<UserControl x:Class="QuickLook.Controls.GlassLayer.GlassLayer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:QuickLook.Controls.GlassLayer"
mc:Ignorable="d"
x:Name="glassLayer"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Rectangle Panel.ZIndex="100" Visibility="{Binding ElementName=glassLayer, Path=NoiseVisibility}">
<Rectangle.Fill>
<ImageBrush ImageSource="100-50-5-monochrome.png" AlignmentY="Top" ViewportUnits="Absolute"
Opacity="0.5"
Viewport="0,0,100,100" TileMode="FlipY" Stretch="UniformToFill" />
</Rectangle.Fill>
</Rectangle>
<Rectangle Panel.ZIndex="50" Fill="#FFDADADA" Opacity="{Binding ElementName=glassLayer,Path=GlassOpacity}" />
<Grid Panel.ZIndex="0">
<Grid.Effect>
<local:GaussianBlurEffect Direction="0,1" />
</Grid.Effect>
<Grid>
<Grid.Effect>
<local:GaussianBlurEffect Direction="1,0" />
</Grid.Effect>
<Grid.Background>
<VisualBrush Visual="{Binding ElementName=glassLayer, Path=BlurredElement}" AlignmentX="Left"
AlignmentY="Top"
Stretch="None" />
</Grid.Background>
<StackPanel />
</Grid>
</Grid>
</Grid>
</UserControl>

View File

@@ -0,0 +1,93 @@
// Copyright © 2017 Paddy Xu
//
// This file is part of QuickLook program.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace QuickLook.Controls.GlassLayer
{
/// <summary>
/// Interaction logic for GlassLayer.xaml
/// </summary>
public partial class GlassLayer : UserControl
{
public GlassLayer()
{
InitializeComponent();
}
#region public Visual BlurredElement
/// <summary>
/// Identifies the BlurredElement dependency property.
/// </summary>
public static DependencyProperty BlurredElementProperty =
DependencyProperty.Register("BlurredElement", typeof(Visual), typeof(GlassLayer), null);
/// <summary>
/// </summary>
public Visual BlurredElement
{
get => (Visual) GetValue(BlurredElementProperty);
set => SetValue(BlurredElementProperty, value);
}
#endregion public Visual BlurredElement
#region public double GlassOpacity
/// <summary>
/// Identifies the GlassOpacity dependency property.
/// </summary>
public static DependencyProperty GlassOpacityProperty =
DependencyProperty.Register("GlassOpacity", typeof(double), typeof(GlassLayer),
new UIPropertyMetadata(0.6));
/// <summary>
/// </summary>
public double GlassOpacity
{
get => (double) GetValue(GlassOpacityProperty);
set => SetValue(GlassOpacityProperty, value);
}
#endregion public double GlassOpacity
#region public Visibility NoiseVisibility
/// <summary>
/// Identifies the NoiseVisibility dependency property.
/// </summary>
public static DependencyProperty NoiseVisibilityProperty =
DependencyProperty.Register("NoiseVisibility", typeof(Visibility), typeof(GlassLayer),
new UIPropertyMetadata(Visibility.Visible));
/// <summary>
/// </summary>
public Visibility NoiseVisibility
{
get => (Visibility) GetValue(NoiseVisibilityProperty);
set => SetValue(NoiseVisibilityProperty, value);
}
#endregion public Visibility NoiseVisibility
}
}

View File

@@ -3,17 +3,20 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:local="clr-namespace:QuickLook"
xmlns:control="clr-namespace:QuickLook.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:converters="clr-namespace:QuickLook.Converters"
xmlns:controls="clr-namespace:QuickLook.Controls"
xmlns:busyDecorator="clr-namespace:QuickLook.Controls.BusyDecorator"
xmlns:glassLayer="clr-namespace:QuickLook.Controls.GlassLayer"
mc:Ignorable="d" x:Class="QuickLook.MainWindowTransparent" x:Name="mainWindow"
UseLayoutRounding="True"
d:DesignWidth="624" d:DesignHeight="700"
MinWidth="275" MinHeight="150"
WindowStartupLocation="CenterScreen"
Focusable="False" WindowStyle="None"
Background="#E5FAFAFA" AllowsTransparency="True"
AllowsTransparency="True"
Background="Transparent"
ShowActivated="False" ShowInTaskbar="False">
<Window.Resources>
<converters:BooleanToResizeModeConverter x:Key="BooleanToResizeModeConverter" />
@@ -21,213 +24,218 @@
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:ScaledValueConverter x:Key="ScaledValueConverter" />
</Window.Resources>
<Window.ResizeMode>
<Binding Converter="{StaticResource BooleanToResizeModeConverter}" ElementName="mainWindow"
Path="ContextObject.CanResize" />
</Window.ResizeMode>
<WindowChrome.WindowChrome>
<WindowChrome x:Name="chrome"
ResizeBorderThickness="{Binding ContextObject.CanResize, Converter={StaticResource BooleanToResizeBorderThicknessConverter}, ElementName=mainWindow}"
UseAeroCaptionButtons="False" />
</WindowChrome.WindowChrome>
<Border x:Name="windowBorder" BorderThickness="1" BorderBrush="#FF7B7B7B">
<Grid>
<DockPanel x:Name="windowPanel">
<DockPanel.Style>
<Style TargetType="{x:Type DockPanel}">
<Style.Triggers>
<DataTrigger Binding="{Binding ContextObject.IsBusy, ElementName=mainWindow, Mode=OneWay}"
Value="False">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1"
BeginTime="0:0:0" Duration="0:0:0" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="1" To="0"
BeginTime="0:0:0" Duration="0:0:0" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</DockPanel.Style>
<DockPanel x:Name="titlebar" Height="28" Dock="Top">
<fa:ImageAwesome DockPanel.Dock="Right" x:Name="buttonCloseWindow" Icon="TimesCircle"
WindowChrome.IsHitTestVisibleInChrome="True"
Width="15" Height="15" Margin="5,0,10,0" Foreground="#E5868686"
Cursor="Hand" />
<fa:ImageAwesome DockPanel.Dock="Right" x:Name="buttonWindowStatus"
WindowChrome.IsHitTestVisibleInChrome="True"
Width="14" Height="14" Margin="5,0,5,0" Foreground="#E5868686"
Visibility="{Binding ContextObject.CanResize,ElementName=mainWindow,Converter={StaticResource BooleanToVisibilityConverter}}"
Cursor="Hand">
<fa:ImageAwesome.Style>
<Style TargetType="{x:Type fa:ImageAwesome}">
<Setter Property="Icon" Value="WindowMaximize" />
<Style.Triggers>
<DataTrigger Binding="{Binding WindowState, ElementName=mainWindow}"
Value="Maximized">
<Setter Property="Icon" Value="WindowRestore" />
</DataTrigger>
<DataTrigger Binding="{Binding WindowState, ElementName=mainWindow}"
Value="Normal">
<Border>
<Border.Effect>
<DropShadowEffect BlurRadius="5" ShadowDepth="0" Opacity="0.6" Color="Gray" />
</Border.Effect>
<Grid Background="#FFF8F8FB" Margin="5">
<Grid>
<Grid x:Name="windowPanel">
<Grid.Style>
<Style TargetType="{x:Type Grid}">
<Style.Triggers>
<DataTrigger
Binding="{Binding ContextObject.IsBusy, ElementName=mainWindow, Mode=OneWay}"
Value="False">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1"
BeginTime="0:0:0" Duration="0:0:0" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="1" To="0"
BeginTime="0:0:0" Duration="0:0:0" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid VerticalAlignment="Top" Panel.ZIndex="9999">
<glassLayer:GlassLayer BlurredElement="{Binding ElementName=container}" />
<DockPanel x:Name="titlebar" Height="28">
<fa:ImageAwesome DockPanel.Dock="Right" x:Name="buttonCloseWindow" Icon="TimesCircle"
WindowChrome.IsHitTestVisibleInChrome="True"
Width="15" Height="15" Margin="5,0,10,0" Foreground="#E5868686"
Cursor="Hand" />
<fa:ImageAwesome DockPanel.Dock="Right" x:Name="buttonWindowStatus"
WindowChrome.IsHitTestVisibleInChrome="True"
Width="14" Height="14" Margin="5,0,5,0" Foreground="#E5868686"
Visibility="{Binding ContextObject.CanResize,ElementName=mainWindow,Converter={StaticResource BooleanToVisibilityConverter}}"
Cursor="Hand">
<fa:ImageAwesome.Style>
<Style TargetType="{x:Type fa:ImageAwesome}">
<Setter Property="Icon" Value="WindowMaximize" />
</DataTrigger>
</Style.Triggers>
</Style>
</fa:ImageAwesome.Style>
</fa:ImageAwesome>
<fa:ImageAwesome DockPanel.Dock="Right" x:Name="buttonShare" Icon="ShareAlt"
WindowChrome.IsHitTestVisibleInChrome="True"
Width="14" Height="14" Margin="10,0,5,0" Foreground="#E5868686"
Cursor="Hand" />
<Button x:Name="buttonOpenWith" DockPanel.Dock="Right" Content="Open with..." Height="20"
Margin="10,0,0,0" Padding="5,0"
MaxWidth="{Binding Width, ElementName=mainWindow, Converter={StaticResource ScaledValueConverter}, ConverterParameter='0.25'}"
Focusable="False" Cursor="Hand"
Background="#E5EEEEEE" BorderBrush="#E59A9A9A"
WindowChrome.IsHitTestVisibleInChrome="True" Foreground="#FF404040">
<Button.ContentTemplate>
<DataTemplate>
<TextBlock TextTrimming="CharacterEllipsis" Text="{Binding}" />
</DataTemplate>
</Button.ContentTemplate>
</Button>
<Grid DockPanel.Dock="Left" Width="20" Margin="5,0">
<fa:ImageAwesome x:Name="buttonPin"
WindowChrome.IsHitTestVisibleInChrome="True"
Width="14" Height="14"
Cursor="Hand">
<fa:ImageAwesome.Style>
<Style TargetType="{x:Type fa:ImageAwesome}">
<Setter Property="Icon" Value="ThumbTack" />
<Setter Property="Foreground" Value="#E5868686" />
<Setter Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="-45" />
</Setter.Value>
</Setter>
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition
Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource Self}}"
Value="True" />
<Condition Binding="{Binding Pinned, ElementName=mainWindow}"
Value="True" />
<Condition
Binding="{Binding Path=LayoutTransform.(RotateTransform.Angle), RelativeSource={RelativeSource Self}}"
Value="0" />
</MultiDataTrigger.Conditions>
<MultiDataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty="Icon">
<DiscreteObjectKeyFrame KeyTime="0:0:0.2"
Value="{x:Static fa:FontAwesomeIcon.TimesCircle}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</MultiDataTrigger.EnterActions>
<MultiDataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty="Icon">
<DiscreteObjectKeyFrame KeyTime="0:0:0"
Value="{x:Static fa:FontAwesomeIcon.ThumbTack}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</MultiDataTrigger.ExitActions>
</MultiDataTrigger>
<DataTrigger Binding="{Binding Pinned, ElementName=mainWindow}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ParallelTimeline>
<DoubleAnimation
Storyboard.TargetProperty="LayoutTransform.(RotateTransform.Angle)"
To="0" Duration="0:0:0.05" />
<ColorAnimation
Storyboard.TargetProperty="Foreground.(SolidColorBrush.Color)"
To="#E53C3C3C" Duration="0:0:0.05" />
</ParallelTimeline>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<Setter Property="Foreground" Value="#E53C3C3C" />
</DataTrigger>
</Style.Triggers>
</Style>
</fa:ImageAwesome.Style>
</fa:ImageAwesome>
<Style.Triggers>
<DataTrigger Binding="{Binding WindowState, ElementName=mainWindow}"
Value="Maximized">
<Setter Property="Icon" Value="WindowRestore" />
</DataTrigger>
<DataTrigger Binding="{Binding WindowState, ElementName=mainWindow}"
Value="Normal">
<Setter Property="Icon" Value="WindowMaximize" />
</DataTrigger>
</Style.Triggers>
</Style>
</fa:ImageAwesome.Style>
</fa:ImageAwesome>
<fa:ImageAwesome DockPanel.Dock="Right" x:Name="buttonShare" Icon="ShareAlt"
WindowChrome.IsHitTestVisibleInChrome="True"
Width="14" Height="14" Margin="10,0,5,0" Foreground="#E5868686"
Cursor="Hand" />
<Button x:Name="buttonOpenWith" DockPanel.Dock="Right" Content="Open with..." Height="20"
Margin="10,0,0,0" Padding="5,0"
MaxWidth="{Binding Width, ElementName=mainWindow, Converter={StaticResource ScaledValueConverter}, ConverterParameter='0.25'}"
Focusable="False" Cursor="Hand"
Background="#E5EEEEEE" BorderBrush="#E59A9A9A"
WindowChrome.IsHitTestVisibleInChrome="True" Foreground="#FF404040">
<Button.ContentTemplate>
<DataTemplate>
<TextBlock TextTrimming="CharacterEllipsis" Text="{Binding}" />
</DataTemplate>
</Button.ContentTemplate>
</Button>
<Grid DockPanel.Dock="Left" Width="20" Margin="5,0">
<fa:ImageAwesome x:Name="buttonPin"
WindowChrome.IsHitTestVisibleInChrome="True"
Width="14" Height="14"
Cursor="Hand">
<fa:ImageAwesome.Style>
<Style TargetType="{x:Type fa:ImageAwesome}">
<Setter Property="Icon" Value="ThumbTack" />
<Setter Property="Foreground" Value="#E5868686" />
<Setter Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="-45" />
</Setter.Value>
</Setter>
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition
Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource Self}}"
Value="True" />
<Condition Binding="{Binding Pinned, ElementName=mainWindow}"
Value="True" />
<Condition
Binding="{Binding Path=LayoutTransform.(RotateTransform.Angle), RelativeSource={RelativeSource Self}}"
Value="0" />
</MultiDataTrigger.Conditions>
<MultiDataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty="Icon">
<DiscreteObjectKeyFrame KeyTime="0:0:0.2"
Value="{x:Static fa:FontAwesomeIcon.TimesCircle}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</MultiDataTrigger.EnterActions>
<MultiDataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty="Icon">
<DiscreteObjectKeyFrame KeyTime="0:0:0"
Value="{x:Static fa:FontAwesomeIcon.ThumbTack}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</MultiDataTrigger.ExitActions>
</MultiDataTrigger>
<DataTrigger Binding="{Binding Pinned, ElementName=mainWindow}"
Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ParallelTimeline>
<DoubleAnimation
Storyboard.TargetProperty="LayoutTransform.(RotateTransform.Angle)"
To="0" Duration="0:0:0.05" />
<ColorAnimation
Storyboard.TargetProperty="Foreground.(SolidColorBrush.Color)"
To="#E53C3C3C" Duration="0:0:0.05" />
</ParallelTimeline>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<Setter Property="Foreground" Value="#E53C3C3C" />
</DataTrigger>
</Style.Triggers>
</Style>
</fa:ImageAwesome.Style>
</fa:ImageAwesome>
</Grid>
<!-- set grid.background colour makes it clickable -->
<Grid x:Name="titleArea" Background="Transparent">
<TextBlock Text="{Binding ContextObject.Title, ElementName=mainWindow}" FontSize="14"
HorizontalAlignment="Center" TextTrimming="CharacterEllipsis"
VerticalAlignment="Center" Margin="5,0" />
</Grid>
</DockPanel>
</Grid>
<!-- set grid.background colour makes it clickable -->
<Grid x:Name="titleArea" Background="Transparent">
<TextBlock Text="{Binding ContextObject.Title, ElementName=mainWindow}" FontSize="14"
HorizontalAlignment="Center" TextTrimming="CharacterEllipsis"
VerticalAlignment="Center" Margin="5,0" />
</Grid>
</DockPanel>
<Grid>
<ContentControl x:Name="container"
Content="{Binding ContextObject.ViewerContent, ElementName=mainWindow}" />
</Grid>
</DockPanel>
<Grid x:Name="busyIndicatorLayer">
<Grid.Style>
<Style TargetType="{x:Type Grid}">
<Style.Triggers>
<DataTrigger Binding="{Binding ContextObject.IsBusy, ElementName=mainWindow, Mode=OneWay}"
Value="False">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ParallelTimeline>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0"
Duration="0:0:0.05" />
<ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0:0:0.05"
Value="{x:Static Visibility.Hidden}" />
</ObjectAnimationUsingKeyFrames>
</ParallelTimeline>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<ParallelTimeline>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1"
Duration="0:0:0" />
<ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0:0:0"
Value="{x:Static Visibility.Visible}" />
</ObjectAnimationUsingKeyFrames>
</ParallelTimeline>
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<!--IsBusyIndicatorShowing="{Binding IsVisible, ElementName=busyIndicatorLayer}"-->
<control:BusyDecorator x:Name="busyDecorator"
IsBusyIndicatorShowing="True"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
<Grid x:Name="busyIndicatorLayer">
<Grid.Style>
<Style TargetType="{x:Type Grid}">
<Style.Triggers>
<DataTrigger
Binding="{Binding ContextObject.IsBusy, ElementName=mainWindow, Mode=OneWay}"
Value="False">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ParallelTimeline>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0"
Duration="0:0:0.05" />
<ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0:0:0.05"
Value="{x:Static Visibility.Hidden}" />
</ObjectAnimationUsingKeyFrames>
</ParallelTimeline>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<ParallelTimeline>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1"
Duration="0:0:0" />
<ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0:0:0"
Value="{x:Static Visibility.Visible}" />
</ObjectAnimationUsingKeyFrames>
</ParallelTimeline>
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<!--IsBusyIndicatorShowing="{Binding IsVisible, ElementName=busyIndicatorLayer}"-->
<busyDecorator:BusyDecorator x:Name="busyDecorator"
IsBusyIndicatorShowing="True"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
</Grid>
</Grid>
</Border>

View File

@@ -50,8 +50,8 @@ namespace QuickLook
SourceInitialized += (sender, e) =>
{
if (AllowsTransparency)
BlurWindow.EnableWindowBlur(this);
//if (AllowsTransparency)
// BlurWindow.EnableWindowBlur(this);
};
buttonPin.MouseLeftButtonUp += (sender, e) =>
@@ -234,10 +234,8 @@ namespace QuickLook
// revert UI changes
ContextObject.IsBusy = true;
var newHeight = ContextObject.PreferredSize.Height + titlebar.Height + windowBorder.BorderThickness.Top +
windowBorder.BorderThickness.Bottom;
var newWidth = ContextObject.PreferredSize.Width + windowBorder.BorderThickness.Left +
windowBorder.BorderThickness.Right;
var newHeight = ContextObject.PreferredSize.Height + titlebar.Height;
var newWidth = ContextObject.PreferredSize.Width;
ResizeAndCenter(new Size(newWidth, newHeight));

View File

@@ -5,13 +5,18 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:QuickLook.Plugin.InfoPanel"
FontSize="14"
mc:Ignorable="d" Width="453" Height="172" UseLayoutRounding="True">
Background="#FFF8F8FB"
mc:Ignorable="d" Width="453" Height="172" UseLayoutRounding="True" TextOptions.TextHintingMode="Animated">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="65*" />
</Grid.ColumnDefinitions>
<Image x:Name="image" Grid.Column="0" Height="128" Width="128" Stretch="Fill" Opacity="0" Margin="0,-20,0,0">
<Image x:Name="image" Grid.Row="1" Grid.Column="0" Height="128" Width="128" Stretch="Fill" Opacity="0" Margin="0,-20,0,0">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>
@@ -29,7 +34,7 @@
</Style>
</Image.Style>
</Image>
<Grid Grid.Column="1">
<Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5" />
<ColumnDefinition Width="*" />
@@ -43,13 +48,19 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock x:Name="filename" Grid.Row="1" Grid.Column="1" FontSize="19" FontWeight="SemiBold" Padding="3"
<TextBlock x:Name="filename" Grid.Row="1" Grid.Column="1" FontSize="19" Padding="3"
TextWrapping="Wrap"
LineHeight="25" MaxHeight="60" TextTrimming="CharacterEllipsis">
LineHeight="25" MaxHeight="60" TextTrimming="CharacterEllipsis" FontWeight="Normal">
FilenameFilenameFilenameFilenameFilenameFilenameFilenameFilenameFilenameFilename.ext
</TextBlock>
<TextBlock x:Name="modDate" Grid.Row="3" Grid.Column="1" Padding="3">Last modified at 01/01/2017 00:00:00</TextBlock>
<TextBlock x:Name="totalSize" Grid.Row="4" Grid.Column="1" Padding="3">Calculating size...</TextBlock>
<TextBlock x:Name="modDate" Grid.Row="3" Grid.Column="1" Padding="3" FontWeight="Light"
Foreground="DimGray">
Last modified at 01/01/2017 00:00:00
</TextBlock>
<TextBlock x:Name="totalSize" Grid.Row="4" Grid.Column="1" Padding="3" FontWeight="Light"
Foreground="DimGray">
Calculating size...
</TextBlock>
</Grid>
</Grid>
</UserControl>

View File

@@ -111,15 +111,19 @@
<Compile Include="..\GitVersion.cs">
<Link>Properties\GitVersion.cs</Link>
</Compile>
<Compile Include="Controls\GlassLayer\GaussianBlurEffect.cs" />
<Compile Include="Controls\GlassLayer\GlassLayer.xaml.cs">
<DependentUpon>GlassLayer.xaml</DependentUpon>
</Compile>
<Compile Include="Converters\BooleanToResizeModeConverter.cs" />
<Compile Include="Converters\BooleanToVisibilityConverter.cs" />
<Compile Include="Converters\BooleanToResizeBorderThicknessConverter.cs" />
<Compile Include="Converters\ScaledValueConverter.cs" />
<Compile Include="FocusMonitor.cs" />
<Compile Include="Helpers\AutoStartupHelper.cs" />
<Compile Include="Controls\BackgroundVisualHost.cs" />
<Compile Include="Controls\BusyDecorator.cs" />
<Compile Include="Controls\VisualTargetPresentationSource.cs" />
<Compile Include="Controls\BusyDecorator\BackgroundVisualHost.cs" />
<Compile Include="Controls\BusyDecorator\BusyDecorator.cs" />
<Compile Include="Controls\BusyDecorator\VisualTargetPresentationSource.cs" />
<Compile Include="ExtensionMethods\TypeExtensions.cs" />
<Compile Include="Helpers\BlurLibrary\BlurWindow.cs" />
<Compile Include="Helpers\BlurLibrary\Helpers.cs" />
@@ -163,6 +167,10 @@
<Compile Include="Controls\WebClientEx.cs">
<SubType>Component</SubType>
</Compile>
<Page Include="Controls\GlassLayer\GlassLayer.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Plugin\InfoPanel\InfoPanel.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -218,6 +226,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="app.manifest" />
<Resource Include="Controls\GlassLayer\GaussianBlur.ps" />
<None Include="key.snk" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
@@ -269,6 +278,10 @@
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Resource Include="Controls\GlassLayer\100-50-5-monochrome.png" />
<None Include="Controls\GlassLayer\GaussianBlur.fx" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>powershell -file "$(SolutionDir)Scripts\update-version.ps1"

View File

@@ -3,9 +3,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:local="clr-namespace:QuickLook"
xmlns:controls="clr-namespace:QuickLook.Controls">
xmlns:controls="clr-namespace:QuickLook.Controls"
xmlns:busyDecorator="clr-namespace:QuickLook.Controls.BusyDecorator">
<Style TargetType="{x:Type controls:BusyDecorator}">
<Style TargetType="{x:Type busyDecorator:BusyDecorator}">
<Setter Property="BusyStyle">
<Setter.Value>
<Style TargetType="{x:Type Control}">

View File

@@ -92,5 +92,5 @@
<InfoPanel_File>{0} archivo</InfoPanel_File>
<InfoPanel_Files>{0} archivos</InfoPanel_Files>
<InfoPanel_FolderAndFile>({0} y {1})</InfoPanel_FolderAndFile>
</es-ES>
</es-ES>
</Translations>

View File

@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net462" />