mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Fix progressbar loading
This commit is contained in:
@@ -37,12 +37,9 @@
|
||||
PreviewDragOver="OnPreviewDragOver"
|
||||
AllowDrop="True"
|
||||
x:Name="QueryTextBox" />
|
||||
<Line Style="{DynamicResource PendingLineStyle}" x:Name="ProgressBar" Y1="0" Y2="0" X2="100" Height="2"
|
||||
StrokeThickness="1"
|
||||
Visibility="{Binding ProgressBarVisibility}" HorizontalAlignment="Right" Width="752">
|
||||
<Line.ToolTip>
|
||||
<ToolTip IsOpen="{Binding IsProgressBarTooltipVisible}" />
|
||||
</Line.ToolTip>
|
||||
<Line x:Name="ProgressBar" HorizontalAlignment="Right"
|
||||
Style="{DynamicResource PendingLineStyle}" Visibility="{Binding ProgressBarVisibility, Mode=TwoWay}"
|
||||
Y1="0" Y2="0" X2="100" Height="2" Width="752" StrokeThickness="1">
|
||||
</Line>
|
||||
<ContentControl Content="{Binding Results}" Visibility="{Binding ResultListBoxVisibility}" />
|
||||
<ContentControl Content="{Binding ContextMenu}" Visibility="{Binding ContextMenuVisibility}" />
|
||||
|
||||
@@ -15,7 +15,6 @@ using Wox.Infrastructure.Hotkey;
|
||||
using Wox.Infrastructure.Storage;
|
||||
using Wox.Plugin;
|
||||
using Wox.Storage;
|
||||
using Stopwatch = Wox.Infrastructure.Stopwatch;
|
||||
|
||||
namespace Wox.ViewModel
|
||||
{
|
||||
@@ -80,7 +79,6 @@ namespace Wox.ViewModel
|
||||
InitializeResultListBox();
|
||||
InitializeContextMenu();
|
||||
InitializeKeyCommands();
|
||||
|
||||
}
|
||||
|
||||
~MainViewModel()
|
||||
@@ -121,19 +119,6 @@ namespace Wox.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsProgressBarTooltipVisible
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isProgressBarTooltipVisible;
|
||||
}
|
||||
set
|
||||
{
|
||||
_isProgressBarTooltipVisible = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public double Left
|
||||
{
|
||||
get
|
||||
@@ -375,7 +360,7 @@ namespace Wox.ViewModel
|
||||
|
||||
private void HandleQueryTextUpdated()
|
||||
{
|
||||
IsProgressBarTooltipVisible = false;
|
||||
ProgressBarVisibility = Visibility.Hidden;
|
||||
_updateSource?.Cancel();
|
||||
_updateSource = new CancellationTokenSource();
|
||||
_updateToken = _updateSource.Token;
|
||||
@@ -553,7 +538,7 @@ namespace Wox.ViewModel
|
||||
public void UpdateResultView(List<Result> list, PluginMetadata metadata, Query originQuery)
|
||||
{
|
||||
_queryHasReturn = true;
|
||||
IsProgressBarTooltipVisible = false;
|
||||
ProgressBarVisibility = Visibility.Hidden;
|
||||
|
||||
list.ForEach(o =>
|
||||
{
|
||||
@@ -567,7 +552,7 @@ namespace Wox.ViewModel
|
||||
});
|
||||
}
|
||||
|
||||
if (list.Count > 0 && ! ResultListBoxVisibility.IsVisible())
|
||||
if (list.Count > 0 && !ResultListBoxVisibility.IsVisible())
|
||||
{
|
||||
ResultListBoxVisibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user