mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 21:41:51 +02:00
API changes
This commit is contained in:
@@ -44,7 +44,7 @@ namespace Wox.Plugin.WebSearch
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},true);
|
});
|
||||||
|
|
||||||
if (UserSettingStorage.Instance.EnableWebSearchSuggestion && !string.IsNullOrEmpty(keyword))
|
if (UserSettingStorage.Instance.EnableWebSearchSuggestion && !string.IsNullOrEmpty(keyword))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ namespace Wox.Plugin
|
|||||||
/// <param name="query"></param>
|
/// <param name="query"></param>
|
||||||
/// <param name="plugin"></param>
|
/// <param name="plugin"></param>
|
||||||
/// <param name="results"></param>
|
/// <param name="results"></param>
|
||||||
/// <param name="clearBeforeInsert"></param>
|
void PushResults(Query query,PluginMetadata plugin, List<Result> results);
|
||||||
void PushResults(Query query,PluginMetadata plugin, List<Result> results,bool clearBeforeInsert = false);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Execute command
|
/// Execute command
|
||||||
|
|||||||
@@ -18,10 +18,11 @@
|
|||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<ResourceDictionary Source="/PresentationFramework.Classic,Version=3.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL;component/themes/Classic.xaml"/>
|
<ResourceDictionary Source="/PresentationFramework.Classic,Version=3.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL;component/themes/Classic.xaml"/>
|
||||||
</Window.Resources>
|
</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">
|
<StackPanel Orientation="Vertical">
|
||||||
<TextBox Style="{DynamicResource QueryBoxStyle}" PreviewDragOver="TbQuery_OnPreviewDragOver" AllowDrop="True" Grid.Row="0" x:Name="tbQuery" PreviewKeyDown="TbQuery_OnPreviewKeyDown" TextChanged="TextBoxBase_OnTextChanged" />
|
<TextBox Style="{DynamicResource QueryBoxStyle}" PreviewDragOver="TbQuery_OnPreviewDragOver" AllowDrop="True"
|
||||||
<Line Style="{DynamicResource PendingLineStyle}" x:Name="progressBar" Y1="0" Y2="0" X2="100" Grid.Row="1" Height="2" StrokeThickness="1"></Line>
|
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="pnlResult" />
|
||||||
<wox:ResultPanel x:Name="pnlContextMenu" Visibility="Collapsed" />
|
<wox:ResultPanel x:Name="pnlContextMenu" Visibility="Collapsed" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -136,21 +136,23 @@ namespace Wox
|
|||||||
public event AfterWoxQueryEventHandler AfterWoxQueryEvent;
|
public event AfterWoxQueryEventHandler AfterWoxQueryEvent;
|
||||||
public event AfterWoxQueryEventHandler BeforeWoxQueryEvent;
|
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 =>
|
results.ForEach(o =>
|
||||||
{
|
{
|
||||||
o.PluginDirectory = plugin.PluginDirectory;
|
o.PluginDirectory = plugin.PluginDirectory;
|
||||||
|
o.PluginID = plugin.ID;
|
||||||
|
o.OriginQuery = query;
|
||||||
if (o.ContextMenu != null)
|
if (o.ContextMenu != null)
|
||||||
{
|
{
|
||||||
o.ContextMenu.ForEach(t =>
|
o.ContextMenu.ForEach(t =>
|
||||||
{
|
{
|
||||||
t.PluginDirectory = plugin.PluginDirectory;
|
t.PluginDirectory = plugin.PluginDirectory;
|
||||||
|
t.PluginID = plugin.ID;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
o.OriginQuery = query;
|
|
||||||
});
|
});
|
||||||
OnUpdateResultView(results, clearBeforeInsert);
|
UpdateResultView(results);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -635,7 +637,7 @@ namespace Wox
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnUpdateResultView(List<Result> list, bool clearBeforeInsert = false)
|
private void UpdateResultView(List<Result> list)
|
||||||
{
|
{
|
||||||
queryHasReturn = true;
|
queryHasReturn = true;
|
||||||
progressBar.Dispatcher.Invoke(new Action(StopProgress));
|
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();
|
List<Result> l = list.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == lastQuery).ToList();
|
||||||
Dispatcher.Invoke(new Action(() =>
|
Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
if (clearBeforeInsert)
|
|
||||||
{
|
|
||||||
pnlResult.Clear();
|
|
||||||
}
|
|
||||||
pnlResult.AddResults(l);
|
pnlResult.AddResults(l);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user