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

View File

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

View File

@@ -152,35 +152,12 @@
<ContentControl x:Name="container" <ContentControl x:Name="container"
Foreground="{DynamicResource WindowTextForeground}" Foreground="{DynamicResource WindowTextForeground}"
Content="{Binding ContextObject.ViewerContent, ElementName=mainWindow}" /> 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> </DockPanel>
</Grid> </Grid>
<Grid x:Name="busyIndicatorLayer" ZIndex="200"> <Grid x:Name="busyIndicatorLayer" ZIndex="200"
<Grid.Style> Visibility="{Binding ElementName=mainWindow, Path=ContextObject.IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}">
<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>
<busyDecorator:BusyDecorator x:Name="busyDecorator" <busyDecorator:BusyDecorator x:Name="busyDecorator"
IsBusyIndicatorShowing="True" IsBusyIndicatorShowing="{Binding ElementName=mainWindow, Path=ContextObject.IsBusy}"
VerticalAlignment="Center" VerticalAlignment="Center"
HorizontalAlignment="Center" /> HorizontalAlignment="Center" />
</Grid> </Grid>