minor UI tweak: show in taskbar when pinned

This commit is contained in:
Paddy Xu
2018-03-12 20:29:33 +02:00
parent 56b86ffb03
commit 4030f6f971
8 changed files with 44 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ namespace QuickLook.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -80,6 +80,16 @@ namespace QuickLook.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap app_png {
get {
object obj = ResourceManager.GetObject("app_png", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
@@ -99,5 +109,15 @@ namespace QuickLook.Properties {
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap app_white_png {
get {
object obj = ResourceManager.GetObject("app_white_png", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@@ -124,10 +124,16 @@
<data name="app_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\app_16.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="app_png" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\app.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="app_white" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\app_white.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="app_white_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\app_white_16.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="app_white_png" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\app_white.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@@ -193,6 +193,8 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Resource Include="Resources\app.png" />
<Resource Include="Resources\app_white.png" />
<None Include="packages.config" />
<None Include="Resources\app_white_16.ico" />
<None Include="Resources\app_16.ico" />

View File

@@ -8,6 +8,7 @@
<SolidColorBrush x:Key="CaptionButtonIconForeground" Color="#E5EFEFEF" />
<SolidColorBrush x:Key="CaptionButtonHoverBackground" Color="#22FFFFFF" />
<SolidColorBrush x:Key="CaptionButtonPressBackground" Color="#44FFFFFF" />
<SolidColorBrush x:Key="CaptionCloseButtonHoverForeground" Color="#E5EFEFEF" />
<SolidColorBrush x:Key="CaptionCloseButtonHoverBackground" Color="#FFE81123" />
<SolidColorBrush x:Key="CaptionCloseButtonPressBackground" Color="#FFB5394B" />
<SolidColorBrush x:Key="CaptionBackground" Color="#CC0E0E0E" />

View File

@@ -12,6 +12,7 @@
<SolidColorBrush x:Key="CaptionButtonIconForeground" Color="#E50E0E0E" />
<SolidColorBrush x:Key="CaptionButtonHoverBackground" Color="#44FFFFFF" />
<SolidColorBrush x:Key="CaptionButtonPressBackground" Color="#88FFFFFF" />
<SolidColorBrush x:Key="CaptionCloseButtonHoverForeground" Color="#E5EFEFEF" />
<SolidColorBrush x:Key="CaptionCloseButtonHoverBackground" Color="#FFE81123" />
<SolidColorBrush x:Key="CaptionCloseButtonPressBackground" Color="#FFB5394B" />
<SolidColorBrush x:Key="CaptionBackground" Color="#BBDADADA" />
@@ -81,6 +82,7 @@
<Style x:Key="CaptionCloseButtonStyle" TargetType="Button" BasedOn="{StaticResource CaptionButtonStyle}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource CaptionCloseButtonHoverForeground}" />
<Setter Property="Background" Value="{DynamicResource CaptionCloseButtonHoverBackground}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">

View File

@@ -32,7 +32,7 @@ namespace QuickLook
};
private bool _canOldPluginResize;
private bool _pinned;
internal bool Pinned
public bool Pinned
{
get => _pinned;
set

View File

@@ -14,8 +14,11 @@
Focusable="False"
ResizeMode="CanResizeWithGrip"
BorderBrush="{DynamicResource CaptionBackground}"
Foreground="{DynamicResource WindowTextForeground}"
Background="{DynamicResource MainWindowBackground}"
ShowActivated="False" ShowInTaskbar="False">
ShowInTaskbar="{Binding ElementName=mainWindow, Path=Pinned}"
Title="{Binding ElementName=titleAreaText, Path=Text}"
ShowActivated="False">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@@ -37,7 +40,6 @@
<Window.Style>
<Style TargetType="Window">
<Setter Property="BorderThickness" Value="{StaticResource MainWindowShadowMarginThickness}" />
<Setter Property="Foreground" Value="{DynamicResource WindowTextForeground}" />
</Style>
</Window.Style>
<Grid x:Name="windowFrameContainer"
@@ -142,7 +144,7 @@
<Button DockPanel.Dock="Left" x:Name="buttonShare" Style="{StaticResource CaptionButtonStyle}"
Content="&#xE7AC;" ToolTip="Open With..." />
<Grid x:Name="titleArea" Background="Transparent">
<TextBlock Text="{Binding ContextObject.Title, ElementName=mainWindow}" FontSize="12"
<TextBlock x:Name="titleAreaText" Text="{Binding ContextObject.Title, ElementName=mainWindow}" FontSize="12"
HorizontalAlignment="Left" TextTrimming="CharacterEllipsis"
VerticalAlignment="Center" Margin="5,0" />
</Grid>

View File

@@ -18,10 +18,13 @@
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using QuickLook.Common.ExtensionMethods;
using QuickLook.Common.Helpers;
using QuickLook.Common.Plugin;
using Brush = System.Windows.Media.Brush;
using FontFamily = System.Windows.Media.FontFamily;
using Size = System.Windows.Size;
namespace QuickLook
{
@@ -43,6 +46,8 @@ namespace QuickLook
InitializeComponent();
Icon = (App.IsWin10 ? Properties.Resources.app_white_png : Properties.Resources.app_png).ToBitmapSource();
FontFamily = new FontFamily(TranslationHelper.Get("UI_FontFamily", failsafe: "Segoe UI"));
SizeChanged += SaveWindowSizeOnSizeChanged;