limit title-bar button width; minor fixes and cleanup

This commit is contained in:
Paddy Xu
2017-11-02 22:32:49 +02:00
parent 5055669981
commit 7ba410bb4e
4 changed files with 14 additions and 9 deletions

View File

@@ -130,7 +130,7 @@ namespace QuickLook.Plugin.VideoViewer
private void AutoHideViedoControlContainer(object sender, EventArgs e)
{
if (ShowVideo)
if (!ShowVideo)
return;
if (videoControlContainer.IsMouseOver)

View File

@@ -105,7 +105,7 @@ namespace QuickLook.Helpers
{
var mmi = (MinMaxInfo) Marshal.PtrToStructure(lParam, typeof(MinMaxInfo));
// Adjust the maximized size and position to fit the work area of the correct monitor
// Adjust the maximized size and position to fit the work area of the current monitor
var currentScreen = Screen.FromHandle(hwnd);
var workArea = currentScreen.WorkingArea;
var monitorArea = currentScreen.Bounds;

View File

@@ -27,16 +27,14 @@
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</ResourceDictionary>
</controls:MainWindowBase.Resources>
<controls:MainWindowBase.Style>
<Style TargetType="controls:MainWindowBase">
<Setter Property="Foreground" Value="{DynamicResource WindowTextForeground}" />
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" CornerRadius="0" GlassFrameThickness="0,0,0,1"
ResizeBorderThickness="{Binding ContextObject.CanResize, Converter={StaticResource BooleanToResizeBorderThicknessConverter}, ElementName=mainWindow}"
UseAeroCaptionButtons="False" />
</Setter.Value>
</Setter>
</WindowChrome.WindowChrome>
<controls:MainWindowBase.Style>
<Style TargetType="controls:MainWindowBase">
<Setter Property="Foreground" Value="{DynamicResource WindowTextForeground}" />
</Style>
</controls:MainWindowBase.Style>
<Grid x:Name="windowFrameContainer" Background="{DynamicResource MainWindowBackground}">
@@ -68,6 +66,9 @@
GlassVisibility="{Binding ContextObject.TitlebarBlurVisibility, ElementName=mainWindow, Converter={StaticResource BooleanToVisibilityConverter}}"
NoiseVisibility="{Binding ContextObject.TitlebarBlurVisibility, ElementName=mainWindow, Converter={StaticResource BooleanToVisibilityConverter}}" />
<DockPanel>
<DockPanel.Effect>
<DropShadowEffect ShadowDepth="0" BlurRadius="2" Opacity="0.7" Color="#B2FFFFFF" />
</DockPanel.Effect>
<Button DockPanel.Dock="Right" x:Name="buttonCloseWindow"
Style="{StaticResource CaptionCloseButtonStyle}" Content="&#xE894;" />
<Button DockPanel.Dock="Right" x:Name="buttonWindowStatus"

View File

@@ -373,6 +373,10 @@ namespace QuickLook
void AddToInlines(string str, string replaceWith)
{
// limit str length
if (replaceWith.Length > 16)
replaceWith = replaceWith.Substring(0, 14) + "…" + replaceWith.Substring(replaceWith.Length - 2);
str = TranslationHelper.GetString(str);
var elements = str.Split(new[] {"{0}"}, StringSplitOptions.None).ToList();
while (elements.Count < 2)