Allow full window mouse dragging

This commit is contained in:
Paddy Xu
2017-07-01 23:17:55 +03:00
parent 0a5ec182c9
commit 0cdaad32af
4 changed files with 19 additions and 3 deletions

View File

@@ -25,8 +25,7 @@
Path="ContextObject.CanResize" />
</Window.ResizeMode>
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="{Binding Height, ElementName=titlebar}"
ResizeBorderThickness="{Binding ContextObject.CanResize, Converter={StaticResource BooleanToResizeBorderThicknessConverter}, ElementName=mainWindow}"
<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">

View File

@@ -149,6 +149,8 @@ namespace QuickLook
ResizeAndCenter(new Size(newWidth, newHeight));
chrome.CaptionHeight = ContextObject.FullWindowDragging ? Height : titlebar.Height - 5;
if (Visibility != Visibility.Visible)
Show();

View File

@@ -31,7 +31,7 @@ namespace QuickLook.Plugin
{
private bool _canFocus;
private bool _canResize = true;
private bool _fullWindowDragging;
private bool _isBusy = true;
private string _title = "";
private object _viewerContent;
@@ -98,6 +98,19 @@ namespace QuickLook.Plugin
}
}
/// <summary>
/// Set whether the full viewer window can be used for mouse dragging.
/// </summary>
public bool FullWindowDragging
{
get => _fullWindowDragging;
set
{
_fullWindowDragging = value;
OnPropertyChanged();
}
}
/// <summary>
/// Set whether user are allowed to set focus at the viewer window.
/// </summary>
@@ -164,6 +177,7 @@ namespace QuickLook.Plugin
IsBusy = true;
PreferredSize = new Size();
CanResize = true;
FullWindowDragging = false;
CanFocus = false;
}

View File

@@ -41,6 +41,7 @@ namespace QuickLook.Plugin.InfoPanel
context.Title = "";
context.CanResize = false;
context.FullWindowDragging = true;
}
public void View(string path, ContextObject context)