Skip to content

Commit bf9b464

Browse files
committed
Merge Dev
2 parents e7baaaf + f548310 commit bf9b464

File tree

23 files changed

+477
-627
lines changed

23 files changed

+477
-627
lines changed

Flow.Launcher.Core/Flow.Launcher.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<ItemGroup>
5656
<PackageReference Include="Droplex" Version="1.4.1" />
5757
<PackageReference Include="FSharp.Core" Version="6.0.6" />
58-
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.1.3" />
58+
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.2.1" />
5959
<PackageReference Include="squirrel.windows" Version="1.5.2" NoWarn="NU1701" />
6060
</ItemGroup>
6161

Flow.Launcher.Plugin/Result.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public ValueTask<bool> ExecuteAsync(ActionContext context)
241241
public string ProgressBarColor { get; set; } = "#26a0da";
242242

243243
/// <summary>
244-
/// Suggests a result's file extension should use full width of the default preview panel.
244+
/// Suggests the preview image of result should use full width of the default preview panel by result's file extension.
245245
/// </summary>
246246
/// <param name="extension">File extension. Dot included.</param>
247247
public static bool ShouldUseBigThumbnail(string extension)

Flow.Launcher.Test/Plugins/ProgramTest.cs

Lines changed: 0 additions & 30 deletions
This file was deleted.

Flow.Launcher.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Global
8080
EndGlobalSection
8181
GlobalSection(ProjectConfigurationPlatforms) = postSolution
8282
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
83-
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.Build.0 = Debug|Any CPU
83+
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.Build.0 = Debug|Any CPU
8484
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|x64.ActiveCfg = Debug|Any CPU
8585
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|x64.Build.0 = Debug|Any CPU
8686
{FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|x86.ActiveCfg = Debug|Any CPU

Flow.Launcher/Languages/en.xaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@
118118
<system:String x:Key="browserMoreThemes">Theme Gallery</system:String>
119119
<system:String x:Key="howToCreateTheme">How to create a theme</system:String>
120120
<system:String x:Key="hiThere">Hi There</system:String>
121+
<system:String x:Key="SampleTitleExplorer">Explorer</system:String>
122+
<system:String x:Key="SampleSubTitleExplorer">Search for files, folders and file contents</system:String>
123+
<system:String x:Key="SampleTitleWebSearch">WebSearch</system:String>
124+
<system:String x:Key="SampleSubTitleWebSearch">Search the web with different search engine support</system:String>
125+
<system:String x:Key="SampleTitleProgram">Program</system:String>
126+
<system:String x:Key="SampleSubTitleProgram">Launch programs as admin or a different user</system:String>
127+
<system:String x:Key="SampleTitleProcessKiller">ProcessKiller</system:String>
128+
<system:String x:Key="SampleSubTitleProcessKiller">Terminate unwanted processes</system:String>
121129
<system:String x:Key="queryBoxFont">Query Box Font</system:String>
122130
<system:String x:Key="resultItemFont">Result Item Font</system:String>
123131
<system:String x:Key="windowMode">Window Mode</system:String>

Flow.Launcher/SettingWindow.xaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,9 @@
443443
Margin="2,2,2,0"
444444
Panel.ZIndex="1"
445445
Background="Transparent"
446-
IsItemsHost="true"
446+
IsItemsHost="true"
447447
LastChildFill="False" />
448-
<Border
449-
Grid.Column="1">
448+
<Border Grid.Column="1">
450449
<ContentPresenter Grid.Column="1" ContentSource="SelectedContent" />
451450
</Border>
452451
</Grid>
@@ -1011,6 +1010,7 @@
10111010
TextAlignment="Left" />
10121011
<DockPanel DockPanel.Dock="Right">
10131012
<TextBox
1013+
Loaded="Plugin_GotFocus"
10141014
Name="pluginFilterTxb"
10151015
Width="150"
10161016
Height="34"
@@ -1445,6 +1445,7 @@
14451445
DockPanel.Dock="Right"
14461446
FontSize="14"
14471447
KeyDown="PluginStoreFilterTxb_OnKeyDown"
1448+
Loaded="PluginStore_GotFocus"
14481449
LostFocus="RefreshPluginStoreEventHandler"
14491450
Text=""
14501451
TextAlignment="Left"
@@ -1795,7 +1796,12 @@
17951796
HorizontalAlignment="Center"
17961797
VerticalAlignment="Center"
17971798
Orientation="Horizontal">
1798-
<Border Width="{Binding WindowWidthSize}" Style="{DynamicResource WindowBorderStyle}">
1799+
<Border
1800+
Width="{Binding WindowWidthSize}"
1801+
Margin="0"
1802+
SnapsToDevicePixels="True"
1803+
Style="{DynamicResource WindowBorderStyle}"
1804+
UseLayoutRounding="True">
17991805
<Border Style="{DynamicResource WindowRadius}">
18001806
<Border.Clip>
18011807
<MultiBinding Converter="{StaticResource BorderClipConverter}">
@@ -1813,6 +1819,7 @@
18131819
<Border Grid.Row="0">
18141820
<TextBox
18151821
x:Name="QueryTextBox"
1822+
IsHitTestVisible="False"
18161823
IsReadOnly="True"
18171824
Style="{DynamicResource QueryBoxStyle}"
18181825
Text="{DynamicResource hiThere}" />
@@ -1850,7 +1857,10 @@
18501857
</Border>
18511858

18521859
<ContentControl Grid.Row="2">
1853-
<flowlauncher:ResultListBox DataContext="{Binding PreviewResults, Mode=OneTime}" Visibility="Visible" />
1860+
<flowlauncher:ResultListBox
1861+
DataContext="{Binding PreviewResults, Mode=OneTime}"
1862+
IsHitTestVisible="False"
1863+
Visibility="Visible" />
18541864
</ContentControl>
18551865

18561866
</Grid>

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,5 +562,15 @@ private void StoreListItem_Click(object sender, RoutedEventArgs e)
562562
};
563563

564564
}
565+
566+
private void PluginStore_GotFocus(object sender, RoutedEventArgs e)
567+
{
568+
Keyboard.Focus(pluginStoreFilterTxb);
569+
}
570+
571+
private void Plugin_GotFocus(object sender, RoutedEventArgs e)
572+
{
573+
Keyboard.Focus(pluginFilterTxb);
574+
}
565575
}
566576
}

Flow.Launcher/ViewModel/ResultViewModel.cs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,32 @@ private async Task<ImageSource> LoadImageInternalAsync(string imagePath, Result.
195195

196196
private async Task LoadImageAsync()
197197
{
198-
// We need to modify the property not field here to trigger the OnPropertyChanged event
199-
Image = await LoadImageInternalAsync(Result.IcoPath, Result.Icon, false).ConfigureAwait(false);
198+
var imagePath = Result.IcoPath;
199+
var iconDelegate = Result.Icon;
200+
if (ImageLoader.CacheContainImage(imagePath, false))
201+
{
202+
image = await LoadImageInternalAsync(imagePath, iconDelegate, false).ConfigureAwait(false);
203+
}
204+
else
205+
{
206+
// We need to modify the property not field here to trigger the OnPropertyChanged event
207+
Image = await LoadImageInternalAsync(imagePath, iconDelegate, false).ConfigureAwait(false);
208+
}
200209
}
201210

202211
private async Task LoadPreviewImageAsync()
203212
{
204213
var imagePath = Result.PreviewImage ?? Result.IcoPath;
205-
PreviewImage = await LoadImageInternalAsync(Result.IcoPath, Result.Icon, true).ConfigureAwait(false);
214+
var iconDelegate = Result.Icon;
215+
if (ImageLoader.CacheContainImage(imagePath, true))
216+
{
217+
previewImage = await LoadImageInternalAsync(imagePath, iconDelegate, true).ConfigureAwait(false);
218+
}
219+
else
220+
{
221+
// We need to modify the property not field here to trigger the OnPropertyChanged event
222+
PreviewImage = await LoadImageInternalAsync(imagePath, iconDelegate, true).ConfigureAwait(false);
223+
}
206224
}
207225

208226
public Result Result { get; }

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -609,26 +609,26 @@ public ResultsViewModel PreviewResults
609609
{
610610
new Result
611611
{
612-
Title = "Explorer",
613-
SubTitle = "Search for files, folders and file contents",
612+
Title = InternationalizationManager.Instance.GetTranslation("SampleTitleExplorer"),
613+
SubTitle = InternationalizationManager.Instance.GetTranslation("SampleSubTitleExplorer"),
614614
IcoPath = Path.Combine(Constant.ProgramDirectory, @"Plugins\Flow.Launcher.Plugin.Explorer\Images\explorer.png")
615615
},
616616
new Result
617617
{
618-
Title = "WebSearch",
619-
SubTitle = "Search the web with different search engine support",
618+
Title = InternationalizationManager.Instance.GetTranslation("SampleTitleWebSearch"),
619+
SubTitle = InternationalizationManager.Instance.GetTranslation("SampleSubTitleWebSearch"),
620620
IcoPath = Path.Combine(Constant.ProgramDirectory, @"Plugins\Flow.Launcher.Plugin.WebSearch\Images\web_search.png")
621621
},
622622
new Result
623623
{
624-
Title = "Program",
625-
SubTitle = "Launch programs as admin or a different user",
624+
Title = InternationalizationManager.Instance.GetTranslation("SampleTitleProgram"),
625+
SubTitle = InternationalizationManager.Instance.GetTranslation("SampleSubTitleProgram"),
626626
IcoPath = Path.Combine(Constant.ProgramDirectory, @"Plugins\Flow.Launcher.Plugin.Program\Images\program.png")
627627
},
628628
new Result
629629
{
630-
Title = "ProcessKiller",
631-
SubTitle = "Terminate unwanted processes",
630+
Title = InternationalizationManager.Instance.GetTranslation("SampleTitleProcessKiller"),
631+
SubTitle = InternationalizationManager.Instance.GetTranslation("SampleSubTitleProcessKiller"),
632632
IcoPath = Path.Combine(Constant.ProgramDirectory, @"Plugins\Flow.Launcher.Plugin.ProcessKiller\Images\app.png")
633633
}
634634
};

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Commands/BookmarkLoader.cs

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,28 @@ internal static MatchResult MatchProgram(Bookmark bookmark, string queryString)
1919

2020
internal static List<Bookmark> LoadAllBookmarks(Settings setting)
2121
{
22-
23-
var chromeBookmarks = new ChromeBookmarkLoader();
24-
var mozBookmarks = new FirefoxBookmarkLoader();
25-
var edgeBookmarks = new EdgeBookmarkLoader();
26-
2722
var allBookmarks = new List<Bookmark>();
2823

29-
// Add Firefox bookmarks
30-
allBookmarks.AddRange(mozBookmarks.GetBookmarks());
24+
if (setting.LoadChromeBookmark)
25+
{
26+
// Add Chrome bookmarks
27+
var chromeBookmarks = new ChromeBookmarkLoader();
28+
allBookmarks.AddRange(chromeBookmarks.GetBookmarks());
29+
}
3130

32-
// Add Chrome bookmarks
33-
allBookmarks.AddRange(chromeBookmarks.GetBookmarks());
31+
if (setting.LoadFirefoxBookmark)
32+
{
33+
// Add Firefox bookmarks
34+
var mozBookmarks = new FirefoxBookmarkLoader();
35+
allBookmarks.AddRange(mozBookmarks.GetBookmarks());
36+
}
3437

35-
// Add Edge (Chromium) bookmarks
36-
allBookmarks.AddRange(edgeBookmarks.GetBookmarks());
38+
if (setting.LoadEdgeBookmark)
39+
{
40+
// Add Edge (Chromium) bookmarks
41+
var edgeBookmarks = new EdgeBookmarkLoader();
42+
allBookmarks.AddRange(edgeBookmarks.GetBookmarks());
43+
}
3744

3845
foreach (var browser in setting.CustomChromiumBrowsers)
3946
{

0 commit comments

Comments
 (0)