mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add file type icon images
This commit is contained in:
parent
ac2d318412
commit
107fc75d97
9 changed files with 40 additions and 6 deletions
|
|
@ -24,7 +24,7 @@ namespace Flow.Launcher.Test.Plugins
|
||||||
$"Actual: {result}{Environment.NewLine}");
|
$"Actual: {result}{Environment.NewLine}");
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase("C:\\Dropbox", "SELECT TOP 100 System.FileName, System.ItemPathDisplay FROM SystemIndex WHERE directory='file:C:\\Dropbox'")]
|
[TestCase("C:\\Dropbox", "SELECT TOP 100 System.FileName, System.ItemPathDisplay, System.ItemType FROM SystemIndex WHERE directory='file:C:\\Dropbox'")]
|
||||||
public void GivenWindowsIndexSearch_WhenSearchTypeIsSearchTopFolderLevel_ThenQueryShouldUseExpectedString(string folderPath, string expectedString)
|
public void GivenWindowsIndexSearch_WhenSearchTypeIsSearchTopFolderLevel_ThenQueryShouldUseExpectedString(string folderPath, string expectedString)
|
||||||
{
|
{
|
||||||
// Given
|
// Given
|
||||||
|
|
@ -52,7 +52,7 @@ namespace Flow.Launcher.Test.Plugins
|
||||||
$"Actual string was: {resultString}{Environment.NewLine}");
|
$"Actual string was: {resultString}{Environment.NewLine}");
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase("flow.launcher.sln", "SELECT TOP 100 \"System.FileName\", \"System.ItemPathDisplay\" " +
|
[TestCase("flow.launcher.sln", "SELECT TOP 100 \"System.FileName\", \"System.ItemPathDisplay\", \"System.ItemType\" " +
|
||||||
"FROM \"SystemIndex\" WHERE (System.FileName LIKE 'flow.launcher.sln%' " +
|
"FROM \"SystemIndex\" WHERE (System.FileName LIKE 'flow.launcher.sln%' " +
|
||||||
"OR CONTAINS(System.FileName,'\"flow.launcher.sln*\"',1033)) AND scope='file:'")]
|
"OR CONTAINS(System.FileName,'\"flow.launcher.sln*\"',1033)) AND scope='file:'")]
|
||||||
public void GivenWindowsIndexSearch_WhenSearchAllFoldersAndFiles_ThenQueryShouldUseExpectedString(
|
public void GivenWindowsIndexSearch_WhenSearchAllFoldersAndFiles_ThenQueryShouldUseExpectedString(
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,22 @@
|
||||||
<None Include="Images\explorer.png">
|
<None Include="Images\explorer.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|
||||||
|
<None Include="Images\copy.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
|
||||||
|
<None Include="Images\deletefilefolder.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
|
||||||
|
<Content Include="Images\file.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
|
||||||
|
<None Include="Images\folder.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
BIN
Plugins/Flow.Launcher.Plugin.Explorer/Images/copy.png
Normal file
BIN
Plugins/Flow.Launcher.Plugin.Explorer/Images/copy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 501 B |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
BIN
Plugins/Flow.Launcher.Plugin.Explorer/Images/file.png
Normal file
BIN
Plugins/Flow.Launcher.Plugin.Explorer/Images/file.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 290 B |
BIN
Plugins/Flow.Launcher.Plugin.Explorer/Images/folder.png
Normal file
BIN
Plugins/Flow.Launcher.Plugin.Explorer/Images/folder.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 468 B |
16
Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs
Normal file
16
Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Flow.Launcher.Plugin.Explorer.Search
|
||||||
|
{
|
||||||
|
public static class Constants
|
||||||
|
{
|
||||||
|
public const string FolderImagePath = "Images\\folder.png";
|
||||||
|
public const string FileImagePath = "Images\\file.png";
|
||||||
|
public const string DeleteFileFolderImagePath = "Images\\deletefilefolder.png";
|
||||||
|
public const string CopyImagePath = "Images\\copy.png";
|
||||||
|
|
||||||
|
public const string DefaultFolderSubtitleString = "Ctrl + Enter to open the directory";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -46,7 +46,9 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex
|
||||||
{
|
{
|
||||||
if (dataReaderResults.GetValue(0) != DBNull.Value && dataReaderResults.GetValue(1) != DBNull.Value)
|
if (dataReaderResults.GetValue(0) != DBNull.Value && dataReaderResults.GetValue(1) != DBNull.Value)
|
||||||
{
|
{
|
||||||
results.Add(CreateResult(dataReaderResults.GetString(0), dataReaderResults.GetString(1)));
|
results.Add(CreateResult(dataReaderResults.GetString(0),
|
||||||
|
dataReaderResults.GetString(1),
|
||||||
|
dataReaderResults.GetString(2)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -66,13 +68,13 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Result CreateResult(string filename, string path)
|
private Result CreateResult(string filename, string path, string fileType)
|
||||||
{
|
{
|
||||||
return new Result
|
return new Result
|
||||||
{
|
{
|
||||||
Title = filename,
|
Title = filename,
|
||||||
SubTitle = path,
|
SubTitle = path,
|
||||||
IcoPath = "Images\\Explorer.png",//<------CHANGE
|
IcoPath = fileType == "Directory" ? Constants.FolderImagePath : Constants.FileImagePath,
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex
|
||||||
baseQuery.QueryMaxResults = _settings.MaxResult;
|
baseQuery.QueryMaxResults = _settings.MaxResult;
|
||||||
|
|
||||||
// Set list of columns we want to display, getting the path presently
|
// Set list of columns we want to display, getting the path presently
|
||||||
baseQuery.QuerySelectColumns = "System.FileName, System.ItemPathDisplay";
|
baseQuery.QuerySelectColumns = "System.FileName, System.ItemPathDisplay, System.ItemType";
|
||||||
|
|
||||||
// Filter based on file name
|
// Filter based on file name
|
||||||
baseQuery.QueryContentProperties = "System.FileName";
|
baseQuery.QueryContentProperties = "System.FileName";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue