mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-02-28 01:00:17 +08:00
Allow full window mouse dragging
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -149,6 +149,8 @@ namespace QuickLook
|
||||
|
||||
ResizeAndCenter(new Size(newWidth, newHeight));
|
||||
|
||||
chrome.CaptionHeight = ContextObject.FullWindowDragging ? Height : titlebar.Height - 5;
|
||||
|
||||
if (Visibility != Visibility.Visible)
|
||||
Show();
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace QuickLook.Plugin.InfoPanel
|
||||
|
||||
context.Title = "";
|
||||
context.CanResize = false;
|
||||
context.FullWindowDragging = true;
|
||||
}
|
||||
|
||||
public void View(string path, ContextObject context)
|
||||
|
||||
Reference in New Issue
Block a user