Fix windows timer resolution

This commit is contained in:
Paddy Xu
2018-02-03 20:55:15 +02:00
parent dada8bc6e7
commit b04fbabae6
3 changed files with 7 additions and 29 deletions

View File

@@ -31,7 +31,7 @@ namespace QuickLook.Common.Plugin
{
private bool _canResize = true;
private bool _fullWindowDragging;
private bool _isBusy = true;
private bool _isBusy;
private string _title = string.Empty;
private bool _titlebarAutoHide;
private bool _titlebarBlurVisibility;
@@ -207,7 +207,8 @@ namespace QuickLook.Common.Plugin
public void Reset()
{
Title = string.Empty;
IsBusy = true;
// set to False to prevent showing loading icon
IsBusy = false;
PreferredSize = new Size();
CanResize = true;
FullWindowDragging = false;

View File

@@ -70,7 +70,7 @@ namespace QuickLook.Controls.BusyDecorator
{
GC.SuppressFinalize(this);
_busyHost.ThreadedHelper.Exit();
_busyHost.ThreadedHelper?.Exit();
}
protected override Visual GetVisualChild(int index)

View File

@@ -152,35 +152,12 @@
<ContentControl x:Name="container"
Foreground="{DynamicResource WindowTextForeground}"
Content="{Binding ContextObject.ViewerContent, ElementName=mainWindow}" />
<DockPanel.Style>
<Style TargetType="{x:Type DockPanel}">
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger
Binding="{Binding ContextObject.IsBusy, ElementName=mainWindow}"
Value="True">
<Setter Property="Visibility" Value="Hidden" />
</DataTrigger>
</Style.Triggers>
</Style>
</DockPanel.Style>
</DockPanel>
</Grid>
<Grid x:Name="busyIndicatorLayer" ZIndex="200">
<Grid.Style>
<Style TargetType="{x:Type Grid}">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger
Binding="{Binding ContextObject.IsBusy, ElementName=mainWindow}"
Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid x:Name="busyIndicatorLayer" ZIndex="200"
Visibility="{Binding ElementName=mainWindow, Path=ContextObject.IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}">
<busyDecorator:BusyDecorator x:Name="busyDecorator"
IsBusyIndicatorShowing="True"
IsBusyIndicatorShowing="{Binding ElementName=mainWindow, Path=ContextObject.IsBusy}"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>