mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
API changes
This commit is contained in:
parent
6ee6cd3977
commit
56fa719931
4 changed files with 12 additions and 14 deletions
|
|
@ -44,7 +44,7 @@ namespace Wox.Plugin.WebSearch
|
|||
return true;
|
||||
}
|
||||
}
|
||||
},true);
|
||||
});
|
||||
|
||||
if (UserSettingStorage.Instance.EnableWebSearchSuggestion && !string.IsNullOrEmpty(keyword))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ namespace Wox.Plugin
|
|||
/// <param name="query"></param>
|
||||
/// <param name="plugin"></param>
|
||||
/// <param name="results"></param>
|
||||
/// <param name="clearBeforeInsert"></param>
|
||||
void PushResults(Query query,PluginMetadata plugin, List<Result> results,bool clearBeforeInsert = false);
|
||||
void PushResults(Query query,PluginMetadata plugin, List<Result> results);
|
||||
|
||||
/// <summary>
|
||||
/// Execute command
|
||||
|
|
|
|||
|
|
@ -18,10 +18,11 @@
|
|||
<Window.Resources>
|
||||
<ResourceDictionary Source="/PresentationFramework.Classic,Version=3.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL;component/themes/Classic.xaml"/>
|
||||
</Window.Resources>
|
||||
<Border Style="{DynamicResource WindowBorderStyle}" MouseDown="Border_OnMouseDown" BorderBrush="#FF000000" CornerRadius="8">
|
||||
<Border Style="{DynamicResource WindowBorderStyle}" MouseDown="Border_OnMouseDown" CornerRadius="0">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBox Style="{DynamicResource QueryBoxStyle}" PreviewDragOver="TbQuery_OnPreviewDragOver" AllowDrop="True" Grid.Row="0" x:Name="tbQuery" PreviewKeyDown="TbQuery_OnPreviewKeyDown" TextChanged="TextBoxBase_OnTextChanged" />
|
||||
<Line Style="{DynamicResource PendingLineStyle}" x:Name="progressBar" Y1="0" Y2="0" X2="100" Grid.Row="1" Height="2" StrokeThickness="1"></Line>
|
||||
<TextBox Style="{DynamicResource QueryBoxStyle}" PreviewDragOver="TbQuery_OnPreviewDragOver" AllowDrop="True"
|
||||
x:Name="tbQuery" PreviewKeyDown="TbQuery_OnPreviewKeyDown" TextChanged="TextBoxBase_OnTextChanged" />
|
||||
<Line Style="{DynamicResource PendingLineStyle}" x:Name="progressBar" Y1="0" Y2="0" X2="100" Height="2" StrokeThickness="1"></Line>
|
||||
<wox:ResultPanel x:Name="pnlResult" />
|
||||
<wox:ResultPanel x:Name="pnlContextMenu" Visibility="Collapsed" />
|
||||
</StackPanel>
|
||||
|
|
|
|||
|
|
@ -136,21 +136,23 @@ namespace Wox
|
|||
public event AfterWoxQueryEventHandler AfterWoxQueryEvent;
|
||||
public event AfterWoxQueryEventHandler BeforeWoxQueryEvent;
|
||||
|
||||
public void PushResults(Query query, PluginMetadata plugin, List<Result> results, bool clearBeforeInsert = false)
|
||||
public void PushResults(Query query, PluginMetadata plugin, List<Result> results)
|
||||
{
|
||||
results.ForEach(o =>
|
||||
{
|
||||
o.PluginDirectory = plugin.PluginDirectory;
|
||||
o.PluginID = plugin.ID;
|
||||
o.OriginQuery = query;
|
||||
if (o.ContextMenu != null)
|
||||
{
|
||||
o.ContextMenu.ForEach(t =>
|
||||
{
|
||||
t.PluginDirectory = plugin.PluginDirectory;
|
||||
t.PluginID = plugin.ID;
|
||||
});
|
||||
}
|
||||
o.OriginQuery = query;
|
||||
});
|
||||
OnUpdateResultView(results, clearBeforeInsert);
|
||||
UpdateResultView(results);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -635,7 +637,7 @@ namespace Wox
|
|||
}
|
||||
}
|
||||
|
||||
private void OnUpdateResultView(List<Result> list, bool clearBeforeInsert = false)
|
||||
private void UpdateResultView(List<Result> list)
|
||||
{
|
||||
queryHasReturn = true;
|
||||
progressBar.Dispatcher.Invoke(new Action(StopProgress));
|
||||
|
|
@ -650,10 +652,6 @@ namespace Wox
|
|||
List<Result> l = list.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == lastQuery).ToList();
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
if (clearBeforeInsert)
|
||||
{
|
||||
pnlResult.Clear();
|
||||
}
|
||||
pnlResult.AddResults(l);
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue