mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-03-28 01:01:15 +08:00
Fix #46: turn the 📌 icon into ✖ after pinned
This commit is contained in:
@@ -98,12 +98,13 @@
|
||||
</DataTemplate>
|
||||
</Button.ContentTemplate>
|
||||
</Button>
|
||||
<fa:ImageAwesome DockPanel.Dock="Left" x:Name="buttonPin" Icon="ThumbTack"
|
||||
<fa:ImageAwesome DockPanel.Dock="Left" x:Name="buttonPin"
|
||||
WindowChrome.IsHitTestVisibleInChrome="True"
|
||||
Width="14" Height="14" Margin="10,0"
|
||||
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>
|
||||
@@ -111,6 +112,17 @@
|
||||
</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" />
|
||||
</MultiDataTrigger.Conditions>
|
||||
<MultiDataTrigger.Setters>
|
||||
<Setter Property="Icon" Value="TimesCircle" />
|
||||
</MultiDataTrigger.Setters>
|
||||
</MultiDataTrigger>
|
||||
<DataTrigger Binding="{Binding Pinned, ElementName=mainWindow}" Value="True">
|
||||
<Setter Property="Foreground" Value="#E53C3C3C" />
|
||||
<Setter Property="LayoutTransform">
|
||||
|
||||
@@ -56,7 +56,15 @@ namespace QuickLook
|
||||
|
||||
buttonPin.MouseLeftButtonUp += (sender, e) =>
|
||||
{
|
||||
if (Pinned) return;
|
||||
if (Pinned)
|
||||
{
|
||||
buttonCloseWindow.RaiseEvent(
|
||||
new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Left)
|
||||
{
|
||||
RoutedEvent = MouseLeftButtonUpEvent
|
||||
});
|
||||
return;
|
||||
}
|
||||
Pinned = true;
|
||||
ViewWindowManager.GetInstance().ForgetCurrentWindow();
|
||||
};
|
||||
@@ -194,10 +202,17 @@ namespace QuickLook
|
||||
|
||||
ContextObject.Reset();
|
||||
|
||||
Plugin?.Cleanup();
|
||||
try
|
||||
{
|
||||
Plugin?.Cleanup();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.WriteLine(e);
|
||||
}
|
||||
Plugin = null;
|
||||
|
||||
ProcessHelper.PerformAggressiveGC();
|
||||
Path = string.Empty;
|
||||
}
|
||||
|
||||
internal void BeginShow(IViewer matchedPlugin, string path, Action<ExceptionDispatchInfo> exceptionHandler)
|
||||
|
||||
Reference in New Issue
Block a user