Skip to content

Commit

Permalink
Fix progressbar loading
Browse files Browse the repository at this point in the history
  • Loading branch information
bao-qian committed Apr 25, 2016
1 parent be4dbec commit f37a784
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
9 changes: 3 additions & 6 deletions Wox/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}" />
Expand Down
21 changes: 3 additions & 18 deletions Wox/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using Wox.Infrastructure.Storage;
using Wox.Plugin;
using Wox.Storage;
using Stopwatch = Wox.Infrastructure.Stopwatch;

namespace Wox.ViewModel
{
Expand Down Expand Up @@ -80,7 +79,6 @@ public MainViewModel()
InitializeResultListBox();
InitializeContextMenu();
InitializeKeyCommands();

}

~MainViewModel()
Expand Down Expand Up @@ -121,19 +119,6 @@ public string QueryText
}
}

public bool IsProgressBarTooltipVisible
{
get
{
return _isProgressBarTooltipVisible;
}
set
{
_isProgressBarTooltipVisible = value;
OnPropertyChanged();
}
}

public double Left
{
get
Expand Down Expand Up @@ -375,7 +360,7 @@ private void InitializeContextMenu()

private void HandleQueryTextUpdated()
{
IsProgressBarTooltipVisible = false;
ProgressBarVisibility = Visibility.Hidden;
_updateSource?.Cancel();
_updateSource = new CancellationTokenSource();
_updateToken = _updateSource.Token;
Expand Down Expand Up @@ -553,7 +538,7 @@ private Result GetTopMostContextMenu(Result result)
public void UpdateResultView(List<Result> list, PluginMetadata metadata, Query originQuery)
{
_queryHasReturn = true;
IsProgressBarTooltipVisible = false;
ProgressBarVisibility = Visibility.Hidden;

list.ForEach(o =>
{
Expand All @@ -567,7 +552,7 @@ public void UpdateResultView(List<Result> list, PluginMetadata metadata, Query o
});
}

if (list.Count > 0 && ! ResultListBoxVisibility.IsVisible())
if (list.Count > 0 && !ResultListBoxVisibility.IsVisible())
{
ResultListBoxVisibility = Visibility.Visible;
}
Expand Down

0 comments on commit f37a784

Please sign in to comment.