Merge remote-tracking branch 'upstream/dev' into add_windows_settings_plugin

This commit is contained in:
Kevin Zhang 2021-11-29 17:53:31 -06:00
commit 1990a7edfd
87 changed files with 11982 additions and 2600 deletions

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.IO; using System.IO;
@ -45,8 +45,56 @@ namespace Flow.Launcher.Core.Plugin
} }
} }
} }
return allPluginMetadata; (List<PluginMetadata> uniqueList, List<PluginMetadata> duplicateList) = GetUniqueLatestPluginMetadata(allPluginMetadata);
duplicateList
.ForEach(
x => Log.Warn("PluginConfig",
string.Format("Duplicate plugin name: {0}, id: {1}, version: {2} " +
"not loaded due to version not the highest of the duplicates",
x.Name, x.ID, x.Version),
"GetUniqueLatestPluginMetadata"));
return uniqueList;
}
internal static (List<PluginMetadata>, List<PluginMetadata>) GetUniqueLatestPluginMetadata(List<PluginMetadata> allPluginMetadata)
{
var duplicate_list = new List<PluginMetadata>();
var unique_list = new List<PluginMetadata>();
var duplicateGroups = allPluginMetadata.GroupBy(x => x.ID).Where(g => g.Count() > 1).Select(y => y).ToList();
foreach (var metadata in allPluginMetadata)
{
var duplicatesExist = false;
foreach (var group in duplicateGroups)
{
if (metadata.ID == group.Key)
{
duplicatesExist = true;
// If metadata's version greater than each duplicate's version, CompareTo > 0
var count = group.Where(x => metadata.Version.CompareTo(x.Version) > 0).Count();
// Only add if the meatadata's version is the highest of all duplicates in the group
if (count == group.Count() - 1)
{
unique_list.Add(metadata);
}
else
{
duplicate_list.Add(metadata);
}
}
}
if (!duplicatesExist)
unique_list.Add(metadata);
}
return (unique_list, duplicate_list);
} }
private static PluginMetadata GetPluginMetadata(string pluginDirectory) private static PluginMetadata GetPluginMetadata(string pluginDirectory)

View file

@ -189,22 +189,11 @@ namespace Flow.Launcher.Core.Resource
new[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle, resultHotkeyItemStyle, resultHotkeyItemSelectedStyle }, o new[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle, resultHotkeyItemStyle, resultHotkeyItemSelectedStyle }, o
=> Array.ForEach(setters, p => o.Setters.Add(p))); => Array.ForEach(setters, p => o.Setters.Add(p)));
} }
/* Ignore Theme Window Width and use setting */
var windowStyle = dict["WindowStyle"] as Style; var windowStyle = dict["WindowStyle"] as Style;
var width = Settings.WindowSize;
var width = windowStyle?.Setters.OfType<Setter>().Where(x => x.Property.Name == "Width") windowStyle.Setters.Add(new Setter(Window.WidthProperty, width));
.Select(x => x.Value).FirstOrDefault();
if (width == null)
{
windowStyle = dict["BaseWindowStyle"] as Style;
width = windowStyle?.Setters.OfType<Setter>().Where(x => x.Property.Name == "Width")
.Select(x => x.Value).FirstOrDefault();
}
mainWindowWidth = (double)width; mainWindowWidth = (double)width;
return dict; return dict;
} }
@ -375,8 +364,6 @@ namespace Flow.Launcher.Core.Resource
{ {
var windowHelper = new WindowInteropHelper(w); var windowHelper = new WindowInteropHelper(w);
// this determines the width of the main query window
w.Width = mainWindowWidth;
windowHelper.EnsureHandle(); windowHelper.EnsureHandle();
var accent = new AccentPolicy { AccentState = state }; var accent = new AccentPolicy { AccentState = state };

View file

@ -33,10 +33,18 @@ namespace Flow.Launcher.Infrastructure
public static readonly string QueryTextBoxIconImagePath = $"{ProgramDirectory}\\Images\\mainsearch.svg"; public static readonly string QueryTextBoxIconImagePath = $"{ProgramDirectory}\\Images\\mainsearch.svg";
public const string DefaultTheme = "Darker"; public const string DefaultTheme = "Win11Light";
public const string Light = "Light";
public const string Dark = "Dark";
public const string System = "System";
public const string Themes = "Themes"; public const string Themes = "Themes";
public const string Settings = "Settings";
public const string Logs = "Logs";
public const string Website = "https://flow-launcher.github.io"; public const string Website = "https://flow-launcher.github.io";
public const string GitHub = "https://github.com/Flow-Launcher/Flow.Launcher";
public const string Docs = "https://flow-launcher.github.io/docs";
} }
} }

View file

@ -50,10 +50,15 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Ben.Demystifier" Version="0.4.1" /> <PackageReference Include="Ben.Demystifier" Version="0.4.1" />
<PackageReference Include="Fody" Version="6.5.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="16.10.56" /> <PackageReference Include="Microsoft.VisualStudio.Threading" Version="16.10.56" />
<PackageReference Include="NLog" Version="4.7.10" /> <PackageReference Include="NLog" Version="4.7.10" />
<PackageReference Include="NLog.Schema" Version="4.7.10" /> <PackageReference Include="NLog.Schema" Version="4.7.10" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" /> <PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" />
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" />
<PackageReference Include="System.Drawing.Common" Version="5.0.2" /> <PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<!--ToolGood.Words.Pinyin v3.0.2.6 results in high memory usage when search with pinyin is enabled--> <!--ToolGood.Words.Pinyin v3.0.2.6 results in high memory usage when search with pinyin is enabled-->
<!--Bumping to it or higher needs to test and ensure this is no longer a problem--> <!--Bumping to it or higher needs to test and ensure this is no longer a problem-->

View file

@ -0,0 +1,30 @@
using Flow.Launcher.Plugin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Flow.Launcher.ViewModel
{
public class CustomExplorerViewModel : BaseModel
{
public string Name { get; set; }
public string Path { get; set; }
public string FileArgument { get; set; } = "\"%d\"";
public string DirectoryArgument { get; set; } = "\"%d\"";
public bool Editable { get; init; } = true;
public CustomExplorerViewModel Copy()
{
return new CustomExplorerViewModel
{
Name = Name,
Path = Path,
FileArgument = FileArgument,
DirectoryArgument = DirectoryArgument,
Editable = Editable
};
}
}
}

View file

@ -1,22 +1,28 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Drawing; using System.Drawing;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using Flow.Launcher.Plugin; using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedModels; using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher;
using Flow.Launcher.ViewModel;
namespace Flow.Launcher.Infrastructure.UserSettings namespace Flow.Launcher.Infrastructure.UserSettings
{ {
public class Settings : BaseModel public class Settings : BaseModel
{ {
private string language = "en"; private string language = "en";
public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}"; public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}";
public string OpenResultModifiers { get; set; } = KeyConstant.Alt; public string OpenResultModifiers { get; set; } = KeyConstant.Alt;
public string ColorScheme { get; set; } = "System";
public bool ShowOpenResultHotkey { get; set; } = true; public bool ShowOpenResultHotkey { get; set; } = true;
public double WindowSize { get; set; } = 580;
public string Language public string Language
{ {
get => language; set get => language;
set
{ {
language = value; language = value;
OnPropertyChanged(); OnPropertyChanged();
@ -34,6 +40,51 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public string ResultFontStretch { get; set; } public string ResultFontStretch { get; set; }
public bool UseGlyphIcons { get; set; } = true; public bool UseGlyphIcons { get; set; } = true;
public int CustomExplorerIndex { get; set; } = 0;
[JsonIgnore]
public CustomExplorerViewModel CustomExplorer
{
get => CustomExplorerList[CustomExplorerIndex < CustomExplorerList.Count ? CustomExplorerIndex : 0];
set => CustomExplorerList[CustomExplorerIndex] = value;
}
public List<CustomExplorerViewModel> CustomExplorerList { get; set; } = new()
{
new()
{
Name = "Explorer",
Path = "explorer",
DirectoryArgument = "\"%d\"",
FileArgument = "/select, \"%f\"",
Editable = false
},
new()
{
Name = "Total Commander",
Path = @"C:\Program Files\totalcmd\TOTALCMD64.exe",
DirectoryArgument = "/O /A /S /T \"%d\"",
FileArgument = "/O /A /S /T \"%f\""
},
new()
{
Name = "Directory Opus",
Path = @"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe",
DirectoryArgument = "/cmd Go \"%d\" NEW",
FileArgument = "/cmd Go \"%f\" NEW"
},
new()
{
Name = "Files",
Path = "Files",
DirectoryArgument = "-select \"%d\"",
FileArgument = "-select \"%f\""
}
};
public bool UseAnimation { get; set; } = true;
public bool UseSound { get; set; } = true;
/// <summary> /// <summary>
/// when false Alphabet static service will always return empty results /// when false Alphabet static service will always return empty results
@ -52,7 +103,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
try try
{ {
var precisionScore = (SearchPrecisionScore)Enum var precisionScore = (SearchPrecisionScore)Enum
.Parse(typeof(SearchPrecisionScore), value); .Parse(typeof(SearchPrecisionScore), value);
QuerySearchPrecision = precisionScore; QuerySearchPrecision = precisionScore;
StringMatcher.Instance.UserSettingSearchPrecision = precisionScore; StringMatcher.Instance.UserSettingSearchPrecision = precisionScore;
@ -82,7 +133,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public bool DontPromptUpdateMsg { get; set; } public bool DontPromptUpdateMsg { get; set; }
public bool EnableUpdateLog { get; set; } public bool EnableUpdateLog { get; set; }
public bool StartFlowLauncherOnSystemStartup { get; set; } = true; public bool StartFlowLauncherOnSystemStartup { get; set; } = false;
public bool HideOnStartup { get; set; } public bool HideOnStartup { get; set; }
bool _hideNotifyIcon { get; set; } bool _hideNotifyIcon { get; set; }
public bool HideNotifyIcon public bool HideNotifyIcon
@ -115,4 +166,11 @@ namespace Flow.Launcher.Infrastructure.UserSettings
Empty, Empty,
Preserved Preserved
} }
public enum ColorSchemes
{
System,
Light,
Dark
}
} }

View file

@ -29,6 +29,15 @@ namespace Flow.Launcher.Plugin
/// </summary> /// </summary>
void RestartApp(); void RestartApp();
/// <summary>
/// Run a shell command
/// </summary>
/// <param name="cmd">The command or program to run</param>
/// <param name="filename">the shell type to run, e.g. powershell.exe</param>
/// <exception cref="FileNotFoundException">Thrown when unable to find the file specified in the command </exception>
/// <exception cref="Win32Exception">Thrown when error occurs during the execution of the command </exception>
void ShellRun(string cmd, string filename = "cmd.exe");
/// <summary> /// <summary>
/// Save everything, all of Flow Launcher and plugins' data and settings /// Save everything, all of Flow Launcher and plugins' data and settings
/// </summary> /// </summary>
@ -190,5 +199,12 @@ namespace Flow.Launcher.Plugin
/// <typeparam name="T">Type for Serialization</typeparam> /// <typeparam name="T">Type for Serialization</typeparam>
/// <returns></returns> /// <returns></returns>
void SaveSettingJsonStorage<T>() where T : new(); void SaveSettingJsonStorage<T>() where T : new();
/// <summary>
/// Open directory in an explorer configured by user via Flow's Settings. The default is Windows Explorer
/// </summary>
/// <param name="DirectoryPath">Directory Path to open</param>
/// <param name="FileName">Extra FileName Info</param>
public void OpenDirectory(string DirectoryPath, string FileName = null);
} }
} }

View file

@ -50,7 +50,7 @@ namespace Flow.Launcher.Plugin
/// <summary> /// <summary>
/// Delegate to Get Image Source /// Delegate to Get Image Source
/// </summary> /// </summary>
public IconDelegate Icon { get; set; } public IconDelegate Icon;
/// <summary> /// <summary>
/// Information for Glyph Icon /// Information for Glyph Icon

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
@ -60,17 +60,39 @@ namespace Flow.Launcher.Plugin.SharedCommands
return sb.ToString(); return sb.ToString();
} }
public static ProcessStartInfo SetProcessStartInfo(this string fileName, string workingDirectory = "", string arguments = "", string verb = "") public static ProcessStartInfo SetProcessStartInfo(this string fileName, string workingDirectory = "", string arguments = "", string verb = "", bool createNoWindow = false)
{ {
var info = new ProcessStartInfo var info = new ProcessStartInfo
{ {
FileName = fileName, FileName = fileName,
WorkingDirectory = workingDirectory, WorkingDirectory = workingDirectory,
Arguments = arguments, Arguments = arguments,
Verb = verb Verb = verb,
CreateNoWindow = createNoWindow
}; };
return info; return info;
} }
/// <summary>
/// Runs a windows command using the provided ProcessStartInfo
/// </summary>
/// <exception cref="FileNotFoundException">Thrown when unable to find the file specified in the command </exception>
/// <exception cref="Win32Exception">Thrown when error occurs during the execution of the command </exception>
public static void Execute(ProcessStartInfo info)
{
Execute(Process.Start, info);
}
/// <summary>
/// Runs a windows command using the provided ProcessStartInfo using a custom execute command function
/// </summary>
/// <param name="Func startProcess">allows you to pass in a custom command execution function</param>
/// <exception cref="FileNotFoundException">Thrown when unable to find the file specified in the command </exception>
/// <exception cref="Win32Exception">Thrown when error occurs during the execution of the command </exception>
public static void Execute(Func<ProcessStartInfo, Process> startProcess, ProcessStartInfo info)
{
startProcess(info);
}
} }
} }

View file

@ -0,0 +1,92 @@
using NUnit.Framework;
using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Plugin;
using System.Collections.Generic;
using System.Linq;
namespace Flow.Launcher.Test
{
[TestFixture]
class PluginLoadTest
{
[Test]
public void GivenDuplicatePluginMetadatasWhenLoadedThenShouldReturnOnlyUniqueList()
{
// Given
var duplicateList = new List<PluginMetadata>
{
new PluginMetadata
{
ID = "CEA0TYUC6D3B4085823D60DC76F28855",
Version = "1.0.0"
},
new PluginMetadata
{
ID = "CEA0TYUC6D3B4085823D60DC76F28855",
Version = "1.0.1"
},
new PluginMetadata
{
ID = "CEA0TYUC6D3B4085823D60DC76F28855",
Version = "1.0.2"
},
new PluginMetadata
{
ID = "CEA0TYUC6D3B4085823D60DC76F28855",
Version = "1.0.0"
},
new PluginMetadata
{
ID = "CEA0TYUC6D3B4085823D60DC76F28855",
Version = "1.0.0"
},
new PluginMetadata
{
ID = "ABC0TYUC6D3B7855823D60DC76F28855",
Version = "1.0.0"
},
new PluginMetadata
{
ID = "ABC0TYUC6D3B7855823D60DC76F28855",
Version = "1.0.0"
}
};
// When
(var unique, var duplicates) = PluginConfig.GetUniqueLatestPluginMetadata(duplicateList);
// Then
Assert.True(unique.FirstOrDefault().ID == "CEA0TYUC6D3B4085823D60DC76F28855" && unique.FirstOrDefault().Version == "1.0.2");
Assert.True(unique.Count() == 1);
Assert.False(duplicates.Any(x => x.Version == "1.0.2" && x.ID == "CEA0TYUC6D3B4085823D60DC76F28855"));
Assert.True(duplicates.Count() == 6);
}
[Test]
public void GivenDuplicatePluginMetadatasWithNoUniquePluginWhenLoadedThenShouldReturnEmptyList()
{
// Given
var duplicateList = new List<PluginMetadata>
{
new PluginMetadata
{
ID = "CEA0TYUC6D3B7855823D60DC76F28855",
Version = "1.0.0"
},
new PluginMetadata
{
ID = "CEA0TYUC6D3B7855823D60DC76F28855",
Version = "1.0.0"
}
};
// When
(var unique, var duplicates) = PluginConfig.GetUniqueLatestPluginMetadata(duplicateList);
// Then
Assert.True(unique.Count() == 0);
Assert.True(duplicates.Count() == 2);
}
}
}

View file

@ -1,17 +0,0 @@
using NUnit.Framework;
using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Infrastructure.Exception;
namespace Flow.Launcher.Test.Plugins
{
[TestFixture]
public class PluginInitTest
{
[Test]
public void PublicAPIIsNullTest()
{
//Assert.Throws(typeof(Flow.LauncherFatalException), () => PluginManager.Initialize(null));
}
}
}

View file

@ -1,43 +1,137 @@
<Window x:Class="Flow.Launcher.ActionKeywords" <Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="Flow.Launcher.ActionKeywords"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Title="ActionKeywords" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Icon="Images\app.png" Title="{DynamicResource actionKeywordsTitle}"
ResizeMode="NoResize" Width="450"
Loaded="ActionKeyword_OnLoaded" Background="{DynamicResource PopuBGColor}"
WindowStartupLocation="CenterScreen" Foreground="{DynamicResource PopupTextColor}"
Height="250" Width="500"> Icon="Images\app.png"
Loaded="ActionKeyword_OnLoaded"
ResizeMode="NoResize"
SizeToContent="Height"
WindowStartupLocation="CenterScreen">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
</WindowChrome.WindowChrome>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition />
<RowDefinition Height="60"/> <RowDefinition Height="80" />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid>
<ColumnDefinition Width="150" /> <StackPanel Grid.Row="0">
<ColumnDefinition /> <StackPanel>
</Grid.ColumnDefinitions> <Grid>
<TextBlock FontSize="14" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" <Grid.ColumnDefinitions>
HorizontalAlignment="Left" Text="{DynamicResource currentActionKeywords}" /> <ColumnDefinition Width="Auto" />
<TextBlock x:Name="tbOldActionKeyword" Grid.Row="0" Grid.Column="1" Margin="170 10 10 10" FontSize="14" <ColumnDefinition Width="*" />
VerticalAlignment="Center" HorizontalAlignment="Left" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<TextBlock FontSize="14" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" <ColumnDefinition Width="Auto" />
HorizontalAlignment="Left" Text="{DynamicResource newActionKeyword}" /> </Grid.ColumnDefinitions>
<StackPanel Grid.Row="1" Orientation="Horizontal" Grid.Column="1"> <Button
<TextBox x:Name="tbAction" Margin="170 10 15 10" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" /> Grid.Column="4"
</StackPanel> Click="BtnCancel_OnClick"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Width="46"
Height="32"
Data="M 18,11 27,20 M 18,20 27,11"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1">
<Path.Style>
<Style TargetType="Path">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Opacity" Value="0.5" />
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
</Button>
</Grid>
</StackPanel>
<StackPanel Margin="26,12,26,0">
<StackPanel Grid.Row="0" Margin="0,0,0,12">
<TextBlock
Grid.Column="0"
Margin="0,0,0,0"
FontFamily="Segoe UI"
FontSize="20"
FontWeight="SemiBold"
Text="{DynamicResource actionKeywordsTitle}"
TextAlignment="Left" />
</StackPanel>
<StackPanel>
<TextBlock
FontSize="14"
Text="{DynamicResource actionkeyword_tips}"
TextAlignment="Left"
TextWrapping="WrapWithOverflow" />
</StackPanel>
<TextBlock Grid.Row="2" Grid.ColumnSpan="1" Grid.Column="1" Foreground="Gray" <StackPanel Margin="0,18,0,0" Orientation="Horizontal">
Text="{DynamicResource actionkeyword_tips}" /> <TextBlock
Grid.Row="0"
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="3" Grid.Column="1"> Grid.Column="1"
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="30" HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource currentActionKeywords}" />
<TextBlock
x:Name="tbOldActionKeyword"
Grid.Row="0"
Grid.Column="1"
Margin="14,10,10,10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
FontWeight="SemiBold"
Foreground="{DynamicResource Color05B}" />
</StackPanel>
<StackPanel Margin="0,0,0,10" Orientation="Horizontal">
<TextBlock
Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource newActionKeyword}" />
<TextBox
x:Name="tbAction"
Width="105"
Margin="10,10,15,10"
HorizontalAlignment="Left"
VerticalAlignment="Center" />
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
<Border
Grid.Row="1"
Background="{DynamicResource PopupButtonAreaBGColor}"
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
BorderThickness="0,1,0,0">
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Button
x:Name="btnCancel"
Width="145"
Height="30"
Margin="10,0,5,0"
Click="BtnCancel_OnClick"
Content="{DynamicResource cancel}" /> Content="{DynamicResource cancel}" />
<Button x:Name="btnDone" Margin="10 0 10 0" Width="80" Height="30" Click="btnDone_OnClick"> <Button
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" /> x:Name="btnDone"
</Button> Width="145"
</StackPanel> Height="30"
Margin="5,0,10,0"
Click="btnDone_OnClick"
Style="{StaticResource AccentButtonStyle}">
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
</Button>
</StackPanel>
</Border>
</Grid> </Grid>
</Window> </Window>

View file

@ -1,236 +1,30 @@
<Application x:Class="Flow.Launcher.App" <Application
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="Flow.Launcher.App"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ShutdownMode="OnMainWindowClose" xmlns:ui="http://schemas.modernwpf.com/2019"
Startup="OnStartupAsync"> ShutdownMode="OnMainWindowClose"
Startup="OnStartupAsync">
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<!--#region Expander for Setting Window-->
<Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Padding="{TemplateBinding Padding}">
<Grid Background="Transparent" SnapsToDevicePixels="False">
<Grid.RowDefinitions>
<RowDefinition Height="19"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid>
<Grid.LayoutTransform>
<TransformGroup>
<TransformGroup.Children>
<TransformCollection>
<RotateTransform Angle="-90"/>
</TransformCollection>
</TransformGroup.Children>
</TransformGroup>
</Grid.LayoutTransform>
<Ellipse x:Name="circle" HorizontalAlignment="Center" Height="19" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
<Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
</Grid>
<ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" Grid.Row="1" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Top"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
<Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Padding="{TemplateBinding Padding}">
<Grid Background="Transparent" SnapsToDevicePixels="False">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="19"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.LayoutTransform>
<TransformGroup>
<TransformGroup.Children>
<TransformCollection>
<RotateTransform Angle="180"/>
</TransformCollection>
</TransformGroup.Children>
</TransformGroup>
</Grid.LayoutTransform>
<Ellipse x:Name="circle" HorizontalAlignment="Center" Height="19" Stroke="Transparent" VerticalAlignment="Center" Width="19"/>
<Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" Stroke="#666" StrokeThickness="1" VerticalAlignment="Center"/>
</Grid>
<ContentPresenter Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Stroke" TargetName="circle" Value="Transparent"/>
<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Stroke" TargetName="circle" Value="Transparent"/>
<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
<Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Padding="{TemplateBinding Padding}">
<Grid Background="Transparent" SnapsToDevicePixels="False">
<Grid.RowDefinitions>
<RowDefinition Height="19"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid>
<Grid.LayoutTransform>
<TransformGroup>
<TransformGroup.Children>
<TransformCollection>
<RotateTransform Angle="90"/>
</TransformCollection>
</TransformGroup.Children>
</TransformGroup>
</Grid.LayoutTransform>
<Ellipse x:Name="circle" HorizontalAlignment="Center" Height="19" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
<Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
</Grid>
<ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" Grid.Row="1" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Top"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
<Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ExpanderHeaderFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Border>
<Rectangle Margin="0" SnapsToDevicePixels="true" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Padding="{TemplateBinding Padding}">
<Grid Background="Transparent" SnapsToDevicePixels="False">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="19"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Ellipse x:Name="circle" HorizontalAlignment="Center" Height="19" Stroke="Transparent" VerticalAlignment="Center" Width="19"/>
<Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" Stroke="#666" StrokeThickness="1" VerticalAlignment="Center"/>
<ContentPresenter Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Stroke" TargetName="circle" Value="Transparent"/>
<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Stroke" TargetName="circle" Value="Transparent"/>
<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
<Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ExpanderStyle1" TargetType="{x:Type Expander}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Expander}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="true">
<DockPanel>
<ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" Content="{TemplateBinding Header}" DockPanel.Dock="Top" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="18 0 0 0" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" Style="{StaticResource ExpanderDownHeaderStyle}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
<ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</DockPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
</Trigger>
<Trigger Property="ExpandDirection" Value="Right">
<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right"/>
<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}"/>
</Trigger>
<Trigger Property="ExpandDirection" Value="Up">
<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top"/>
<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}"/>
</Trigger>
<Trigger Property="ExpandDirection" Value="Left">
<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left"/>
<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--#endregion-->
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ui:ThemeResources RequestedTheme="Light" /> <ui:ThemeResources>
<ui:ThemeResources.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Resources/Light.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Resources/Dark.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ui:ThemeResources.ThemeDictionaries>
</ui:ThemeResources>
<ui:XamlControlsResources /> <ui:XamlControlsResources />
<ResourceDictionary Source="pack://application:,,,/Themes/Darker.xaml" /> <ResourceDictionary Source="pack://application:,,,/Resources/CustomControlTemplate.xaml" />
<ResourceDictionary Source="pack://application:,,,/Themes/Win11System.xaml" />
<ResourceDictionary Source="pack://application:,,,/Languages/en.xaml" /> <ResourceDictionary Source="pack://application:,,,/Languages/en.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>

View file

@ -100,8 +100,6 @@ namespace Flow.Launcher
AutoUpdates(); AutoUpdates();
API.SaveAppAllSettings(); API.SaveAppAllSettings();
_mainVM.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Hidden : Visibility.Visible;
Log.Info("|App.OnStartup|End Flow Launcher startup ---------------------------------------------------- "); Log.Info("|App.OnStartup|End Flow Launcher startup ---------------------------------------------------- ");
}); });
} }
@ -178,7 +176,7 @@ namespace Flow.Launcher
public void OnSecondAppStarted() public void OnSecondAppStarted()
{ {
Current.MainWindow.Visibility = Visibility.Visible; Current.MainWindow.Show();
} }
} }
} }

View file

@ -1,45 +1,160 @@
<Window x:Class="Flow.Launcher.CustomQueryHotkeySetting" <Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="Flow.Launcher.CustomQueryHotkeySetting"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:flowlauncher="clr-namespace:Flow.Launcher" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Icon="Images\app.png" xmlns:flowlauncher="clr-namespace:Flow.Launcher"
ResizeMode="NoResize" Title="{DynamicResource customeQueryHotkeyTitle}"
WindowStartupLocation="CenterScreen" Width="500"
Title="{DynamicResource customeQueryHotkeyTitle}" Height="200" Width="674.766"> Background="{DynamicResource PopuBGColor}"
Foreground="{DynamicResource PopupTextColor}"
Icon="Images\app.png"
MouseDown="window_MouseDown"
ResizeMode="NoResize"
SizeToContent="Height"
WindowStartupLocation="CenterScreen">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
</WindowChrome.WindowChrome>
<Window.InputBindings> <Window.InputBindings>
<KeyBinding Key="Escape" Command="Close"/> <KeyBinding Key="Escape" Command="Close" />
</Window.InputBindings> </Window.InputBindings>
<Window.CommandBindings> <Window.CommandBindings>
<CommandBinding Command="Close" Executed="cmdEsc_OnPress"/> <CommandBinding Command="Close" Executed="cmdEsc_OnPress" />
</Window.CommandBindings> </Window.CommandBindings>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition />
<RowDefinition /> <RowDefinition Height="80" />
<RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <StackPanel Grid.Row="0">
<ColumnDefinition Width="150" /> <StackPanel>
<ColumnDefinition /> <Grid>
</Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" <ColumnDefinition Width="Auto" />
HorizontalAlignment="Right" Text="{DynamicResource hotkey}" /> <ColumnDefinition Width="*" />
<flowlauncher:HotkeyControl x:Name="ctlHotkey" Margin="10,0,10,0" Grid.Column="1" VerticalAlignment="Center" Height="32" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="4"
Click="BtnCancel_OnClick"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Width="46"
Height="32"
Data="M 18,11 27,20 M 18,20 27,11"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1">
<Path.Style>
<Style TargetType="Path">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Opacity" Value="0.5" />
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
</Button>
</Grid>
</StackPanel>
<StackPanel Margin="26,0,26,0">
<StackPanel Grid.Row="0" Margin="0,0,0,12">
<TextBlock
Grid.Column="0"
Margin="0,0,0,0"
FontFamily="Segoe UI"
FontSize="20"
FontWeight="SemiBold"
Text="{DynamicResource customeQueryHotkeyTitle}"
TextAlignment="Left" />
</StackPanel>
<StackPanel>
<TextBlock
FontSize="14"
Text="{DynamicResource customeQueryHotkeyTips}"
TextAlignment="Left"
TextWrapping="WrapWithOverflow" />
</StackPanel>
<TextBlock Margin="10" FontSize="14" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" <StackPanel Margin="0,20,0,0" Orientation="Horizontal">
HorizontalAlignment="Right" Text="{DynamicResource actionKeyword}" /> <TextBlock
<StackPanel Grid.Row="1" Orientation="Horizontal" Grid.Column="1"> Grid.Row="0"
<TextBox x:Name="tbAction" Margin="10" Width="400" VerticalAlignment="Center" HorizontalAlignment="Left" /> Grid.Column="0"
<Button x:Name="btnTestActionKeyword" Padding="10 5 10 5" Height="30" Click="BtnTestActionKeyword_OnClick" Width="60"
Content="{DynamicResource preview}" /> Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource hotkey}" />
<flowlauncher:HotkeyControl
x:Name="ctlHotkey"
Grid.Column="1"
Width="200"
Height="34"
Margin="10,0,10,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
HorizontalContentAlignment="Left" />
<TextBlock
Grid.Row="1"
Grid.Column="0"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource actionKeyword}" />
</StackPanel>
<StackPanel Margin="0,0,0,0" Orientation="Horizontal">
<TextBlock
Grid.Row="0"
Grid.Column="0"
Width="60"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource customQuery}" />
<TextBox
x:Name="tbAction"
Width="250"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center" />
<Button
x:Name="btnTestActionKeyword"
Height="30"
Padding="10,5,10,5"
Click="BtnTestActionKeyword_OnClick"
Content="{DynamicResource preview}" />
</StackPanel>
</StackPanel>
</StackPanel> </StackPanel>
<Border
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="2" Grid.Column="1"> Grid.Row="1"
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="32" Margin="0,14,0,0"
Background="{DynamicResource PopupButtonAreaBGColor}"
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
BorderThickness="0,1,0,0">
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Button
x:Name="btnCancel"
Width="100"
Height="32"
Margin="10,0,5,0"
Click="BtnCancel_OnClick"
Content="{DynamicResource cancel}" /> Content="{DynamicResource cancel}" />
<Button x:Name="btnAdd" Margin="10 0 10 0" Width="80" Height="32" Click="btnAdd_OnClick"> <Button
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" /> x:Name="btnAdd"
</Button> Width="100"
</StackPanel> Height="32"
Margin="5,0,10,0"
Click="btnAdd_OnClick">
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
</Button>
</StackPanel>
</Border>
</Grid> </Grid>
</Window> </Window>

View file

@ -1,12 +1,11 @@
using Flow.Launcher.Core.Resource; using Flow.Launcher.Core.Resource;
using Flow.Launcher.Helper; using Flow.Launcher.Helper;
using Flow.Launcher.Infrastructure.Hotkey;
using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.UserSettings;
using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Controls;
namespace Flow.Launcher namespace Flow.Launcher
{ {
@ -90,14 +89,24 @@ namespace Flow.Launcher
private void BtnTestActionKeyword_OnClick(object sender, RoutedEventArgs e) private void BtnTestActionKeyword_OnClick(object sender, RoutedEventArgs e)
{ {
App.API.ChangeQuery(tbAction.Text); App.API.ChangeQuery(tbAction.Text);
Application.Current.MainWindow.Visibility = Visibility.Visible; Application.Current.MainWindow.Show();
Application.Current.MainWindow.Opacity = 1;
Application.Current.MainWindow.Focus(); Application.Current.MainWindow.Focus();
} }
private void cmdEsc_OnPress(object sender, ExecutedRoutedEventArgs e) private void cmdEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
{ {
Close(); Close();
} }
private void window_MouseDown(object sender, MouseButtonEventArgs e) /* for close hotkey popup */
{
TextBox textBox = Keyboard.FocusedElement as TextBox;
if (textBox != null)
{
TraversalRequest tRequest = new TraversalRequest(FocusNavigationDirection.Next);
textBox.MoveFocus(tRequest);
}
}
} }
} }

View file

@ -104,6 +104,12 @@
<ProjectReference Include="..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" /> <ProjectReference Include="..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Resources\open.wav">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent"> <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="taskkill /f /fi &quot;IMAGENAME eq Flow.Launcher.exe&quot;" /> <Exec Command="taskkill /f /fi &quot;IMAGENAME eq Flow.Launcher.exe&quot;" />
</Target> </Target>

View file

@ -6,8 +6,6 @@ using NHotkey.Wpf;
using Flow.Launcher.Core.Resource; using Flow.Launcher.Core.Resource;
using System.Windows; using System.Windows;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using System.Threading.Tasks;
using System.Threading;
namespace Flow.Launcher.Helper namespace Flow.Launcher.Helper
{ {
@ -27,7 +25,8 @@ namespace Flow.Launcher.Helper
internal static void OnToggleHotkey(object sender, HotkeyEventArgs args) internal static void OnToggleHotkey(object sender, HotkeyEventArgs args)
{ {
mainViewModel.ToggleFlowLauncher(); if (!mainViewModel.GameModeStatus)
mainViewModel.ToggleFlowLauncher();
} }
private static void SetHotkey(string hotkeyStr, EventHandler<HotkeyEventArgs> action) private static void SetHotkey(string hotkeyStr, EventHandler<HotkeyEventArgs> action)
@ -75,10 +74,10 @@ namespace Flow.Launcher.Helper
{ {
SetHotkey(hotkey.Hotkey, (s, e) => SetHotkey(hotkey.Hotkey, (s, e) =>
{ {
if (mainViewModel.ShouldIgnoreHotkeys()) if (mainViewModel.ShouldIgnoreHotkeys() || mainViewModel.GameModeStatus)
return; return;
mainViewModel.MainWindowVisibility = Visibility.Visible; mainViewModel.Show();
mainViewModel.ChangeQueryText(hotkey.ActionKeyword, true); mainViewModel.ChangeQueryText(hotkey.ActionKeyword, true);
}); });
} }

View file

@ -10,7 +10,6 @@ namespace Flow.Launcher.Helper
{ {
var window = Application.Current.Windows.OfType<Window>().FirstOrDefault(x => x.GetType() == typeof(T)) var window = Application.Current.Windows.OfType<Window>().FirstOrDefault(x => x.GetType() == typeof(T))
?? (T)Activator.CreateInstance(typeof(T), args); ?? (T)Activator.CreateInstance(typeof(T), args);
Application.Current.MainWindow.Hide();
// Fix UI bug // Fix UI bug
// Add `window.WindowState = WindowState.Normal` // Add `window.WindowState = WindowState.Normal`

View file

@ -1,19 +1,55 @@
<UserControl x:Class="Flow.Launcher.HotkeyControl" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="Flow.Launcher.HotkeyControl"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore" xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"
mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Height="24" Height="24"
d:DesignHeight="300" d:DesignWidth="300"> d:DesignHeight="300"
d:DesignWidth="300"
mc:Ignorable="d">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="125" /> <ColumnDefinition Width="200" />
<ColumnDefinition Width="160" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock x:Name="tbMsg" Visibility="Hidden" Margin="8 0 0 0" VerticalAlignment="Center" Grid.Column="0" HorizontalAlignment="Right"/> <Popup
<TextBox x:Name="tbHotkey" TabIndex="100" VerticalContentAlignment="Center" Grid.Column="1" x:Name="popup"
PreviewKeyDown="TbHotkey_OnPreviewKeyDown" input:InputMethod.IsInputMethodEnabled="False" Margin="5 0 18 0"/> AllowDrop="True"
AllowsTransparency="True"
IsOpen="{Binding IsKeyboardFocused, ElementName=tbHotkey, Mode=OneWay}"
Placement="Top"
PlacementTarget="{Binding ElementName=tbHotkey}"
PopupAnimation="Fade"
StaysOpen="True"
VerticalOffset="-5">
<Border
Width="140"
Height="30"
Background="{DynamicResource Color01B}"
BorderBrush="{DynamicResource Color21B}"
BorderThickness="1"
CornerRadius="4">
<TextBlock
x:Name="tbMsg"
Margin="0,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="13"
FontWeight="SemiBold"
Foreground="{DynamicResource Color05B}"
Visibility="Visible">
Press key
</TextBlock>
</Border>
</Popup>
<TextBox
x:Name="tbHotkey"
Margin="0,0,18,0"
VerticalContentAlignment="Center"
input:InputMethod.IsInputMethodEnabled="False"
PreviewKeyDown="TbHotkey_OnPreviewKeyDown"
TabIndex="100" />
</Grid> </Grid>
</UserControl> </UserControl>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View file

@ -1,7 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=mscorlib"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
<!--MainWindow--> xmlns:system="clr-namespace:System;assembly=mscorlib">
<!-- MainWindow -->
<system:String x:Key="registerHotkeyFailed">Failed to register hotkey: {0}</system:String> <system:String x:Key="registerHotkeyFailed">Failed to register hotkey: {0}</system:String>
<system:String x:Key="couldnotStartCmd">Could not start {0}</system:String> <system:String x:Key="couldnotStartCmd">Could not start {0}</system:String>
<system:String x:Key="invalidFlowLauncherPluginFileFormat">Invalid Flow Launcher plugin file format</system:String> <system:String x:Key="invalidFlowLauncherPluginFileFormat">Invalid Flow Launcher plugin file format</system:String>
@ -14,8 +15,10 @@
<system:String x:Key="iconTrayAbout">About</system:String> <system:String x:Key="iconTrayAbout">About</system:String>
<system:String x:Key="iconTrayExit">Exit</system:String> <system:String x:Key="iconTrayExit">Exit</system:String>
<system:String x:Key="closeWindow">Close</system:String> <system:String x:Key="closeWindow">Close</system:String>
<system:String x:Key="GameMode">Game Mode</system:String>
<system:String x:Key="GameModeToolTip">Suspend the use of Hotkeys.</system:String>
<!--Setting General--> <!-- Setting General -->
<system:String x:Key="flowlauncher_settings">Flow Launcher Settings</system:String> <system:String x:Key="flowlauncher_settings">Flow Launcher Settings</system:String>
<system:String x:Key="general">General</system:String> <system:String x:Key="general">General</system:String>
<system:String x:Key="portableMode">Portable Mode</system:String> <system:String x:Key="portableMode">Portable Mode</system:String>
@ -33,6 +36,8 @@
<system:String x:Key="maxShowResults">Maximum results shown</system:String> <system:String x:Key="maxShowResults">Maximum results shown</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreen">Ignore hotkeys in fullscreen mode</system:String> <system:String x:Key="ignoreHotkeysOnFullscreen">Ignore hotkeys in fullscreen mode</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreenToolTip">Disable Flow Launcher activation when a full screen application is active (Recommended for games).</system:String> <system:String x:Key="ignoreHotkeysOnFullscreenToolTip">Disable Flow Launcher activation when a full screen application is active (Recommended for games).</system:String>
<system:String x:Key="defaultFileManager">Default File Manager</system:String>
<system:String x:Key="defaultFileManagerToolTip">Select the file manager to use when opening the folder.</system:String>
<system:String x:Key="pythonDirectory">Python Directory</system:String> <system:String x:Key="pythonDirectory">Python Directory</system:String>
<system:String x:Key="autoUpdates">Auto Update</system:String> <system:String x:Key="autoUpdates">Auto Update</system:String>
<system:String x:Key="selectPythonDirectory">Select</system:String> <system:String x:Key="selectPythonDirectory">Select</system:String>
@ -44,31 +49,35 @@
<system:String x:Key="ShouldUsePinyinToolTip">Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for translating Chinese</system:String> <system:String x:Key="ShouldUsePinyinToolTip">Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for translating Chinese</system:String>
<system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String> <system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String>
<!--Setting Plugin--> <!-- Setting Plugin -->
<system:String x:Key="plugin">Plugins</system:String> <system:String x:Key="plugin">Plugins</system:String>
<system:String x:Key="browserMorePlugins">Find more plugins</system:String> <system:String x:Key="browserMorePlugins">Find more plugins</system:String>
<system:String x:Key="enable">On</system:String> <system:String x:Key="enable">On</system:String>
<system:String x:Key="disable">Off</system:String> <system:String x:Key="disable">Off</system:String>
<system:String x:Key="actionKeywordsTitle">Action keyword Setting</system:String>
<system:String x:Key="actionKeywords">Action keyword</system:String> <system:String x:Key="actionKeywords">Action keyword</system:String>
<system:String x:Key="currentActionKeywords">Current action keyword:</system:String> <system:String x:Key="currentActionKeywords">Current action keyword</system:String>
<system:String x:Key="newActionKeyword">New action keyword:</system:String> <system:String x:Key="newActionKeyword">New action keyword</system:String>
<system:String x:Key="currentPriority">Current Priority:</system:String> <system:String x:Key="currentPriority">Current Priority</system:String>
<system:String x:Key="newPriority">New Priority:</system:String> <system:String x:Key="newPriority">New Priority</system:String>
<system:String x:Key="priority">Priority</system:String> <system:String x:Key="priority">Priority</system:String>
<system:String x:Key="pluginDirectory">Plugin Directory</system:String> <system:String x:Key="pluginDirectory">Plugin Directory</system:String>
<system:String x:Key="author">Author:</system:String> <system:String x:Key="author">Author:</system:String>
<system:String x:Key="plugin_init_time">Init time:</system:String> <system:String x:Key="plugin_init_time">Init time:</system:String>
<system:String x:Key="plugin_query_time">Query time:</system:String> <system:String x:Key="plugin_query_time">Query time:</system:String>
<system:String x:Key="plugin_query_version">| Version</system:String>
<system:String x:Key="plugin_query_web">Website</system:String>
<!--Setting Plugin Store--> <!-- Setting Plugin Store -->
<system:String x:Key="pluginStore">Plugin Store</system:String> <system:String x:Key="pluginStore">Plugin Store</system:String>
<system:String x:Key="refresh">Refresh</system:String> <system:String x:Key="refresh">Refresh</system:String>
<system:String x:Key="install">Install</system:String> <system:String x:Key="install">Install</system:String>
<!--Setting Theme--> <!-- Setting Theme -->
<system:String x:Key="theme">Theme</system:String> <system:String x:Key="theme">Theme</system:String>
<system:String x:Key="browserMoreThemes">Browse for more themes</system:String> <system:String x:Key="browserMoreThemes">Theme Gallery</system:String>
<system:String x:Key="howToCreateTheme">How to create a theme</system:String>
<system:String x:Key="hiThere">Hi There</system:String> <system:String x:Key="hiThere">Hi There</system:String>
<system:String x:Key="queryBoxFont">Query Box Font</system:String> <system:String x:Key="queryBoxFont">Query Box Font</system:String>
<system:String x:Key="resultItemFont">Result Item Font</system:String> <system:String x:Key="resultItemFont">Result Item Font</system:String>
@ -78,8 +87,16 @@
<system:String x:Key="theme_load_failure_parse_error">Fail to load theme {0}, fallback to default theme</system:String> <system:String x:Key="theme_load_failure_parse_error">Fail to load theme {0}, fallback to default theme</system:String>
<system:String x:Key="ThemeFolder">Theme Folder</system:String> <system:String x:Key="ThemeFolder">Theme Folder</system:String>
<system:String x:Key="OpenThemeFolder">Open Theme Folder</system:String> <system:String x:Key="OpenThemeFolder">Open Theme Folder</system:String>
<system:String x:Key="ColorScheme">Color Scheme</system:String>
<system:String x:Key="ColorSchemeSystem">System Default</system:String>
<system:String x:Key="ColorSchemeLight">Light</system:String>
<system:String x:Key="ColorSchemeDark">Dark</system:String>
<system:String x:Key="SoundEffect">Sound Effect</system:String>
<system:String x:Key="SoundEffectTip">Play a small sound when the search window opens</system:String>
<system:String x:Key="Animation">Animation</system:String>
<system:String x:Key="AnimationTip">Use Animation in UI</system:String>
<!--Setting Hotkey--> <!-- Setting Hotkey -->
<system:String x:Key="hotkey">Hotkey</system:String> <system:String x:Key="hotkey">Hotkey</system:String>
<system:String x:Key="flowlauncherHotkey">Flow Launcher Hotkey</system:String> <system:String x:Key="flowlauncherHotkey">Flow Launcher Hotkey</system:String>
<system:String x:Key="flowlauncherHotkeyToolTip">Enter shortcut to show/hide Flow Launcher.</system:String> <system:String x:Key="flowlauncherHotkeyToolTip">Enter shortcut to show/hide Flow Launcher.</system:String>
@ -96,10 +113,11 @@
<system:String x:Key="deleteCustomHotkeyWarning">Are you sure you want to delete {0} plugin hotkey?</system:String> <system:String x:Key="deleteCustomHotkeyWarning">Are you sure you want to delete {0} plugin hotkey?</system:String>
<system:String x:Key="queryWindowShadowEffect">Query window shadow effect</system:String> <system:String x:Key="queryWindowShadowEffect">Query window shadow effect</system:String>
<system:String x:Key="shadowEffectCPUUsage">Shadow effect has a substantial usage of GPU. Not recommended if your computer performance is limited.</system:String> <system:String x:Key="shadowEffectCPUUsage">Shadow effect has a substantial usage of GPU. Not recommended if your computer performance is limited.</system:String>
<system:String x:Key="windowWidthSize">Window Width Size</system:String>
<system:String x:Key="useGlyphUI">Use Segoe Fluent Icons</system:String> <system:String x:Key="useGlyphUI">Use Segoe Fluent Icons</system:String>
<system:String x:Key="useGlyphUIEffect">Use Segoe Fluent Icons for query results where supported</system:String> <system:String x:Key="useGlyphUIEffect">Use Segoe Fluent Icons for query results where supported</system:String>
<!--Setting Proxy--> <!-- Setting Proxy -->
<system:String x:Key="proxy">HTTP Proxy</system:String> <system:String x:Key="proxy">HTTP Proxy</system:String>
<system:String x:Key="enableProxy">Enable HTTP Proxy</system:String> <system:String x:Key="enableProxy">Enable HTTP Proxy</system:String>
<system:String x:Key="server">HTTP Server</system:String> <system:String x:Key="server">HTTP Server</system:String>
@ -115,27 +133,42 @@
<system:String x:Key="proxyIsCorrect">Proxy configured correctly</system:String> <system:String x:Key="proxyIsCorrect">Proxy configured correctly</system:String>
<system:String x:Key="proxyConnectFailed">Proxy connection failed</system:String> <system:String x:Key="proxyConnectFailed">Proxy connection failed</system:String>
<!--Setting About--> <!-- Setting About -->
<system:String x:Key="about">About</system:String> <system:String x:Key="about">About</system:String>
<system:String x:Key="website">Website</system:String> <system:String x:Key="website">Website</system:String>
<system:String x:Key="github">Github</system:String>
<system:String x:Key="docs">Docs</system:String>
<system:String x:Key="version">Version</system:String> <system:String x:Key="version">Version</system:String>
<system:String x:Key="about_activate_times">You have activated Flow Launcher {0} times</system:String> <system:String x:Key="about_activate_times">You have activated Flow Launcher {0} times</system:String>
<system:String x:Key="checkUpdates">Check for Updates</system:String> <system:String x:Key="checkUpdates">Check for Updates</system:String>
<system:String x:Key="newVersionTips">New version {0} is available, would you like to restart Flow Launcher to use the update?</system:String> <system:String x:Key="newVersionTips">New version {0} is available, would you like to restart Flow Launcher to use the update?</system:String>
<system:String x:Key="checkUpdatesFailed">Check updates failed, please check your connection and proxy settings to api.github.com.</system:String> <system:String x:Key="checkUpdatesFailed">Check updates failed, please check your connection and proxy settings to api.github.com.</system:String>
<system:String x:Key="downloadUpdatesFailed"> <system:String x:Key="downloadUpdatesFailed">
Download updates failed, please check your connection and proxy settings to github-cloud.s3.amazonaws.com, Download updates failed, please check your connection and proxy settings to github-cloud.s3.amazonaws.com,
or go to https://github.com/Flow-Launcher/Flow.Launcher/releases to download updates manually. or go to https://github.com/Flow-Launcher/Flow.Launcher/releases to download updates manually.
</system:String> </system:String>
<system:String x:Key="releaseNotes">Release Notes</system:String> <system:String x:Key="releaseNotes">Release Notes</system:String>
<system:String x:Key="documentation">Usage Tips:</system:String> <system:String x:Key="documentation">Usage Tips</system:String>
<system:String x:Key="devtool">DevTools</system:String>
<system:String x:Key="settingfolder">Setting Folder</system:String>
<system:String x:Key="logfolder">Log Folder</system:String>
<!--Priority Setting Dialog--> <!-- FileManager Setting Dialog -->
<system:String x:Key="fileManagerWindow">Select File Manager</system:String>
<system:String x:Key="fileManager_tips">Please specify the file location of the file manager you using and add arguments if necessary. The default arguments is &quot;%d&quot;, and a path is entered at that location. For example, If a command is required such as &quot;totalcmd.exe /A c:\windows&quot;, argument is /A &quot;%d&quot;.</system:String>
<system:String x:Key="fileManager_tips2">&quot;%f&quot; is an argument that represent the file path. It is used to emphasize the file/folder name when opening a specific file location in 3rd party file manager. This argument is only available in the &quot;Arg for File&quot; item. If the file manager does not have that function, you can use &quot;%d&quot;.</system:String>
<system:String x:Key="fileManager_name">File Manager</system:String>
<system:String x:Key="fileManager_profile_name">Profile Name</system:String>
<system:String x:Key="fileManager_path">File Manager Path</system:String>
<system:String x:Key="fileManager_directory_arg">Arg For Folder</system:String>
<system:String x:Key="fileManager_file_arg">Arg For File</system:String>
<!-- Priority Setting Dialog -->
<system:String x:Key="changePriorityWindow">Change Priority</system:String> <system:String x:Key="changePriorityWindow">Change Priority</system:String>
<system:String x:Key="priority_tips">Greater the number, the higher the result will be ranked. Try setting it as 5. If you want the results to be lower than any other plugin's, provide a negative number</system:String> <system:String x:Key="priority_tips">Greater the number, the higher the result will be ranked. Try setting it as 5. If you want the results to be lower than any other plugin's, provide a negative number</system:String>
<system:String x:Key="invalidPriority">Please provide an valid integer for Priority!</system:String> <system:String x:Key="invalidPriority">Please provide an valid integer for Priority!</system:String>
<!--Action Keyword Setting Dialog--> <!-- Action Keyword Setting Dialog -->
<system:String x:Key="oldActionKeywords">Old Action Keyword</system:String> <system:String x:Key="oldActionKeywords">Old Action Keyword</system:String>
<system:String x:Key="newActionKeywords">New Action Keyword</system:String> <system:String x:Key="newActionKeywords">New Action Keyword</system:String>
<system:String x:Key="cancel">Cancel</system:String> <system:String x:Key="cancel">Cancel</system:String>
@ -145,19 +178,20 @@
<system:String x:Key="newActionKeywordsHasBeenAssigned">This new Action Keyword is already assigned to another plugin, please choose a different one</system:String> <system:String x:Key="newActionKeywordsHasBeenAssigned">This new Action Keyword is already assigned to another plugin, please choose a different one</system:String>
<system:String x:Key="success">Success</system:String> <system:String x:Key="success">Success</system:String>
<system:String x:Key="completedSuccessfully">Completed successfully</system:String> <system:String x:Key="completedSuccessfully">Completed successfully</system:String>
<system:String x:Key="actionkeyword_tips">Use * if you don't want to specify an action keyword</system:String> <system:String x:Key="actionkeyword_tips">Enter the action keyword you need to start the plug-in. Use * if you don't want to specify an action keyword. In the case, The plug-in works without keywords.</system:String>
<!--Custom Query Hotkey Dialog--> <!-- Custom Query Hotkey Dialog -->
<system:String x:Key="customeQueryHotkeyTitle">Custom Plugin Hotkey</system:String> <system:String x:Key="customeQueryHotkeyTitle">Custom Query Hotkey</system:String>
<system:String x:Key="customeQueryHotkeyTips">Press the custom hotkey to automatically insert the specified query.</system:String>
<system:String x:Key="preview">Preview</system:String> <system:String x:Key="preview">Preview</system:String>
<system:String x:Key="hotkeyIsNotUnavailable">Hotkey is unavailable, please select a new hotkey</system:String> <system:String x:Key="hotkeyIsNotUnavailable">Hotkey is unavailable, please select a new hotkey</system:String>
<system:String x:Key="invalidPluginHotkey">Invalid plugin hotkey</system:String> <system:String x:Key="invalidPluginHotkey">Invalid plugin hotkey</system:String>
<system:String x:Key="update">Update</system:String> <system:String x:Key="update">Update</system:String>
<!--Hotkey Control--> <!-- Hotkey Control -->
<system:String x:Key="hotkeyUnavailable">Hotkey Unavailable</system:String> <system:String x:Key="hotkeyUnavailable">Hotkey Unavailable</system:String>
<!--Crash Reporter--> <!-- Crash Reporter -->
<system:String x:Key="reportWindow_version">Version</system:String> <system:String x:Key="reportWindow_version">Version</system:String>
<system:String x:Key="reportWindow_time">Time</system:String> <system:String x:Key="reportWindow_time">Time</system:String>
<system:String x:Key="reportWindow_reproduce">Please tell us how application crashed so we can fix it</system:String> <system:String x:Key="reportWindow_reproduce">Please tell us how application crashed so we can fix it</system:String>
@ -173,16 +207,18 @@
<system:String x:Key="reportWindow_report_failed">Failed to send report</system:String> <system:String x:Key="reportWindow_report_failed">Failed to send report</system:String>
<system:String x:Key="reportWindow_flowlauncher_got_an_error">Flow Launcher got an error</system:String> <system:String x:Key="reportWindow_flowlauncher_got_an_error">Flow Launcher got an error</system:String>
<!--General Notice--> <!-- General Notice -->
<system:String x:Key="pleaseWait">Please wait...</system:String> <system:String x:Key="pleaseWait">Please wait...</system:String>
<!--update--> <!-- update -->
<system:String x:Key="update_flowlauncher_update_check">Checking for new update</system:String> <system:String x:Key="update_flowlauncher_update_check">Checking for new update</system:String>
<system:String x:Key="update_flowlauncher_already_on_latest">You already have the latest Flow Launcher version</system:String> <system:String x:Key="update_flowlauncher_already_on_latest">You already have the latest Flow Launcher version</system:String>
<system:String x:Key="update_flowlauncher_update_found">Update found</system:String> <system:String x:Key="update_flowlauncher_update_found">Update found</system:String>
<system:String x:Key="update_flowlauncher_updating">Updating...</system:String> <system:String x:Key="update_flowlauncher_updating">Updating...</system:String>
<system:String x:Key="update_flowlauncher_fail_moving_portable_user_profile_data">Flow Launcher was not able to move your user profile data to the new update version. <system:String x:Key="update_flowlauncher_fail_moving_portable_user_profile_data">
Please manually move your profile data folder from {0} to {1}</system:String> Flow Launcher was not able to move your user profile data to the new update version.
Please manually move your profile data folder from {0} to {1}
</system:String>
<system:String x:Key="update_flowlauncher_new_update">New Update</system:String> <system:String x:Key="update_flowlauncher_new_update">New Update</system:String>
<system:String x:Key="update_flowlauncher_update_new_version_available">New Flow Launcher release {0} is now available</system:String> <system:String x:Key="update_flowlauncher_update_new_version_available">New Flow Launcher release {0} is now available</system:String>
<system:String x:Key="update_flowlauncher_update_error">An error occurred while trying to install software updates</system:String> <system:String x:Key="update_flowlauncher_update_error">An error occurred while trying to install software updates</system:String>

View file

@ -1,7 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=mscorlib"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
<!--MainWindow--> xmlns:system="clr-namespace:System;assembly=mscorlib">
<!-- MainWindow -->
<system:String x:Key="registerHotkeyFailed">핫키 등록 실패: {0}</system:String> <system:String x:Key="registerHotkeyFailed">핫키 등록 실패: {0}</system:String>
<system:String x:Key="couldnotStartCmd">{0}을 실행할 수 없습니다.</system:String> <system:String x:Key="couldnotStartCmd">{0}을 실행할 수 없습니다.</system:String>
<system:String x:Key="invalidFlowLauncherPluginFileFormat">Flow Launcher 플러그인 파일 형식이 유효하지 않습니다.</system:String> <system:String x:Key="invalidFlowLauncherPluginFileFormat">Flow Launcher 플러그인 파일 형식이 유효하지 않습니다.</system:String>
@ -14,8 +15,10 @@
<system:String x:Key="iconTrayAbout">정보</system:String> <system:String x:Key="iconTrayAbout">정보</system:String>
<system:String x:Key="iconTrayExit">종료</system:String> <system:String x:Key="iconTrayExit">종료</system:String>
<system:String x:Key="closeWindow">닫기</system:String> <system:String x:Key="closeWindow">닫기</system:String>
<system:String x:Key="GameMode">게임 모드</system:String>
<system:String x:Key="GameModeToolTip">핫키 사용을 일시중단합니다.</system:String>
<!--Setting General--> <!-- Setting General -->
<system:String x:Key="flowlauncher_settings">Flow Launcher 설정</system:String> <system:String x:Key="flowlauncher_settings">Flow Launcher 설정</system:String>
<system:String x:Key="general">일반</system:String> <system:String x:Key="general">일반</system:String>
<system:String x:Key="portableMode">포터블 모드</system:String> <system:String x:Key="portableMode">포터블 모드</system:String>
@ -33,41 +36,48 @@
<system:String x:Key="maxShowResults">표시할 결과 수</system:String> <system:String x:Key="maxShowResults">표시할 결과 수</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreen">전체화면 모드에서는 핫키 무시</system:String> <system:String x:Key="ignoreHotkeysOnFullscreen">전체화면 모드에서는 핫키 무시</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreenToolTip">게이머라면 켜는 것을 추천합니다.</system:String> <system:String x:Key="ignoreHotkeysOnFullscreenToolTip">게이머라면 켜는 것을 추천합니다.</system:String>
<system:String x:Key="defaultFileManager">기본 파일관리자</system:String>
<system:String x:Key="defaultFileManagerToolTip">폴더를 열 때 사용할 파일관리자를 선택하세요.</system:String>
<system:String x:Key="pythonDirectory">Python 디렉토리</system:String> <system:String x:Key="pythonDirectory">Python 디렉토리</system:String>
<system:String x:Key="autoUpdates">자동 업데이트</system:String> <system:String x:Key="autoUpdates">자동 업데이트</system:String>
<system:String x:Key="selectPythonDirectory">선택</system:String> <system:String x:Key="selectPythonDirectory">선택</system:String>
<system:String x:Key="hideOnStartup">시작 시 Flow Launcher 숨김</system:String> <system:String x:Key="hideOnStartup">시작 시 Flow Launcher 숨김</system:String>
<system:String x:Key="hideNotifyIcon">트레이 아이콘 숨기기</system:String> <system:String x:Key="hideNotifyIcon">트레이 아이콘 숨기기</system:String>
<system:String x:Key="querySearchPrecision">쿼리 검색 정도</system:String> <system:String x:Key="querySearchPrecision">쿼리 검색 정도</system:String>
<system:String x:Key="querySearchPrecisionToolTip">검색 결과가 좀 더 정확해집니다.</system:String> <system:String x:Key="querySearchPrecisionToolTip">검색 결과에 필요한 최소 매치 점수를 변경합니다.</system:String>
<system:String x:Key="ShouldUsePinyin">항상 Pinyin 사용</system:String> <system:String x:Key="ShouldUsePinyin">항상 Pinyin 사용</system:String>
<system:String x:Key="ShouldUsePinyinToolTip">Pinyin을 사용하여 검색할 수 있습니다. Pinyin(병음)은 로마자 중국어 입력 방식입니다.</system:String> <system:String x:Key="ShouldUsePinyinToolTip">Pinyin을 사용하여 검색할 수 있습니다. Pinyin(병음)은 로마자 중국어 입력 방식입니다.</system:String>
<system:String x:Key="shadowEffectNotAllowed">반투명 흐림 효과를 사용하는 경우, 그림자 효과를 쓸 수 없습니다.</system:String> <system:String x:Key="shadowEffectNotAllowed">반투명 흐림 효과를 사용하는 경우, 그림자 효과를 쓸 수 없습니다.</system:String>
<!--Setting Plugin--> <!-- Setting Plugin -->
<system:String x:Key="plugin">플러그인</system:String> <system:String x:Key="plugin">플러그인</system:String>
<system:String x:Key="browserMorePlugins">플러그인 더 찾아보기</system:String> <system:String x:Key="browserMorePlugins">플러그인 더 찾아보기</system:String>
<system:String x:Key="enable">On</system:String> <system:String x:Key="enable"></system:String>
<system:String x:Key="disable">Off</system:String> <system:String x:Key="disable"></system:String>
<system:String x:Key="actionKeywords">액션 키워드</system:String> <system:String x:Key="actionKeywords">액션 키워드</system:String>
<system:String x:Key="currentActionKeywords">현재 액션 키워드</system:String>
<system:String x:Key="newActionKeyword">새 액션 키워드</system:String>
<system:String x:Key="currentPriority">현재 중요도:</system:String> <system:String x:Key="currentPriority">현재 중요도:</system:String>
<system:String x:Key="newPriority">새 중요도:</system:String> <system:String x:Key="newPriority">새 중요도:</system:String>
<system:String x:Key="priority">중요도</system:String> <system:String x:Key="priority">중요도</system:String>
<system:String x:Key="pluginDirectory">플러그인 디렉토리</system:String> <system:String x:Key="pluginDirectory">플러그인 폴더</system:String>
<system:String x:Key="author">자</system:String> <system:String x:Key="author">제작자</system:String>
<system:String x:Key="plugin_init_time">초기화 시간:</system:String> <system:String x:Key="plugin_init_time">초기화 시간:</system:String>
<system:String x:Key="plugin_query_time">쿼리 시간:</system:String> <system:String x:Key="plugin_query_time">쿼리 시간:</system:String>
<system:String x:Key="plugin_query_version">| 버전</system:String>
<system:String x:Key="plugin_query_web">웹사이트</system:String>
<!--Setting Plugin Store-->
<!-- Setting Plugin Store -->
<system:String x:Key="pluginStore">플러그인 스토어</system:String> <system:String x:Key="pluginStore">플러그인 스토어</system:String>
<system:String x:Key="refresh">새로고침</system:String> <system:String x:Key="refresh">새로고침</system:String>
<system:String x:Key="install">설치</system:String> <system:String x:Key="install">설치</system:String>
<!--Setting Theme--> <!-- Setting Theme -->
<system:String x:Key="theme">테마</system:String> <system:String x:Key="theme">테마</system:String>
<system:String x:Key="browserMoreThemes">테마 더 찾아보기</system:String> <system:String x:Key="browserMoreThemes">테마 갤러리</system:String>
<system:String x:Key="howToCreateTheme">테마 제작 안내</system:String>
<system:String x:Key="hiThere">Hi There</system:String> <system:String x:Key="hiThere">Hi There</system:String>
<system:String x:Key="queryBoxFont">쿼리 상자 글꼴</system:String> <system:String x:Key="queryBoxFont">쿼리 상자 글꼴</system:String>
<system:String x:Key="resultItemFont">결과 항목 글꼴</system:String> <system:String x:Key="resultItemFont">결과 항목 글꼴</system:String>
@ -77,8 +87,16 @@
<system:String x:Key="theme_load_failure_parse_error">{0} 테마 로드에 실패했습니다. 기본 테마로 변경합니다.</system:String> <system:String x:Key="theme_load_failure_parse_error">{0} 테마 로드에 실패했습니다. 기본 테마로 변경합니다.</system:String>
<system:String x:Key="ThemeFolder">테마 폴더</system:String> <system:String x:Key="ThemeFolder">테마 폴더</system:String>
<system:String x:Key="OpenThemeFolder">테마 폴더 열기</system:String> <system:String x:Key="OpenThemeFolder">테마 폴더 열기</system:String>
<system:String x:Key="ColorScheme">앱 색상</system:String>
<system:String x:Key="ColorSchemeSystem">시스템 기본</system:String>
<system:String x:Key="ColorSchemeLight">밝게</system:String>
<system:String x:Key="ColorSchemeDark">어둡게</system:String>
<system:String x:Key="SoundEffect">소리 효과</system:String>
<system:String x:Key="SoundEffectTip">검색창을 열 때 작은 소리를 재생합니다.</system:String>
<system:String x:Key="Animation">애니메이션</system:String>
<system:String x:Key="AnimationTip">일부 UI에 애니메이션을 사용합니다.</system:String>
<!--Setting Hotkey--> <!-- Setting Hotkey -->
<system:String x:Key="hotkey">핫키</system:String> <system:String x:Key="hotkey">핫키</system:String>
<system:String x:Key="flowlauncherHotkey">Flow Launcher 핫키</system:String> <system:String x:Key="flowlauncherHotkey">Flow Launcher 핫키</system:String>
<system:String x:Key="flowlauncherHotkeyToolTip">Flow Launcher를 열 때 사용할 단축키를 입력합니다.</system:String> <system:String x:Key="flowlauncherHotkeyToolTip">Flow Launcher를 열 때 사용할 단축키를 입력합니다.</system:String>
@ -87,7 +105,7 @@
<system:String x:Key="showOpenResultHotkey">단축키 표시</system:String> <system:String x:Key="showOpenResultHotkey">단축키 표시</system:String>
<system:String x:Key="showOpenResultHotkeyToolTip">결과창에서 결과 선택 단축키를 표시합니다.</system:String> <system:String x:Key="showOpenResultHotkeyToolTip">결과창에서 결과 선택 단축키를 표시합니다.</system:String>
<system:String x:Key="customQueryHotkey">사용자지정 쿼리 핫키</system:String> <system:String x:Key="customQueryHotkey">사용자지정 쿼리 핫키</system:String>
<system:String x:Key="customQuery">Query</system:String> <system:String x:Key="customQuery">쿼리</system:String>
<system:String x:Key="delete">삭제</system:String> <system:String x:Key="delete">삭제</system:String>
<system:String x:Key="edit">편집</system:String> <system:String x:Key="edit">편집</system:String>
<system:String x:Key="add">추가</system:String> <system:String x:Key="add">추가</system:String>
@ -95,10 +113,11 @@
<system:String x:Key="deleteCustomHotkeyWarning">{0} 플러그인 핫키를 삭제하시겠습니까?</system:String> <system:String x:Key="deleteCustomHotkeyWarning">{0} 플러그인 핫키를 삭제하시겠습니까?</system:String>
<system:String x:Key="queryWindowShadowEffect">그림자 효과</system:String> <system:String x:Key="queryWindowShadowEffect">그림자 효과</system:String>
<system:String x:Key="shadowEffectCPUUsage">그림자 효과는 GPU를 사용합니다. 컴퓨터 퍼포먼스가 제한적인 경우 사용을 추천하지 않습니다.</system:String> <system:String x:Key="shadowEffectCPUUsage">그림자 효과는 GPU를 사용합니다. 컴퓨터 퍼포먼스가 제한적인 경우 사용을 추천하지 않습니다.</system:String>
<system:String x:Key="windowWidthSize">창 넓이</system:String>
<system:String x:Key="useGlyphUI">플루언트 아이콘 사용</system:String> <system:String x:Key="useGlyphUI">플루언트 아이콘 사용</system:String>
<system:String x:Key="useGlyphUIEffect">결과 및 일부 메뉴에서 플루언트 아이콘을 사용합니다.</system:String> <system:String x:Key="useGlyphUIEffect">결과 및 일부 메뉴에서 플루언트 아이콘을 사용합니다.</system:String>
<!--Setting Proxy--> <!-- Setting Proxy -->
<system:String x:Key="proxy">HTTP 프록시</system:String> <system:String x:Key="proxy">HTTP 프록시</system:String>
<system:String x:Key="enableProxy">HTTP 프록시 켜기</system:String> <system:String x:Key="enableProxy">HTTP 프록시 켜기</system:String>
<system:String x:Key="server">HTTP 서버</system:String> <system:String x:Key="server">HTTP 서버</system:String>
@ -114,26 +133,41 @@
<system:String x:Key="proxyIsCorrect">프록시 설정 정상</system:String> <system:String x:Key="proxyIsCorrect">프록시 설정 정상</system:String>
<system:String x:Key="proxyConnectFailed">프록시 연결 실패</system:String> <system:String x:Key="proxyConnectFailed">프록시 연결 실패</system:String>
<!--Setting About--> <!-- Setting About -->
<system:String x:Key="about">정보</system:String> <system:String x:Key="about">정보</system:String>
<system:String x:Key="website">웹사이트</system:String> <system:String x:Key="website">웹사이트</system:String>
<system:String x:Key="github">Github</system:String>
<system:String x:Key="docs">문서</system:String>
<system:String x:Key="version">버전</system:String> <system:String x:Key="version">버전</system:String>
<system:String x:Key="about_activate_times">Flow Launcher를 {0}번 실행했습니다.</system:String> <system:String x:Key="about_activate_times">Flow Launcher를 {0}번 실행했습니다.</system:String>
<system:String x:Key="checkUpdates">업데이트 확인</system:String> <system:String x:Key="checkUpdates">업데이트 확인</system:String>
<system:String x:Key="newVersionTips">새 버전({0})이 있습니다. Flow Launcher를 재시작하세요.</system:String> <system:String x:Key="newVersionTips">새 버전({0})이 있습니다. Flow Launcher를 재시작하세요.</system:String>
<system:String x:Key="checkUpdatesFailed">업데이트 확인을 실패했습니다. api.github.com로의 연결 또는 프록시 설정을 확인해주세요.</system:String> <system:String x:Key="checkUpdatesFailed">업데이트 확인을 실패했습니다. api.github.com로의 연결 또는 프록시 설정을 확인해주세요.</system:String>
<system:String x:Key="downloadUpdatesFailed"> <system:String x:Key="downloadUpdatesFailed">
업데이트 다운로드에 실패했습니다. github-cloud.s3.amazonaws.com의 연결 또는 프록시 설정을 확인해주세요. 업데이트 다운로드에 실패했습니다. github-cloud.s3.amazonaws.com의 연결 또는 프록시 설정을 확인해주세요.
수동 다운로드를 하려면 https://github.com/Flow-Launcher/Flow.Launcher/releases 으로 방문하세요. 수동 다운로드를 하려면 https://github.com/Flow-Launcher/Flow.Launcher/releases 으로 방문하세요.
</system:String> </system:String>
<system:String x:Key="releaseNotes">릴리즈 노트:</system:String> <system:String x:Key="releaseNotes">릴리즈 노트</system:String>
<system:String x:Key="documentation">사용 팁:</system:String> <system:String x:Key="documentation">사용 팁</system:String>
<system:String x:Key="devtool">개발자도구</system:String>
<system:String x:Key="settingfolder">설정 폴더</system:String>
<system:String x:Key="logfolder">로그 폴더</system:String>
<!--Priority Setting Dialog--> <!-- FileManager Setting Dialog -->
<system:String x:Key="fileManagerWindow">파일관리자 선택</system:String>
<system:String x:Key="fileManager_tips">사용하려는 파일관리자를 선택하고 필요한 경우 인수를 추가하세요. 기본 인수는 &quot;%d&quot; 이며 해당 위치에 경로가 입력됩니다. 예를들어 &quot;totalcmd.exe /A c:\windows&quot;와 같은 명령이 필요한 경우, 인수는 /A &quot;%d&quot; 입니다.</system:String>
<system:String x:Key="fileManager_tips2">&quot;%f&quot;는 특정 파일의 경로를 나타냅니다. 파일관리자에서 선택한 파일/폴더의 위치를 강조하는 기능에서 사용됩니다. 이 인수는 &quot;파일경로 인수&quot; 항목에서만 사용할 수 있습니다. 파일관리자에 해당 기능이 없거나 잘 모를 경우 &quot;%d&quot; 인수를 사용할 수 있습니다.</system:String>
<system:String x:Key="fileManager_name">파일관리자</system:String>
<system:String x:Key="fileManager_profile_name">프로필 이름</system:String>
<system:String x:Key="fileManager_path">파일관리자 경로</system:String>
<system:String x:Key="fileManager_directory_arg">폴더경로 인수</system:String>
<system:String x:Key="fileManager_file_arg">파일경로 인수</system:String>
<!-- Priority Setting Dialog -->
<system:String x:Key="changePriorityWindow">중요도 변경</system:String> <system:String x:Key="changePriorityWindow">중요도 변경</system:String>
<system:String x:Key="priority_tips">높은 수를 넣을수록 상위 결과에 표시됩니다. 5를 시도해보세요. 다른 플러그인 보다 결과를 낮추고 싶다면, 그보다 낮은 수를 입력하세요.</system:String> <system:String x:Key="priority_tips">높은 수를 넣을수록 상위 결과에 표시됩니다. 5를 시도해보세요. 다른 플러그인 보다 결과를 낮춰 표시하고 싶다면, 그보다 낮은 수를 입력하세요.</system:String>
<system:String x:Key="invalidPriority">중요도에 올바른 정수를 입력하세요.</system:String> <system:String x:Key="invalidPriority">중요도에 올바른 정수를 입력하세요.</system:String>
<!--Action Keyword Setting Dialog--> <!-- Action Keyword Setting Dialog -->
<system:String x:Key="oldActionKeywords">예전 액션 키워드</system:String> <system:String x:Key="oldActionKeywords">예전 액션 키워드</system:String>
<system:String x:Key="newActionKeywords">새 액션 키워드</system:String> <system:String x:Key="newActionKeywords">새 액션 키워드</system:String>
<system:String x:Key="cancel">취소</system:String> <system:String x:Key="cancel">취소</system:String>
@ -143,19 +177,20 @@
<system:String x:Key="newActionKeywordsHasBeenAssigned">새 액션 키워드가 할당된 플러그인이 이미 있습니다. 다른 액션 키워드를 입력하세요.</system:String> <system:String x:Key="newActionKeywordsHasBeenAssigned">새 액션 키워드가 할당된 플러그인이 이미 있습니다. 다른 액션 키워드를 입력하세요.</system:String>
<system:String x:Key="success">성공</system:String> <system:String x:Key="success">성공</system:String>
<system:String x:Key="completedSuccessfully">성공적으로 완료했습니다.</system:String> <system:String x:Key="completedSuccessfully">성공적으로 완료했습니다.</system:String>
<system:String x:Key="actionkeyword_tips">액션 키워드를 지정하지 않으려면 *를 사용하세요.</system:String> <system:String x:Key="actionkeyword_tips">플러그인을 시작하는데 필요한 액션 키워드를 입력하세요. 액션 키워드를 지정하지 않으려면 *를 사용하세요. 이 경우 키워드를 입력하지 않아도 동작합니다.</system:String>
<!--Custom Query Hotkey Dialog--> <!-- Custom Query Hotkey Dialog -->
<system:String x:Key="customeQueryHotkeyTitle">커스텀 플러그인 핫키</system:String> <system:String x:Key="customeQueryHotkeyTitle">커스텀 플러그인 핫키</system:String>
<system:String x:Key="customeQueryHotkeyTips">단축키를 지정하여 특정 쿼리를 자동으로 입력할 수 있습니다. 사용하고 싶은 단축키를 눌러 지정한 후, 사용할 쿼리를 입력하세요.</system:String>
<system:String x:Key="preview">미리보기</system:String> <system:String x:Key="preview">미리보기</system:String>
<system:String x:Key="hotkeyIsNotUnavailable">핫키를 사용할 수 없습니다. 다른 핫키를 입력하세요.</system:String> <system:String x:Key="hotkeyIsNotUnavailable">핫키를 사용할 수 없습니다. 다른 핫키를 입력하세요.</system:String>
<system:String x:Key="invalidPluginHotkey">플러그인 핫키가 유효하지 않습니다.</system:String> <system:String x:Key="invalidPluginHotkey">플러그인 핫키가 유효하지 않습니다.</system:String>
<system:String x:Key="update">업데이트</system:String> <system:String x:Key="update">업데이트</system:String>
<!--Hotkey Control--> <!-- Hotkey Control -->
<system:String x:Key="hotkeyUnavailable">핫키를 사용할 수 없습니다.</system:String> <system:String x:Key="hotkeyUnavailable">핫키를 사용할 수 없습니다.</system:String>
<!--Crash Reporter--> <!-- Crash Reporter -->
<system:String x:Key="reportWindow_version">버전</system:String> <system:String x:Key="reportWindow_version">버전</system:String>
<system:String x:Key="reportWindow_time">시간</system:String> <system:String x:Key="reportWindow_time">시간</system:String>
<system:String x:Key="reportWindow_reproduce">수정을 위해 애플리케이션이 어떻게 충돌했는지 알려주세요.</system:String> <system:String x:Key="reportWindow_reproduce">수정을 위해 애플리케이션이 어떻게 충돌했는지 알려주세요.</system:String>
@ -170,17 +205,19 @@
<system:String x:Key="reportWindow_report_succeed">보고서를 정상적으로 보냈습니다.</system:String> <system:String x:Key="reportWindow_report_succeed">보고서를 정상적으로 보냈습니다.</system:String>
<system:String x:Key="reportWindow_report_failed">보고서를 보내지 못했습니다.</system:String> <system:String x:Key="reportWindow_report_failed">보고서를 보내지 못했습니다.</system:String>
<system:String x:Key="reportWindow_flowlauncher_got_an_error">Flow Launcher에 문제가 발생했습니다.</system:String> <system:String x:Key="reportWindow_flowlauncher_got_an_error">Flow Launcher에 문제가 발생했습니다.</system:String>
<!--General Notice--> <!-- General Notice -->
<system:String x:Key="pleaseWait">잠시 기다려주세요...</system:String> <system:String x:Key="pleaseWait">잠시 기다려주세요...</system:String>
<!--update--> <!-- update -->
<system:String x:Key="update_flowlauncher_update_check">새 업데이트 확인 중</system:String> <system:String x:Key="update_flowlauncher_update_check">새 업데이트 확인 중</system:String>
<system:String x:Key="update_flowlauncher_update_new_version_available">새 Flow Launcher 버전({0})을 사용할 수 있습니다.</system:String> <system:String x:Key="update_flowlauncher_update_new_version_available">새 Flow Launcher 버전({0})을 사용할 수 있습니다.</system:String>
<system:String x:Key="update_flowlauncher_already_on_latest">이미 가장 최신 버전의 Flow Launcher를 사용중입니다.</system:String> <system:String x:Key="update_flowlauncher_already_on_latest">이미 가장 최신 버전의 Flow Launcher를 사용중입니다.</system:String>
<system:String x:Key="update_flowlauncher_update_found">업데이트 발견</system:String> <system:String x:Key="update_flowlauncher_update_found">업데이트 발견</system:String>
<system:String x:Key="update_flowlauncher_updating">업데이트 중...</system:String> <system:String x:Key="update_flowlauncher_updating">업데이트 중...</system:String>
<system:String x:Key="update_flowlauncher_fail_moving_portable_user_profile_data">Flow Launcher가 유저 정보 데이터를 새버전으로 옮길 수 없습니다. <system:String x:Key="update_flowlauncher_fail_moving_portable_user_profile_data">
프로필 데이터 폴더를 수동으로 {0} 에서 {1}로 옮겨주세요. </system:String> Flow Launcher가 유저 정보 데이터를 새버전으로 옮길 수 없습니다.
프로필 데이터 폴더를 수동으로 {0} 에서 {1}로 옮겨주세요.
</system:String>
<system:String x:Key="update_flowlauncher_new_update">새 업데이트</system:String> <system:String x:Key="update_flowlauncher_new_update">새 업데이트</system:String>
<system:String x:Key="update_flowlauncher_update_error">소프트웨어 업데이트를 설치하는 중에 오류가 발생했습니다.</system:String> <system:String x:Key="update_flowlauncher_update_error">소프트웨어 업데이트를 설치하는 중에 오류가 발생했습니다.</system:String>
<system:String x:Key="update_flowlauncher_update">업데이트</system:String> <system:String x:Key="update_flowlauncher_update">업데이트</system:String>

View file

@ -1,7 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"> xmlns:system="clr-namespace:System;assembly=mscorlib">
<!--MainWindow--> <!-- MainWindow -->
<system:String x:Key="registerHotkeyFailed">Nepodarilo sa registrovať klávesovú skratku {0}</system:String> <system:String x:Key="registerHotkeyFailed">Nepodarilo sa registrovať klávesovú skratku {0}</system:String>
<system:String x:Key="couldnotStartCmd">Nepodarilo sa spustiť {0}</system:String> <system:String x:Key="couldnotStartCmd">Nepodarilo sa spustiť {0}</system:String>
<system:String x:Key="invalidFlowLauncherPluginFileFormat">Neplatný formát súboru pre plugin Flow Launchera</system:String> <system:String x:Key="invalidFlowLauncherPluginFileFormat">Neplatný formát súboru pre plugin Flow Launchera</system:String>
@ -13,51 +14,66 @@
<system:String x:Key="iconTraySettings">Nastavenia</system:String> <system:String x:Key="iconTraySettings">Nastavenia</system:String>
<system:String x:Key="iconTrayAbout">O aplikácii</system:String> <system:String x:Key="iconTrayAbout">O aplikácii</system:String>
<system:String x:Key="iconTrayExit">Ukončiť</system:String> <system:String x:Key="iconTrayExit">Ukončiť</system:String>
<system:String x:Key="closeWindow">Zavrieť</system:String>
<!--Setting General--> <!-- Setting General -->
<system:String x:Key="flowlauncher_settings">Nastavenia Flow Launchera</system:String> <system:String x:Key="flowlauncher_settings">Nastavenia Flow Launchera</system:String>
<system:String x:Key="general">Všeobecné</system:String> <system:String x:Key="general">Všeobecné</system:String>
<system:String x:Key="portableMode">Prenosný režim</system:String> <system:String x:Key="portableMode">Prenosný režim</system:String>
<system:String x:Key="portableModeToolTIp">Uloží všetky nastavenia a používateľské údaje do jedného priečinka (Užitočné pri vyberateľných diskoch a cloudových službách).</system:String>
<system:String x:Key="startFlowLauncherOnSystemStartup">Spustiť Flow Launcher po štarte systému</system:String> <system:String x:Key="startFlowLauncherOnSystemStartup">Spustiť Flow Launcher po štarte systému</system:String>
<system:String x:Key="hideFlowLauncherWhenLoseFocus">Schovať Flow Launcher po strate fokusu</system:String> <system:String x:Key="hideFlowLauncherWhenLoseFocus">Schovať Flow Launcher po strate fokusu</system:String>
<system:String x:Key="dontPromptUpdateMsg">Nezobrazovať upozornenia na novú verziu</system:String> <system:String x:Key="dontPromptUpdateMsg">Nezobrazovať upozornenia na novú verziu</system:String>
<system:String x:Key="rememberLastLocation">Zapamätať si posledné umiestnenie</system:String> <system:String x:Key="rememberLastLocation">Zapamätať si posledné umiestnenie</system:String>
<system:String x:Key="language">Jazyk</system:String> <system:String x:Key="language">Jazyk</system:String>
<system:String x:Key="lastQueryMode">Posledné vyhľadávanie</system:String> <system:String x:Key="lastQueryMode">Posledné vyhľadávanie</system:String>
<system:String x:Key="lastQueryModeToolTip">Zobrazí/skryje predchádzajúce výsledky pri opätovnej aktivácii Flow Launchera.</system:String>
<system:String x:Key="LastQueryPreserved">Ponechať</system:String> <system:String x:Key="LastQueryPreserved">Ponechať</system:String>
<system:String x:Key="LastQuerySelected">Označiť</system:String> <system:String x:Key="LastQuerySelected">Označiť</system:String>
<system:String x:Key="LastQueryEmpty">Vymazať</system:String> <system:String x:Key="LastQueryEmpty">Vymazať</system:String>
<system:String x:Key="maxShowResults">Max. výsledkov</system:String> <system:String x:Key="maxShowResults">Max. výsledkov</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreen">Ignorovať klávesové skratky v režime na celú obrazovku</system:String> <system:String x:Key="ignoreHotkeysOnFullscreen">Ignorovať klávesové skratky v režime na celú obrazovku</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreenToolTip">Zakázať aktiváciu Flow Launchera, keď je aktívna aplikácia na celú obrazovku (odporúčané pre hry).</system:String>
<system:String x:Key="defaultFileManager">Predvolený správca súborov</system:String>
<system:String x:Key="defaultFileManagerToolTip">Vyberte správcu súborov, ktorý sa má použiť pri otváraní priečinka.</system:String>
<system:String x:Key="pythonDirectory">Priečinok s Pythonom</system:String> <system:String x:Key="pythonDirectory">Priečinok s Pythonom</system:String>
<system:String x:Key="autoUpdates">Automatická aktualizácia</system:String> <system:String x:Key="autoUpdates">Automatická aktualizácia</system:String>
<system:String x:Key="selectPythonDirectory">Vybrať</system:String> <system:String x:Key="selectPythonDirectory">Vybrať</system:String>
<system:String x:Key="hideOnStartup">Schovať Flow Launcher po spustení</system:String> <system:String x:Key="hideOnStartup">Schovať Flow Launcher po spustení</system:String>
<system:String x:Key="hideNotifyIcon">Schovať ikonu z oblasti oznámení</system:String> <system:String x:Key="hideNotifyIcon">Schovať ikonu z oblasti oznámení</system:String>
<system:String x:Key="querySearchPrecision">Presnosť vyhľadávania</system:String> <system:String x:Key="querySearchPrecision">Presnosť vyhľadávania</system:String>
<system:String x:Key="querySearchPrecisionToolTip">Mení minimálne skóre zhody potrebné na zobrazenie výsledkov.</system:String>
<system:String x:Key="ShouldUsePinyin">Použiť Pinyin</system:String> <system:String x:Key="ShouldUsePinyin">Použiť Pinyin</system:String>
<system:String x:Key="ShouldUsePinyinToolTip">Umožňuje vyhľadávanie pomocou Pinyin. Pinyin je štandardný systém romanizovaného pravopisu pre transliteráciu čínštiny</system:String> <system:String x:Key="ShouldUsePinyinToolTip">Umožňuje vyhľadávanie pomocou Pinyin. Pinyin je štandardný systém romanizovaného pravopisu pre transliteráciu čínštiny</system:String>
<system:String x:Key="shadowEffectNotAllowed">Efekt tieňa nie je povolený, kým má aktuálny motív povolený efekt rozostrenia</system:String> <system:String x:Key="shadowEffectNotAllowed">Efekt tieňa nie je povolený, kým má aktuálny motív povolený efekt rozostrenia</system:String>
<!--Setting Plugin--> <!-- Setting Plugin -->
<system:String x:Key="plugin">Plugin</system:String> <system:String x:Key="plugin">Pluginy</system:String>
<system:String x:Key="browserMorePlugins">Nájsť ďalšie pluginy</system:String> <system:String x:Key="browserMorePlugins">Nájsť ďalšie pluginy</system:String>
<system:String x:Key="enable">Povolené</system:String> <system:String x:Key="enable">Zap.</system:String>
<system:String x:Key="disable">Zakázané</system:String> <system:String x:Key="disable">Vyp.</system:String>
<system:String x:Key="actionKeywordsTitle">Nastavenie kľúčového slova akcie</system:String>
<system:String x:Key="actionKeywords">Skratka akcie</system:String> <system:String x:Key="actionKeywords">Skratka akcie</system:String>
<system:String x:Key="currentActionKeywords">Aktuálna akcia skratky:</system:String> <system:String x:Key="currentActionKeywords">Aktuálna akcia skratky:</system:String>
<system:String x:Key="newActionKeyword">Nová akcia skratky:</system:String> <system:String x:Key="newActionKeyword">Nová akcia skratky:</system:String>
<system:String x:Key="currentPriority">Aktuálna priorita:</system:String> <system:String x:Key="currentPriority">Aktuálna priorita:</system:String>
<system:String x:Key="newPriority">Nová priorita:</system:String> <system:String x:Key="newPriority">Nová priorita:</system:String>
<system:String x:Key="priority">Priorita:</system:String> <system:String x:Key="priority">Priorita</system:String>
<system:String x:Key="pluginDirectory">Priečinok s pluginmi</system:String> <system:String x:Key="pluginDirectory">Priečinok s pluginmi</system:String>
<system:String x:Key="author">Autor</system:String> <system:String x:Key="author">Autor:</system:String>
<system:String x:Key="plugin_init_time">Príprava:</system:String> <system:String x:Key="plugin_init_time">Príprava:</system:String>
<system:String x:Key="plugin_query_time">Čas dopytu:</system:String> <system:String x:Key="plugin_query_time">Čas dopytu:</system:String>
<!--Setting Theme--> <!-- Setting Plugin Store -->
<system:String x:Key="pluginStore">Repozitár pluginov</system:String>
<system:String x:Key="refresh">Obnoviť</system:String>
<system:String x:Key="install">Inštalovať</system:String>
<!-- Setting Theme -->
<system:String x:Key="theme">Motív</system:String> <system:String x:Key="theme">Motív</system:String>
<system:String x:Key="browserMoreThemes">Prehliadať viac motívov</system:String> <system:String x:Key="browserMoreThemes">Galéria motívov</system:String>
<system:String x:Key="howToCreateTheme">Ako vytvoriť motív</system:String>
<system:String x:Key="hiThere">Ahojte</system:String> <system:String x:Key="hiThere">Ahojte</system:String>
<system:String x:Key="queryBoxFont">Písmo vyhľadávacieho poľa</system:String> <system:String x:Key="queryBoxFont">Písmo vyhľadávacieho poľa</system:String>
<system:String x:Key="resultItemFont">Písmo výsledkov</system:String> <system:String x:Key="resultItemFont">Písmo výsledkov</system:String>
@ -65,12 +81,17 @@
<system:String x:Key="opacity">Nepriehľadnosť</system:String> <system:String x:Key="opacity">Nepriehľadnosť</system:String>
<system:String x:Key="theme_load_failure_path_not_exists">Motív {0} neexistuje, návrat na predvolený motív</system:String> <system:String x:Key="theme_load_failure_path_not_exists">Motív {0} neexistuje, návrat na predvolený motív</system:String>
<system:String x:Key="theme_load_failure_parse_error">Nepodarilo sa nečítať motív {0}, návrat na predvolený motív</system:String> <system:String x:Key="theme_load_failure_parse_error">Nepodarilo sa nečítať motív {0}, návrat na predvolený motív</system:String>
<system:String x:Key="ThemeFolder">Priečinok s motívmi</system:String>
<system:String x:Key="OpenThemeFolder">Otvoriť priečinok s motívmi</system:String>
<!--Setting Hotkey--> <!-- Setting Hotkey -->
<system:String x:Key="hotkey">Klávesové skratky</system:String> <system:String x:Key="hotkey">Klávesové skratky</system:String>
<system:String x:Key="flowlauncherHotkey">Klávesová skratka pre Flow Launcher</system:String> <system:String x:Key="flowlauncherHotkey">Klávesová skratka pre Flow Launcher</system:String>
<system:String x:Key="openResultModifiers">Modifikáčné klávesy na otvorenie výsledkov</system:String> <system:String x:Key="flowlauncherHotkeyToolTip">Zadajte skratku na zobrazenie/skrytie Flow Launchera.</system:String>
<system:String x:Key="openResultModifiers">Modifikačný kláves na otvorenie výsledkov</system:String>
<system:String x:Key="openResultModifiersToolTip">Vyberte modifikačný kláves na otvorenie vybraného výsledku pomocou klávesnice.</system:String>
<system:String x:Key="showOpenResultHotkey">Zobraziť klávesovú skratku</system:String> <system:String x:Key="showOpenResultHotkey">Zobraziť klávesovú skratku</system:String>
<system:String x:Key="showOpenResultHotkeyToolTip">Zobrazí klávesovú skratku spolu s výsledkami.</system:String>
<system:String x:Key="customQueryHotkey">Vlastná klávesová skratka na vyhľadávanie</system:String> <system:String x:Key="customQueryHotkey">Vlastná klávesová skratka na vyhľadávanie</system:String>
<system:String x:Key="customQuery">Dopyt</system:String> <system:String x:Key="customQuery">Dopyt</system:String>
<system:String x:Key="delete">Odstrániť</system:String> <system:String x:Key="delete">Odstrániť</system:String>
@ -80,15 +101,16 @@
<system:String x:Key="deleteCustomHotkeyWarning">Ste si istý, že chcete odstrániť klávesovú skratku {0} pre plugin?</system:String> <system:String x:Key="deleteCustomHotkeyWarning">Ste si istý, že chcete odstrániť klávesovú skratku {0} pre plugin?</system:String>
<system:String x:Key="queryWindowShadowEffect">Tieňový efekt v poli vyhľadávania</system:String> <system:String x:Key="queryWindowShadowEffect">Tieňový efekt v poli vyhľadávania</system:String>
<system:String x:Key="shadowEffectCPUUsage">Tieňový efekt významne využíva GPU. Neodporúča sa, ak je výkon počítača obmedzený.</system:String> <system:String x:Key="shadowEffectCPUUsage">Tieňový efekt významne využíva GPU. Neodporúča sa, ak je výkon počítača obmedzený.</system:String>
<system:String x:Key="windowWidthSize">Veľkosť šírky okna</system:String>
<system:String x:Key="useGlyphUI">Použiť ikony Segoe Fluent</system:String> <system:String x:Key="useGlyphUI">Použiť ikony Segoe Fluent</system:String>
<system:String x:Key="useGlyphUIEffect">Použiť ikony Segoe Fluent, ak sú podporované</system:String> <system:String x:Key="useGlyphUIEffect">Použiť ikony Segoe Fluent, ak sú podporované</system:String>
<!--Setting Proxy--> <!-- Setting Proxy -->
<system:String x:Key="proxy">HTTP Proxy</system:String> <system:String x:Key="proxy">HTTP Proxy</system:String>
<system:String x:Key="enableProxy">Povoliť HTTP Proxy</system:String> <system:String x:Key="enableProxy">Povoliť HTTP Proxy</system:String>
<system:String x:Key="server">HTTP Server</system:String> <system:String x:Key="server">HTTP Server</system:String>
<system:String x:Key="port">Port</system:String> <system:String x:Key="port">Port</system:String>
<system:String x:Key="userName">Použív. meno</system:String> <system:String x:Key="userName">Používateľské meno</system:String>
<system:String x:Key="password">Heslo</system:String> <system:String x:Key="password">Heslo</system:String>
<system:String x:Key="testProxy">Test Proxy</system:String> <system:String x:Key="testProxy">Test Proxy</system:String>
<system:String x:Key="save">Uložiť</system:String> <system:String x:Key="save">Uložiť</system:String>
@ -99,7 +121,7 @@
<system:String x:Key="proxyIsCorrect">Nastavenie proxy je v poriadku</system:String> <system:String x:Key="proxyIsCorrect">Nastavenie proxy je v poriadku</system:String>
<system:String x:Key="proxyConnectFailed">Pripojenie proxy zlyhalo</system:String> <system:String x:Key="proxyConnectFailed">Pripojenie proxy zlyhalo</system:String>
<!--Setting About--> <!-- Setting About -->
<system:String x:Key="about">O aplikácii</system:String> <system:String x:Key="about">O aplikácii</system:String>
<system:String x:Key="website">Webstránka</system:String> <system:String x:Key="website">Webstránka</system:String>
<system:String x:Key="version">Verzia</system:String> <system:String x:Key="version">Verzia</system:String>
@ -108,17 +130,28 @@
<system:String x:Key="newVersionTips">Je dostupná nová verzia {0}, chcete reštartovať Flow Launcher, aby sa mohol aktualizovať?</system:String> <system:String x:Key="newVersionTips">Je dostupná nová verzia {0}, chcete reštartovať Flow Launcher, aby sa mohol aktualizovať?</system:String>
<system:String x:Key="checkUpdatesFailed">Kontrola aktualizácií zlyhala, prosím, skontrolujte pripojenie na internet a nastavenie proxy k api.github.com.</system:String> <system:String x:Key="checkUpdatesFailed">Kontrola aktualizácií zlyhala, prosím, skontrolujte pripojenie na internet a nastavenie proxy k api.github.com.</system:String>
<system:String x:Key="downloadUpdatesFailed"> <system:String x:Key="downloadUpdatesFailed">
Sťahovanie aktualizácií zlyhalo, skontrolujte pripojenie na internet a nastavenie proxy k github-cloud.s3.amazonaws.com, Sťahovanie aktualizácií zlyhalo, skontrolujte pripojenie na internet a nastavenie proxy k github-cloud.s3.amazonaws.com,
alebo prejdite na https://github.com/Flow-Launcher/Flow.Launcher/releases pre manuálne stiahnutie aktualizácie. alebo prejdite na https://github.com/Flow-Launcher/Flow.Launcher/releases pre manuálne stiahnutie aktualizácie.
</system:String> </system:String>
<system:String x:Key="releaseNotes">Poznámky k vydaniu</system:String> <system:String x:Key="releaseNotes">Poznámky k vydaniu</system:String>
<system:String x:Key="documentation">Tipy na používanie:</system:String> <system:String x:Key="documentation">Tipy na používanie:</system:String>
<!--Priority Setting Dialog--> <!-- FileManager Setting Dialog -->
<system:String x:Key="fileManagerWindow">Vyberte správcu súborov</system:String>
<system:String x:Key="fileManager_tips" >Zadajte umiestnenie súboru správcu súborov, ktorého používate, a v prípade potreby pridajte argumenty. Predvolené argumenty sú &quot;%d&quot; a cesta sa zadáva na tomto mieste. Napríklad, ak sa vyžaduje príkaz, ako napríklad &quot;totalcmd.exe /A c:\windows&quot;, argument je /A &quot;%d&quot;.</system:String>
<system:String x:Key="fileManager_tips2">&quot;%f&quot; je argument, ktorý predstavuje cestu k súboru. Používa sa na zvýraznenie názvu súboru/priečinka pri otváraní konkrétneho umiestnenia súboru v správcovi súborov tretej strany. Tento argument je k dispozícii len v položke &quot;Arg pre súbor&quot;. Ak správca súborov nemá túto funkciu, môžete použiť &quot;%d&quot;.</system:String>
<system:String x:Key="fileManager_name">Správca súborov</system:String>
<system:String x:Key="fileManager_profile_name">Názov profilu</system:String>
<system:String x:Key="fileManager_path">Cesta k správcovi súborov</system:String>
<system:String x:Key="fileManager_directory_arg">Arg. pre priečinok</system:String>
<system:String x:Key="fileManager_file_arg">Arg. pre súbor</system:String>
<!-- Priority Setting Dialog -->
<system:String x:Key="changePriorityWindow">Zmena priority</system:String>
<system:String x:Key="priority_tips">Vyššie číslo znamená, že výsledok bude vyššie. Skúste nastaviť napr. 5. Ak chcete, aby boli výsledky nižšie ako ktorékoľvek iné doplnky, zadajte záporné číslo</system:String> <system:String x:Key="priority_tips">Vyššie číslo znamená, že výsledok bude vyššie. Skúste nastaviť napr. 5. Ak chcete, aby boli výsledky nižšie ako ktorékoľvek iné doplnky, zadajte záporné číslo</system:String>
<system:String x:Key="invalidPriority">Prosím, zadajte platné číslo pre prioritu!</system:String> <system:String x:Key="invalidPriority">Prosím, zadajte platné číslo pre prioritu!</system:String>
<!--Action Keyword Setting Dialog--> <!-- Action Keyword Setting Dialog -->
<system:String x:Key="oldActionKeywords">Stará skratka akcie</system:String> <system:String x:Key="oldActionKeywords">Stará skratka akcie</system:String>
<system:String x:Key="newActionKeywords">Nová skratka akcie</system:String> <system:String x:Key="newActionKeywords">Nová skratka akcie</system:String>
<system:String x:Key="cancel">Zrušiť</system:String> <system:String x:Key="cancel">Zrušiť</system:String>
@ -128,19 +161,20 @@
<system:String x:Key="newActionKeywordsHasBeenAssigned">Nová skratka pre akciu bola priradená pre iný plugin, prosím, zvoľte inú skratku</system:String> <system:String x:Key="newActionKeywordsHasBeenAssigned">Nová skratka pre akciu bola priradená pre iný plugin, prosím, zvoľte inú skratku</system:String>
<system:String x:Key="success">Úspešné</system:String> <system:String x:Key="success">Úspešné</system:String>
<system:String x:Key="completedSuccessfully">Úspešne dokončené</system:String> <system:String x:Key="completedSuccessfully">Úspešne dokončené</system:String>
<system:String x:Key="actionkeyword_tips">Použite * ak nechcete určiť skratku pre akciu</system:String> <system:String x:Key="actionkeyword_tips">Zadajte skratku akcie, ktorá je potrebná na spustenie pluginu. Ak nechcete zadať skratku akcie, použite *. V tom prípade plugin funguje bez kľúčových slov. </system:String>
<!--Custom Query Hotkey Dialog--> <!-- Custom Query Hotkey Dialog -->
<system:String x:Key="customeQueryHotkeyTitle">Vlastná klávesová skratka pre plugin</system:String> <system:String x:Key="customeQueryHotkeyTitle">Klávesová skratka pre vlastné vyhľadávanie</system:String>
<system:String x:Key="customeQueryHotkeyTips">Stlačením klávesovej skratky sa automaticky vloží zadaný výraz.</system:String>
<system:String x:Key="preview">Náhľad</system:String> <system:String x:Key="preview">Náhľad</system:String>
<system:String x:Key="hotkeyIsNotUnavailable">Klávesová skratka je nedostupná, prosím, zadajte novú</system:String> <system:String x:Key="hotkeyIsNotUnavailable">Klávesová skratka je nedostupná, prosím, zadajte novú</system:String>
<system:String x:Key="invalidPluginHotkey">Neplatná klávesová skratka pluginu</system:String> <system:String x:Key="invalidPluginHotkey">Neplatná klávesová skratka pluginu</system:String>
<system:String x:Key="update">Aktualizovať</system:String> <system:String x:Key="update">Aktualizovať</system:String>
<!--Hotkey Control--> <!-- Hotkey Control -->
<system:String x:Key="hotkeyUnavailable">Klávesová skratka nedostupná</system:String> <system:String x:Key="hotkeyUnavailable">Klávesová skratka nedostupná</system:String>
<!--Crash Reporter--> <!-- Crash Reporter -->
<system:String x:Key="reportWindow_version">Verzia</system:String> <system:String x:Key="reportWindow_version">Verzia</system:String>
<system:String x:Key="reportWindow_time">Čas</system:String> <system:String x:Key="reportWindow_time">Čas</system:String>
<system:String x:Key="reportWindow_reproduce">Prosím, napíšte nám, ako došlo k pádu aplikácie, aby sme to mohli opraviť</system:String> <system:String x:Key="reportWindow_reproduce">Prosím, napíšte nám, ako došlo k pádu aplikácie, aby sme to mohli opraviť</system:String>
@ -156,16 +190,18 @@
<system:String x:Key="reportWindow_report_failed">Odoslanie hlásenia zlyhalo</system:String> <system:String x:Key="reportWindow_report_failed">Odoslanie hlásenia zlyhalo</system:String>
<system:String x:Key="reportWindow_flowlauncher_got_an_error">Flow Launcher zaznamenal chybu</system:String> <system:String x:Key="reportWindow_flowlauncher_got_an_error">Flow Launcher zaznamenal chybu</system:String>
<!--General Notice--> <!-- General Notice -->
<system:String x:Key="pleaseWait">Čakajte, prosím…</system:String> <system:String x:Key="pleaseWait">Čakajte, prosím…</system:String>
<!--update--> <!-- update -->
<system:String x:Key="update_flowlauncher_update_check">Kontrolujú sa akutalizácie</system:String> <system:String x:Key="update_flowlauncher_update_check">Kontrolujú sa aktualizácie</system:String>
<system:String x:Key="update_flowlauncher_already_on_latest">Už máte najnovšiu verizu Flow Launchera</system:String> <system:String x:Key="update_flowlauncher_already_on_latest">Už máte najnovšiu verziu Flow Launchera</system:String>
<system:String x:Key="update_flowlauncher_update_found">Bola nájdená aktualizácia</system:String> <system:String x:Key="update_flowlauncher_update_found">Bola nájdená aktualizácia</system:String>
<system:String x:Key="update_flowlauncher_updating">Aktualizuje sa…</system:String> <system:String x:Key="update_flowlauncher_updating">Aktualizuje sa…</system:String>
<system:String x:Key="update_flowlauncher_fail_moving_portable_user_profile_data">Flow Launcher nedokázal presunúť používateľské údaje do aktualizovanej verzie. <system:String x:Key="update_flowlauncher_fail_moving_portable_user_profile_data">
Prosím, presuňte profilový priečinok data z {0} do {1}</system:String> Flow Launcher nedokázal presunúť používateľské údaje do aktualizovanej verzie.
Prosím, presuňte profilový priečinok data z {0} do {1}
</system:String>
<system:String x:Key="update_flowlauncher_new_update">Nová aktualizácia</system:String> <system:String x:Key="update_flowlauncher_new_update">Nová aktualizácia</system:String>
<system:String x:Key="update_flowlauncher_update_new_version_available">Je dostupná nová verzia Flow Launchera {0}</system:String> <system:String x:Key="update_flowlauncher_update_new_version_available">Je dostupná nová verzia Flow Launchera {0}</system:String>
<system:String x:Key="update_flowlauncher_update_error">Počas inštalácie aktualizácií došlo k chybe</system:String> <system:String x:Key="update_flowlauncher_update_error">Počas inštalácie aktualizácií došlo k chybe</system:String>

View file

@ -1,149 +1,284 @@
<Window x:Class="Flow.Launcher.MainWindow" <Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="Flow.Launcher.MainWindow"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:flowlauncher="clr-namespace:Flow.Launcher" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel" xmlns:converters="clr-namespace:Flow.Launcher.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:flowlauncher="clr-namespace:Flow.Launcher"
xmlns:converters="clr-namespace:Flow.Launcher.Converters" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/" xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
mc:Ignorable="d" xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
Title="Flow Launcher" Name="FlowMainWindow"
Topmost="True" Title="Flow Launcher"
SizeToContent="Height" MinWidth="{Binding MainWindowWidth, Mode=OneWay}"
ResizeMode="NoResize" MaxWidth="{Binding MainWindowWidth, Mode=OneWay}"
WindowStyle="None" d:DataContext="{d:DesignInstance vm:MainViewModel}"
WindowStartupLocation="Manual" AllowDrop="True"
AllowDrop="True" AllowsTransparency="True"
ShowInTaskbar="False" Background="Transparent"
Style="{DynamicResource WindowStyle}" Closing="OnClosing"
Icon="Images/app.png" Deactivated="OnDeactivated"
AllowsTransparency="True" Icon="Images/app.png"
Background="Transparent" Initialized="OnInitialized"
Loaded="OnLoaded" Loaded="OnLoaded"
Initialized="OnInitialized" LocationChanged="OnLocationChanged"
Closing="OnClosing" Opacity="{Binding MainWindowOpacity, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
LocationChanged="OnLocationChanged" PreviewKeyDown="OnKeyDown"
Deactivated="OnDeactivated" ResizeMode="NoResize"
PreviewKeyDown="OnKeyDown" ShowInTaskbar="False"
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SizeToContent="Height"
d:DataContext="{d:DesignInstance vm:MainViewModel}"> Style="{DynamicResource WindowStyle}"
Topmost="True"
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
WindowStartupLocation="Manual"
WindowStyle="None"
mc:Ignorable="d">
<Window.Resources> <Window.Resources>
<converters:QuerySuggestionBoxConverter x:Key="QuerySuggestionBoxConverter"/> <converters:QuerySuggestionBoxConverter x:Key="QuerySuggestionBoxConverter" />
<converters:BorderClipConverter x:Key="BorderClipConverter"/> <converters:BorderClipConverter x:Key="BorderClipConverter" />
</Window.Resources> </Window.Resources>
<Window.InputBindings> <Window.InputBindings>
<KeyBinding Key="Escape" Command="{Binding EscCommand}"></KeyBinding> <KeyBinding Key="Escape" Command="{Binding EscCommand}" />
<KeyBinding Key="F1" Command="{Binding StartHelpCommand}"></KeyBinding> <KeyBinding Key="F1" Command="{Binding StartHelpCommand}" />
<KeyBinding Key="F5" Command="{Binding ReloadPluginDataCommand}"></KeyBinding> <KeyBinding Key="F5" Command="{Binding ReloadPluginDataCommand}" />
<KeyBinding Key="Tab" Command="{Binding SelectNextItemCommand}"></KeyBinding> <KeyBinding Key="Tab" Command="{Binding SelectNextItemCommand}" />
<KeyBinding Key="Tab" Modifiers="Shift" Command="{Binding SelectPrevItemCommand}"></KeyBinding> <KeyBinding
<KeyBinding Key="N" Modifiers="Ctrl" Command="{Binding SelectNextItemCommand}"></KeyBinding> Key="Tab"
<KeyBinding Key="J" Modifiers="Ctrl" Command="{Binding SelectNextItemCommand}"></KeyBinding> Command="{Binding SelectPrevItemCommand}"
<KeyBinding Key="D" Modifiers="Ctrl" Command="{Binding SelectNextPageCommand}"></KeyBinding> Modifiers="Shift" />
<KeyBinding Key="P" Modifiers="Ctrl" Command="{Binding SelectPrevItemCommand}"></KeyBinding> <KeyBinding
<KeyBinding Key="K" Modifiers="Ctrl" Command="{Binding SelectPrevItemCommand}"></KeyBinding> Key="I"
<KeyBinding Key="U" Modifiers="Ctrl" Command="{Binding SelectPrevPageCommand}"></KeyBinding> Command="{Binding OpenSettingCommand}"
<KeyBinding Key="Home" Modifiers="Alt" Command="{Binding SelectFirstResultCommand}"></KeyBinding> Modifiers="Ctrl" />
<KeyBinding Key="O" Modifiers="Ctrl" Command="{Binding LoadContextMenuCommand}"></KeyBinding> <KeyBinding
<KeyBinding Key="Right" Command="{Binding LoadContextMenuCommand}"></KeyBinding> Key="N"
<KeyBinding Key="Left" Command="{Binding EscCommand}"></KeyBinding> Command="{Binding SelectNextItemCommand}"
<KeyBinding Key="H" Modifiers="Ctrl" Command="{Binding LoadHistoryCommand}"></KeyBinding> Modifiers="Ctrl" />
<KeyBinding Key="Enter" Modifiers="Ctrl+Shift" Command="{Binding OpenResultCommand}"></KeyBinding> <KeyBinding
<KeyBinding Key="Enter" Modifiers="Shift" Command="{Binding LoadContextMenuCommand}"></KeyBinding> Key="J"
<KeyBinding Key="Enter" Command="{Binding OpenResultCommand}"></KeyBinding> Command="{Binding SelectNextItemCommand}"
<KeyBinding Key="Enter" Modifiers="Ctrl" Command="{Binding OpenResultCommand}"></KeyBinding> Modifiers="Ctrl" />
<KeyBinding Key="Enter" Modifiers="Alt" Command="{Binding OpenResultCommand}"></KeyBinding> <KeyBinding
<KeyBinding Key="D1" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="0"></KeyBinding> Key="D"
<KeyBinding Key="D2" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="1"></KeyBinding> Command="{Binding SelectNextPageCommand}"
<KeyBinding Key="D3" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="2"></KeyBinding> Modifiers="Ctrl" />
<KeyBinding Key="D4" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="3"></KeyBinding> <KeyBinding
<KeyBinding Key="D5" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="4"></KeyBinding> Key="P"
<KeyBinding Key="D6" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="5"></KeyBinding> Command="{Binding SelectPrevItemCommand}"
<KeyBinding Key="D7" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="6"></KeyBinding> Modifiers="Ctrl" />
<KeyBinding Key="D8" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="7"></KeyBinding> <KeyBinding
<KeyBinding Key="D9" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="8"></KeyBinding> Key="K"
Command="{Binding SelectPrevItemCommand}"
Modifiers="Ctrl" />
<KeyBinding
Key="U"
Command="{Binding SelectPrevPageCommand}"
Modifiers="Ctrl" />
<KeyBinding
Key="Home"
Command="{Binding SelectFirstResultCommand}"
Modifiers="Alt" />
<KeyBinding
Key="O"
Command="{Binding LoadContextMenuCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="Right" Command="{Binding LoadContextMenuCommand}" />
<KeyBinding Key="Left" Command="{Binding EscCommand}" />
<KeyBinding
Key="H"
Command="{Binding LoadHistoryCommand}"
Modifiers="Ctrl" />
<KeyBinding
Key="Enter"
Command="{Binding OpenResultCommand}"
Modifiers="Ctrl+Shift" />
<KeyBinding
Key="Enter"
Command="{Binding LoadContextMenuCommand}"
Modifiers="Shift" />
<KeyBinding Key="Enter" Command="{Binding OpenResultCommand}" />
<KeyBinding
Key="Enter"
Command="{Binding OpenResultCommand}"
Modifiers="Ctrl" />
<KeyBinding
Key="Enter"
Command="{Binding OpenResultCommand}"
Modifiers="Alt" />
<KeyBinding
Key="D1"
Command="{Binding OpenResultCommand}"
CommandParameter="0"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D2"
Command="{Binding OpenResultCommand}"
CommandParameter="1"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D3"
Command="{Binding OpenResultCommand}"
CommandParameter="2"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D4"
Command="{Binding OpenResultCommand}"
CommandParameter="3"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D5"
Command="{Binding OpenResultCommand}"
CommandParameter="4"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D6"
Command="{Binding OpenResultCommand}"
CommandParameter="5"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D7"
Command="{Binding OpenResultCommand}"
CommandParameter="6"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D8"
Command="{Binding OpenResultCommand}"
CommandParameter="7"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D9"
Command="{Binding OpenResultCommand}"
CommandParameter="8"
Modifiers="{Binding OpenResultCommandModifiers}" />
</Window.InputBindings> </Window.InputBindings>
<Grid> <Grid>
<Border Style="{DynamicResource WindowBorderStyle}" MouseDown="OnMouseDown"> <Border MouseDown="OnMouseDown" Style="{DynamicResource WindowBorderStyle}">
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Vertical">
<Grid> <Grid>
<TextBox x:Name="QueryTextSuggestionBox" <TextBox
Style="{DynamicResource QuerySuggestionBoxStyle}" x:Name="QueryTextSuggestionBox"
IsEnabled="False"> IsEnabled="False"
Style="{DynamicResource QuerySuggestionBoxStyle}">
<TextBox.Text> <TextBox.Text>
<MultiBinding Converter="{StaticResource QuerySuggestionBoxConverter}"> <MultiBinding Converter="{StaticResource QuerySuggestionBoxConverter}">
<Binding ElementName="QueryTextBox" Path="Text"/> <Binding ElementName="QueryTextBox" Path="Text" />
<Binding ElementName="ResultListBox" Path="SelectedItem"/> <Binding ElementName="ResultListBox" Path="SelectedItem" />
</MultiBinding> </MultiBinding>
</TextBox.Text> </TextBox.Text>
</TextBox> </TextBox>
<TextBox x:Name="QueryTextBox" <TextBox
Style="{DynamicResource QueryBoxStyle}" x:Name="QueryTextBox"
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" AllowDrop="True"
PreviewDragOver="OnPreviewDragOver" Background="Transparent"
AllowDrop="True" PreviewDragOver="OnPreviewDragOver"
Visibility="Visible" Style="{DynamicResource QueryBoxStyle}"
Background="Transparent"> Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Visibility="Visible">
<TextBox.ContextMenu> <TextBox.ContextMenu>
<ContextMenu> <ContextMenu>
<MenuItem Command="ApplicationCommands.Cut"/> <MenuItem Command="ApplicationCommands.Cut" />
<MenuItem Command="ApplicationCommands.Copy"/> <MenuItem Command="ApplicationCommands.Copy" />
<MenuItem Command="ApplicationCommands.Paste"/> <MenuItem Command="ApplicationCommands.Paste" />
<Separator /> <Separator
<MenuItem Header="{DynamicResource flowlauncher_settings}" Click="OnContextMenusForSettingsClick" /> Margin="0"
<MenuItem Command="{Binding EscCommand}" Header="{DynamicResource closeWindow}"/> Padding="0,4,0,4"
Background="{DynamicResource ContextSeparator}" />
<MenuItem Click="OnContextMenusForSettingsClick" Header="{DynamicResource flowlauncher_settings}" />
<MenuItem Command="{Binding EscCommand}" Header="{DynamicResource closeWindow}" />
</ContextMenu> </ContextMenu>
</TextBox.ContextMenu> </TextBox.ContextMenu>
</TextBox> </TextBox>
<Canvas Style="{DynamicResource SearchIconPosition}"> <Canvas Style="{DynamicResource SearchIconPosition}">
<Path Data="{DynamicResource SearchIconImg}" Style="{DynamicResource SearchIconStyle}" Margin="0" Stretch="Fill"/> <Path
Name="SearchIcon"
Margin="0"
Data="{DynamicResource SearchIconImg}"
Stretch="Fill"
Style="{DynamicResource SearchIconStyle}" />
</Canvas> </Canvas>
</Grid> </Grid>
<Grid ClipToBounds="True"> <Grid ClipToBounds="True">
<Rectangle Width="Auto" HorizontalAlignment="Stretch" Style="{DynamicResource SeparatorStyle}" /> <ContentControl>
<Line x:Name="ProgressBar" HorizontalAlignment="Right" <ContentControl.Style>
Style="{DynamicResource PendingLineStyle}" Visibility="{Binding ProgressBarVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" <Style TargetType="ContentControl">
Y1="0" Y2="0" X1="-150" X2="-50" Height="2" Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}},Path=ActualWidth}" StrokeThickness="1"> <Setter Property="Visibility" Value="Collapsed" />
</Line> <Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ResultListBox, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=ContextMenu, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=History, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
<Rectangle
Width="Auto"
HorizontalAlignment="Stretch"
Style="{DynamicResource SeparatorStyle}" />
</ContentControl>
<Line
x:Name="ProgressBar"
Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=ActualWidth}"
Height="2"
HorizontalAlignment="Right"
StrokeThickness="1"
Style="{DynamicResource PendingLineStyle}"
Visibility="{Binding ProgressBarVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
X1="-150"
X2="-50"
Y1="0"
Y2="0" />
</Grid> </Grid>
<Border Style="{DynamicResource WindowRadius}"> <Border Style="{DynamicResource WindowRadius}">
<Border.Clip> <Border.Clip>
<MultiBinding Converter="{StaticResource BorderClipConverter}"> <MultiBinding Converter="{StaticResource BorderClipConverter}">
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/> <Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/> <Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}"/> <Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
</MultiBinding> </MultiBinding>
</Border.Clip> </Border.Clip>
<ContentControl> <ContentControl>
<flowlauncher:ResultListBox x:Name="ResultListBox" DataContext="{Binding Results}" PreviewMouseDown="OnPreviewMouseButtonDown" /> <flowlauncher:ResultListBox
x:Name="ResultListBox"
DataContext="{Binding Results}"
PreviewMouseDown="OnPreviewMouseButtonDown" />
</ContentControl> </ContentControl>
</Border> </Border>
<Border Style="{DynamicResource WindowRadius}"> <Border Style="{DynamicResource WindowRadius}">
<Border.Clip> <Border.Clip>
<MultiBinding Converter="{StaticResource BorderClipConverter}"> <MultiBinding Converter="{StaticResource BorderClipConverter}">
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/> <Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/> <Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}"/> <Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
</MultiBinding> </MultiBinding>
</Border.Clip> </Border.Clip>
<ContentControl> <ContentControl>
<flowlauncher:ResultListBox DataContext="{Binding ContextMenu}" PreviewMouseDown="OnPreviewMouseButtonDown" x:Name="ContextMenu"/> <flowlauncher:ResultListBox
</ContentControl> x:Name="ContextMenu"
DataContext="{Binding ContextMenu}"
PreviewMouseDown="OnPreviewMouseButtonDown" />
</ContentControl>
</Border> </Border>
<Border Style="{DynamicResource WindowRadius}"> <Border Style="{DynamicResource WindowRadius}">
<Border.Clip> <Border.Clip>
<MultiBinding Converter="{StaticResource BorderClipConverter}"> <MultiBinding Converter="{StaticResource BorderClipConverter}">
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/> <Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/> <Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}"/> <Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
</MultiBinding> </MultiBinding>
</Border.Clip> </Border.Clip>
<ContentControl> <ContentControl>
<flowlauncher:ResultListBox DataContext="{Binding History}" PreviewMouseDown="OnPreviewMouseButtonDown" x:Name="History"/> <flowlauncher:ResultListBox
</ContentControl> x:Name="History"
DataContext="{Binding History}"
PreviewMouseDown="OnPreviewMouseButtonDown" />
</ContentControl>
</Border> </Border>
</StackPanel> </StackPanel>
</Border> </Border>

View file

@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
@ -11,14 +11,12 @@ using Flow.Launcher.Core.Resource;
using Flow.Launcher.Helper; using Flow.Launcher.Helper;
using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using Application = System.Windows.Application;
using Screen = System.Windows.Forms.Screen; using Screen = System.Windows.Forms.Screen;
using ContextMenuStrip = System.Windows.Forms.ContextMenuStrip; using ContextMenuStrip = System.Windows.Forms.ContextMenuStrip;
using DataFormats = System.Windows.DataFormats;
using DragEventArgs = System.Windows.DragEventArgs; using DragEventArgs = System.Windows.DragEventArgs;
using KeyEventArgs = System.Windows.Input.KeyEventArgs; using KeyEventArgs = System.Windows.Input.KeyEventArgs;
using MessageBox = System.Windows.MessageBox;
using NotifyIcon = System.Windows.Forms.NotifyIcon; using NotifyIcon = System.Windows.Forms.NotifyIcon;
using Flow.Launcher.Infrastructure;
namespace Flow.Launcher namespace Flow.Launcher
{ {
@ -30,7 +28,9 @@ namespace Flow.Launcher
private bool isProgressBarStoryboardPaused; private bool isProgressBarStoryboardPaused;
private Settings _settings; private Settings _settings;
private NotifyIcon _notifyIcon; private NotifyIcon _notifyIcon;
private ContextMenu contextMenu;
private MainViewModel _viewModel; private MainViewModel _viewModel;
private bool _animating;
#endregion #endregion
@ -40,6 +40,7 @@ namespace Flow.Launcher
_viewModel = mainVM; _viewModel = mainVM;
_settings = settings; _settings = settings;
InitializeComponent(); InitializeComponent();
InitializePosition();
} }
public MainWindow() public MainWindow()
@ -49,11 +50,13 @@ namespace Flow.Launcher
private async void OnClosing(object sender, CancelEventArgs e) private async void OnClosing(object sender, CancelEventArgs e)
{ {
_settings.WindowTop = Top;
_settings.WindowLeft = Left;
_notifyIcon.Visible = false; _notifyIcon.Visible = false;
_viewModel.Save(); _viewModel.Save();
e.Cancel = true; e.Cancel = true;
await PluginManager.DisposePluginsAsync(); await PluginManager.DisposePluginsAsync();
Application.Current.Shutdown(); Environment.Exit(0);
} }
private void OnInitialized(object sender, EventArgs e) private void OnInitialized(object sender, EventArgs e)
@ -62,12 +65,12 @@ namespace Flow.Launcher
private void OnLoaded(object sender, RoutedEventArgs _) private void OnLoaded(object sender, RoutedEventArgs _)
{ {
HideStartup();
// show notify icon when flowlauncher is hidden // show notify icon when flowlauncher is hidden
InitializeNotifyIcon(); InitializeNotifyIcon();
InitializeColorScheme();
WindowsInteropHelper.DisableControlBox(this); WindowsInteropHelper.DisableControlBox(this);
InitProgressbarAnimation(); InitProgressbarAnimation();
InitializePosition();
// since the default main window visibility is visible // since the default main window visibility is visible
// so we need set focus during startup // so we need set focus during startup
QueryTextBox.Focus(); QueryTextBox.Focus();
@ -76,13 +79,13 @@ namespace Flow.Launcher
{ {
switch (e.PropertyName) switch (e.PropertyName)
{ {
case nameof(MainViewModel.MainWindowVisibility): case nameof(MainViewModel.MainWindowVisibilityStatus):
{ {
if (_viewModel.MainWindowVisibility == Visibility.Visible) if (_viewModel.MainWindowVisibilityStatus)
{ {
UpdatePosition();
Activate(); Activate();
QueryTextBox.Focus(); QueryTextBox.Focus();
UpdatePosition();
_settings.ActivateTimes++; _settings.ActivateTimes++;
if (!_viewModel.LastQuerySelected) if (!_viewModel.LastQuerySelected)
{ {
@ -114,7 +117,7 @@ namespace Flow.Launcher
_progressBarStoryboard.Stop(ProgressBar); _progressBarStoryboard.Stop(ProgressBar);
isProgressBarStoryboardPaused = true; isProgressBarStoryboardPaused = true;
} }
else if (_viewModel.MainWindowVisibility == Visibility.Visible && else if (_viewModel.MainWindowVisibilityStatus &&
isProgressBarStoryboardPaused) isProgressBarStoryboardPaused)
{ {
_progressBarStoryboard.Begin(ProgressBar, true); _progressBarStoryboard.Begin(ProgressBar, true);
@ -145,28 +148,29 @@ namespace Flow.Launcher
break; break;
} }
}; };
InitializePosition();
} }
private void InitializePosition() private void InitializePosition()
{ {
Top = WindowTop(); if (_settings.RememberLastLaunchLocation)
Left = WindowLeft(); {
_settings.WindowTop = Top; Top = _settings.WindowTop;
_settings.WindowLeft = Left; Left = _settings.WindowLeft;
}
else
{
Left = WindowLeft();
Top = WindowTop();
}
} }
private void UpdateNotifyIconText() private void UpdateNotifyIconText()
{ {
var menu = _notifyIcon.ContextMenuStrip; var menu = contextMenu;
var open = menu.Items[0]; ((MenuItem)menu.Items[1]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen");
var setting = menu.Items[1]; ((MenuItem)menu.Items[2]).Header = InternationalizationManager.Instance.GetTranslation("GameMode");
var exit = menu.Items[2]; ((MenuItem)menu.Items[3]).Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings");
((MenuItem)menu.Items[4]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit");
open.Text = InternationalizationManager.Instance.GetTranslation("iconTrayOpen");
setting.Text = InternationalizationManager.Instance.GetTranslation("iconTraySettings");
exit.Text = InternationalizationManager.Instance.GetTranslation("iconTrayExit");
} }
private void InitializeNotifyIcon() private void InitializeNotifyIcon()
@ -177,34 +181,70 @@ namespace Flow.Launcher
Icon = Properties.Resources.app, Icon = Properties.Resources.app,
Visible = !_settings.HideNotifyIcon Visible = !_settings.HideNotifyIcon
}; };
var menu = new ContextMenuStrip(); contextMenu = new ContextMenu();
var items = menu.Items;
var open = items.Add(InternationalizationManager.Instance.GetTranslation("iconTrayOpen")); var header = new MenuItem
open.Click += (o, e) => Visibility = Visibility.Visible; {
var setting = items.Add(InternationalizationManager.Instance.GetTranslation("iconTraySettings")); Header = "Flow Launcher",
setting.Click += (o, e) => App.API.OpenSettingDialog(); IsEnabled = false
var exit = items.Add(InternationalizationManager.Instance.GetTranslation("iconTrayExit")); };
var open = new MenuItem
{
Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen")
};
var gamemode = new MenuItem
{
Header = InternationalizationManager.Instance.GetTranslation("GameMode")
};
var settings = new MenuItem
{
Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings")
};
var exit = new MenuItem
{
Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit")
};
open.Click += (o, e) => _viewModel.ToggleFlowLauncher();
gamemode.Click += (o, e) => ToggleGameMode();
settings.Click += (o, e) => App.API.OpenSettingDialog();
exit.Click += (o, e) => Close(); exit.Click += (o, e) => Close();
contextMenu.Items.Add(header);
contextMenu.Items.Add(open);
gamemode.ToolTip = InternationalizationManager.Instance.GetTranslation("GameModeToolTip");
contextMenu.Items.Add(gamemode);
contextMenu.Items.Add(settings);
contextMenu.Items.Add(exit);
_notifyIcon.ContextMenuStrip = menu; _notifyIcon.ContextMenuStrip = new ContextMenuStrip(); // it need for close the context menu. if not, context menu can't close.
_notifyIcon.MouseClick += (o, e) => _notifyIcon.MouseClick += (o, e) =>
{ {
if (e.Button == MouseButtons.Left) switch (e.Button)
{ {
if (menu.Visible) case MouseButtons.Left:
{ _viewModel.ToggleFlowLauncher();
menu.Close(); break;
}
else case MouseButtons.Right:
{ contextMenu.IsOpen = true;
var p = System.Windows.Forms.Cursor.Position; break;
menu.Show(p);
}
} }
}; };
} }
private void ToggleGameMode()
{
if (_viewModel.GameModeStatus)
{
_notifyIcon.Icon = Properties.Resources.app;
_viewModel.GameModeStatus = false;
}
else
{
_notifyIcon.Icon = Properties.Resources.gamemode;
_viewModel.GameModeStatus = true;
}
}
private void InitProgressbarAnimation() private void InitProgressbarAnimation()
{ {
var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 150, var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 150,
@ -220,6 +260,54 @@ namespace Flow.Launcher
isProgressBarStoryboardPaused = true; isProgressBarStoryboardPaused = true;
} }
public void WindowAnimator()
{
if (_animating)
return;
_animating = true;
UpdatePosition();
Storyboard sb = new Storyboard();
Storyboard iconsb = new Storyboard();
CircleEase easing = new CircleEase(); // or whatever easing class you want
easing.EasingMode = EasingMode.EaseInOut;
var da = new DoubleAnimation
{
From = 0,
To = 1,
Duration = TimeSpan.FromSeconds(0.25),
FillBehavior = FillBehavior.Stop
};
var da2 = new DoubleAnimation
{
From = Top + 10,
To = Top,
Duration = TimeSpan.FromSeconds(0.25),
FillBehavior = FillBehavior.Stop
};
var da3 = new DoubleAnimation
{
From = 12,
To = 0,
EasingFunction = easing,
Duration = TimeSpan.FromSeconds(0.36),
FillBehavior = FillBehavior.Stop
};
Storyboard.SetTarget(da, this);
Storyboard.SetTargetProperty(da, new PropertyPath(Window.OpacityProperty));
Storyboard.SetTargetProperty(da2, new PropertyPath(Window.TopProperty));
Storyboard.SetTargetProperty(da3, new PropertyPath(TopProperty));
sb.Children.Add(da);
sb.Children.Add(da2);
iconsb.Children.Add(da3);
sb.Completed += (_, _) => _animating = false;
_settings.WindowLeft = Left;
_settings.WindowTop = Top;
iconsb.Begin(SearchIcon);
sb.Begin(FlowMainWindow);
}
private void OnMouseDown(object sender, MouseButtonEventArgs e) private void OnMouseDown(object sender, MouseButtonEventArgs e)
{ {
if (e.ChangedButton == MouseButton.Left) DragMove(); if (e.ChangedButton == MouseButton.Left) DragMove();
@ -252,22 +340,41 @@ namespace Flow.Launcher
e.Handled = true; e.Handled = true;
} }
private void OnContextMenusForSettingsClick(object sender, RoutedEventArgs e) private async void OnContextMenusForSettingsClick(object sender, RoutedEventArgs e)
{ {
_viewModel.Hide();
if(_settings.UseAnimation)
await Task.Delay(100);
App.API.OpenSettingDialog(); App.API.OpenSettingDialog();
} }
private void OnDeactivated(object sender, EventArgs e) private async void OnDeactivated(object sender, EventArgs e)
{ {
if (_settings.HideWhenDeactive) //This condition stops extra hide call when animator is on,
// which causes the toggling to occasional hide instead of show.
if (_viewModel.MainWindowVisibilityStatus)
{ {
_viewModel.Hide(); // Need time to initialize the main query window animation.
// This also stops the mainwindow from flickering occasionally after Settings window is opened
// and always after Settings window is closed.
if (_settings.UseAnimation)
await Task.Delay(100);
if (_settings.HideWhenDeactive)
{
_viewModel.Hide();
}
} }
} }
private void UpdatePosition() private void UpdatePosition()
{ {
if (_animating)
return;
if (_settings.RememberLastLaunchLocation) if (_settings.RememberLastLaunchLocation)
{ {
Left = _settings.WindowLeft; Left = _settings.WindowLeft;
@ -282,6 +389,8 @@ namespace Flow.Launcher
private void OnLocationChanged(object sender, EventArgs e) private void OnLocationChanged(object sender, EventArgs e)
{ {
if (_animating)
return;
if (_settings.RememberLastLaunchLocation) if (_settings.RememberLastLaunchLocation)
{ {
_settings.WindowLeft = Left; _settings.WindowLeft = Left;
@ -289,7 +398,20 @@ namespace Flow.Launcher
} }
} }
private double WindowLeft() public void HideStartup()
{
UpdatePosition();
if (_settings.HideOnStartup)
{
_viewModel.Hide();
}
else
{
_viewModel.Show();
}
}
public double WindowLeft()
{ {
var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position); var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position);
var dip1 = WindowsInteropHelper.TransformPixelsToDIP(this, screen.WorkingArea.X, 0); var dip1 = WindowsInteropHelper.TransformPixelsToDIP(this, screen.WorkingArea.X, 0);
@ -298,7 +420,7 @@ namespace Flow.Launcher
return left; return left;
} }
private double WindowTop() public double WindowTop()
{ {
var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position); var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position);
var dip1 = WindowsInteropHelper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Y); var dip1 = WindowsInteropHelper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Y);
@ -357,5 +479,17 @@ namespace Flow.Launcher
{ {
QueryTextBox.CaretIndex = QueryTextBox.Text.Length; QueryTextBox.CaretIndex = QueryTextBox.Text.Length;
} }
public void InitializeColorScheme()
{
if (_settings.ColorScheme == Constant.Light)
{
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Light;
}
else if (_settings.ColorScheme == Constant.Dark)
{
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Dark;
}
}
} }
} }

View file

@ -11,8 +11,8 @@ namespace Flow.Launcher
[System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>")]
public static void Show(string title, string subTitle, string iconPath) public static void Show(string title, string subTitle, string iconPath)
{ {
var legacy = Environment.OSVersion.Version.Major < 10; var legacy = Environment.OSVersion.Version.Build < 19041;
// Handle notification for win7/8 // Handle notification for win7/8/early win10
if (legacy) if (legacy)
{ {
LegacyShow(title, subTitle, iconPath); LegacyShow(title, subTitle, iconPath);

View file

@ -1,59 +1,124 @@
<Window x:Class="Flow.Launcher.PriorityChangeWindow" <Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="Flow.Launcher.PriorityChangeWindow"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher" xmlns:local="clr-namespace:Flow.Launcher"
Loaded="PriorityChangeWindow_Loaded" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" xmlns:ui="http://schemas.modernwpf.com/2019"
WindowStartupLocation="CenterScreen" Title="{DynamicResource changePriorityWindow}"
Title="{DynamicResource changePriorityWindow}" Height="400" Width="350" ResizeMode="NoResize" Background="#f3f3f3"> Width="350"
Background="{DynamicResource PopuBGColor}"
Foreground="{DynamicResource PopupTextColor}"
Loaded="PriorityChangeWindow_Loaded"
MouseDown="window_MouseDown"
ResizeMode="NoResize"
SizeToContent="Height"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
</WindowChrome.WindowChrome>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition />
<RowDefinition /> <RowDefinition Height="80" />
<RowDefinition />
<RowDefinition Height="80"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" VerticalAlignment="Center">
<TextBlock Grid.Column="0" FontFamily="/Resources/#Segoe Fluent Icons" FontSize="40" TextAlignment="Center"
Margin="0 0 0 0">
&#xe8d0;
</TextBlock>
</StackPanel>
<Border Background="#ffffff" Grid.Row="1" BorderBrush="#cecece" BorderThickness="1" Margin="14 0 14 0" Padding="0 14 0 0" CornerRadius="5"> <StackPanel Grid.Row="0">
<StackPanel Orientation="Vertical" > <StackPanel>
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1"> <Grid.ColumnDefinitions>
<TextBlock FontSize="14" Grid.Column="1" VerticalAlignment="Center" <ColumnDefinition Width="Auto" />
HorizontalAlignment="Left" Text="{DynamicResource currentPriority}" /> <ColumnDefinition Width="*" />
<TextBlock x:Name="OldPriority" Grid.Row="0" Grid.Column="1" Margin="14 0 10 0" FontSize="14" <ColumnDefinition Width="Auto" />
VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Bold" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="4"
Click="BtnCancel_OnClick"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Width="46"
Height="32"
Data="M 18,11 27,20 M 18,20 27,11"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1">
<Path.Style>
<Style TargetType="Path">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Opacity" Value="0.5" />
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
</Button>
</Grid>
</StackPanel> </StackPanel>
<StackPanel Margin="26,12,26,0">
<StackPanel Margin="0,0,0,12">
<TextBlock
Grid.Column="0"
Margin="0,0,0,0"
FontFamily="Segoe UI"
FontSize="20"
FontWeight="SemiBold"
Text="{DynamicResource changePriorityWindow}"
TextAlignment="Left" />
</StackPanel>
<StackPanel>
<TextBlock
FontSize="14"
Text="{DynamicResource priority_tips}"
TextAlignment="Left"
TextWrapping="WrapWithOverflow" />
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Center"> <StackPanel Margin="0,24,0,24" Orientation="Horizontal">
<TextBlock FontSize="14" VerticalAlignment="Center" <TextBlock
HorizontalAlignment="Right" Text="{DynamicResource newPriority}" /> HorizontalAlignment="Right"
<TextBox x:Name="tbAction" Margin="14 10 15 10" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" /> VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource priority}" />
<ui:NumberBox
x:Name="tbAction"
Width="200"
Margin="10,0,15,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
CornerRadius="4"
Minimum="0"
SmallChange="1"
SpinButtonPlacementMode="Inline" />
</StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</Border> <Border
<StackPanel Grid.Row="2" VerticalAlignment="Center"> Grid.Row="1"
<TextBlock Foreground="Gray" Background="{DynamicResource PopupButtonAreaBGColor}"
Text="{DynamicResource priority_tips}" TextWrapping="WrapWithOverflow" TextAlignment="Center" BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
Margin="20,0,20,0"/> BorderThickness="0,1,0,0">
</StackPanel> <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="3" Grid.Column="1"> <Button
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="0 0 10 0" Width="80" Height="30" x:Name="btnCancel"
Width="145"
Height="30"
Margin="0,0,5,0"
Click="BtnCancel_OnClick"
Content="{DynamicResource cancel}" /> Content="{DynamicResource cancel}" />
<Button x:Name="btnDone" Margin="10 0 0 0" Width="80" Height="30" Click="btnDone_OnClick"> <Button
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" /> x:Name="btnDone"
</Button> Width="145"
</StackPanel> Height="30"
Margin="5,0,0,0"
Click="btnDone_OnClick"
Style="{StaticResource AccentButtonStyle}">
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
</Button>
</StackPanel>
</Border>
</Grid> </Grid>
</Window> </Window>

View file

@ -26,7 +26,6 @@ namespace Flow.Launcher
private Settings settings; private Settings settings;
private readonly Internationalization translater = InternationalizationManager.Instance; private readonly Internationalization translater = InternationalizationManager.Instance;
private readonly PluginViewModel pluginViewModel; private readonly PluginViewModel pluginViewModel;
public PriorityChangeWindow(string pluginId, Settings settings, PluginViewModel pluginViewModel) public PriorityChangeWindow(string pluginId, Settings settings, PluginViewModel pluginViewModel)
{ {
InitializeComponent(); InitializeComponent();
@ -62,8 +61,17 @@ namespace Flow.Launcher
private void PriorityChangeWindow_Loaded(object sender, RoutedEventArgs e) private void PriorityChangeWindow_Loaded(object sender, RoutedEventArgs e)
{ {
OldPriority.Text = pluginViewModel.Priority.ToString(); tbAction.Text = pluginViewModel.Priority.ToString();
tbAction.Focus(); tbAction.Focus();
} }
private void window_MouseDown(object sender, MouseButtonEventArgs e) /* for close hotkey popup */
{
TextBox textBox = Keyboard.FocusedElement as TextBox;
if (textBox != null)
{
TraversalRequest tRequest = new TraversalRequest(FocusNavigationDirection.Next);
textBox.MoveFocus(tRequest);
}
}
} }
} }

View file

@ -69,5 +69,13 @@ namespace Flow.Launcher.Properties {
return ((System.Drawing.Icon)(obj)); return ((System.Drawing.Icon)(obj));
} }
} }
internal static System.Drawing.Icon gamemode
{
get
{
object obj = ResourceManager.GetObject("gamemode", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
} }
} }

View file

@ -112,13 +112,16 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="app" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="app" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\app.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\app.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="gamemode" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Images\gamemode.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
@ -14,6 +14,7 @@ using Flow.Launcher.Infrastructure.Image;
using Flow.Launcher.Plugin; using Flow.Launcher.Plugin;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using Flow.Launcher.Plugin.SharedModels; using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher.Plugin.SharedCommands;
using System.Threading; using System.Threading;
using System.IO; using System.IO;
using Flow.Launcher.Infrastructure.Http; using Flow.Launcher.Infrastructure.Http;
@ -22,6 +23,8 @@ using System.Runtime.CompilerServices;
using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Infrastructure.Storage; using Flow.Launcher.Infrastructure.Storage;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using Flow.Launcher.Plugin.SharedCommands;
using System.Diagnostics;
namespace Flow.Launcher namespace Flow.Launcher
{ {
@ -53,7 +56,7 @@ namespace Flow.Launcher
public void RestartApp() public void RestartApp()
{ {
_mainVM.MainWindowVisibility = Visibility.Hidden; _mainVM.Hide();
// we must manually save // we must manually save
// UpdateManager.RestartApp() will call Environment.Exit(0) // UpdateManager.RestartApp() will call Environment.Exit(0)
@ -68,7 +71,7 @@ namespace Flow.Launcher
public void RestarApp() => RestartApp(); public void RestarApp() => RestartApp();
public void ShowMainWindow() => _mainVM.MainWindowVisibility = Visibility.Visible; public void ShowMainWindow() => _mainVM.Show();
public void CheckForNewUpdate() => _settingsVM.UpdateApp(); public void CheckForNewUpdate() => _settingsVM.UpdateApp();
@ -104,6 +107,14 @@ namespace Flow.Launcher
}); });
} }
public void ShellRun(string cmd, string filename = "cmd.exe")
{
var args = filename == "cmd.exe" ? $"/C {cmd}" : $"{cmd}";
var startInfo = ShellCommand.SetProcessStartInfo(filename, arguments: args, createNoWindow: true);
ShellCommand.Execute(startInfo);
}
public void StartLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Visible; public void StartLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Visible;
public void StopLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Collapsed; public void StopLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Collapsed;
@ -158,7 +169,7 @@ namespace Flow.Launcher
if (!_pluginJsonStorages.ContainsKey(type)) if (!_pluginJsonStorages.ContainsKey(type))
_pluginJsonStorages[type] = new PluginJsonStorage<T>(); _pluginJsonStorages[type] = new PluginJsonStorage<T>();
return ((PluginJsonStorage<T>) _pluginJsonStorages[type]).Load(); return ((PluginJsonStorage<T>)_pluginJsonStorages[type]).Load();
} }
public void SaveSettingJsonStorage<T>() where T : new() public void SaveSettingJsonStorage<T>() where T : new()
@ -167,7 +178,7 @@ namespace Flow.Launcher
if (!_pluginJsonStorages.ContainsKey(type)) if (!_pluginJsonStorages.ContainsKey(type))
_pluginJsonStorages[type] = new PluginJsonStorage<T>(); _pluginJsonStorages[type] = new PluginJsonStorage<T>();
((PluginJsonStorage<T>) _pluginJsonStorages[type]).Save(); ((PluginJsonStorage<T>)_pluginJsonStorages[type]).Save();
} }
public void SaveJsonStorage<T>(T settings) where T : new() public void SaveJsonStorage<T>(T settings) where T : new()
@ -175,7 +186,22 @@ namespace Flow.Launcher
var type = typeof(T); var type = typeof(T);
_pluginJsonStorages[type] = new PluginJsonStorage<T>(settings); _pluginJsonStorages[type] = new PluginJsonStorage<T>(settings);
((PluginJsonStorage<T>) _pluginJsonStorages[type]).Save(); ((PluginJsonStorage<T>)_pluginJsonStorages[type]).Save();
}
public void OpenDirectory(string DirectoryPath, string FileName = null)
{
using Process explorer = new Process();
var explorerInfo = _settingsVM.Settings.CustomExplorer;
explorer.StartInfo = new ProcessStartInfo
{
FileName = explorerInfo.Path,
Arguments = FileName is null ?
explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath) :
explorerInfo.FileArgument.Replace("%d", DirectoryPath).Replace("%f",
Path.IsPathRooted(FileName) ? FileName : Path.Combine(DirectoryPath, FileName))
};
explorer.Start();
} }
public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent; public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
@ -188,7 +214,7 @@ namespace Flow.Launcher
{ {
if (GlobalKeyboardEvent != null) if (GlobalKeyboardEvent != null)
{ {
return GlobalKeyboardEvent((int) keyevent, vkcode, state); return GlobalKeyboardEvent((int)keyevent, vkcode, state);
} }
return true; return true;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -1,25 +1,32 @@
<ListBox x:Class="Flow.Launcher.ResultListBox" <ListBox
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="Flow.Launcher.ResultListBox"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:converter="clr-namespace:Flow.Launcher.Converters"
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:converter="clr-namespace:Flow.Launcher.Converters" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="100" d:DesignHeight="100" xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
d:DataContext="{d:DesignInstance vm:ResultsViewModel}" MaxHeight="{Binding MaxHeight}"
MaxHeight="{Binding MaxHeight}" Margin="{Binding Margin}"
SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}" HorizontalContentAlignment="Stretch"
SelectedItem="{Binding SelectedItem, Mode=TwoWay}" d:DataContext="{d:DesignInstance vm:ResultsViewModel}"
HorizontalContentAlignment="Stretch" ItemsSource="{Binding Results}" d:DesignHeight="100"
Margin="{Binding Margin}" d:DesignWidth="100"
Visibility="{Binding Visbility}" Focusable="False"
Style="{DynamicResource BaseListboxStyle}" Focusable="False" IsSynchronizedWithCurrentItem="True"
KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single" ItemsSource="{Binding Results}"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard" KeyboardNavigation.DirectionalNavigation="Cycle"
SelectionChanged="OnSelectionChanged" PreviewMouseDown="ListBox_PreviewMouseDown"
IsSynchronizedWithCurrentItem="True" SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"
PreviewMouseDown="ListBox_PreviewMouseDown"> SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
<!--IsSynchronizedWithCurrentItem: http://stackoverflow.com/a/7833798/2833083--> SelectionChanged="OnSelectionChanged"
SelectionMode="Single"
Style="{DynamicResource BaseListboxStyle}"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Standard"
Visibility="{Binding Visbility}"
mc:Ignorable="d">
<!-- IsSynchronizedWithCurrentItem: http://stackoverflow.com/a/7833798/2833083 -->
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
@ -30,46 +37,88 @@
</ControlTemplate> </ControlTemplate>
</Button.Template> </Button.Template>
<Button.Content> <Button.Content>
<Grid HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="0" <Grid
Cursor="Hand" UseLayoutRounding="False"> Margin="0"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
Cursor="Hand"
UseLayoutRounding="False">
<Grid.Resources> <Grid.Resources>
<converter:HighlightTextConverter x:Key="HighlightTextConverter"/> <converter:HighlightTextConverter x:Key="HighlightTextConverter" />
<converter:OrdinalConverter x:Key="OrdinalConverter" /> <converter:OrdinalConverter x:Key="OrdinalConverter" />
<converter:OpenResultHotkeyVisibilityConverter x:Key="OpenResultHotkeyVisibilityConverter" /> <converter:OpenResultHotkeyVisibilityConverter x:Key="OpenResultHotkeyVisibilityConverter" />
</Grid.Resources> </Grid.Resources>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="60" /> <ColumnDefinition Width="60" />
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel Visibility="{Binding ShowOpenResultHotkey}" Grid.Column="2" Margin="0 0 10 0"> <StackPanel
<TextBlock Margin="12 0 12 0" Style="{DynamicResource ItemHotkeyStyle}" HorizontalAlignment="Right" Opacity="0.8" VerticalAlignment="Center" Padding="0 10 0 10" x:Name="Hotkey"> Grid.Column="2"
Margin="0,0,10,0"
Visibility="{Binding ShowOpenResultHotkey}">
<TextBlock
x:Name="Hotkey"
Margin="12,0,12,0"
Padding="0,10,0,10"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Opacity="0.8"
Style="{DynamicResource ItemHotkeyStyle}">
<TextBlock.Visibility> <TextBlock.Visibility>
<Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" Converter="{StaticResource ResourceKey=OpenResultHotkeyVisibilityConverter}" /> <Binding Converter="{StaticResource ResourceKey=OpenResultHotkeyVisibilityConverter}" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" />
</TextBlock.Visibility> </TextBlock.Visibility>
<TextBlock.Text> <TextBlock.Text>
<MultiBinding StringFormat="{}{0}+{1}"> <MultiBinding StringFormat="{}{0}+{1}">
<Binding Path="OpenResultModifiers" /> <Binding Path="OpenResultModifiers" />
<Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" Converter="{StaticResource ResourceKey=OrdinalConverter}" /> <Binding Converter="{StaticResource ResourceKey=OrdinalConverter}" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" />
</MultiBinding> </MultiBinding>
</TextBlock.Text> </TextBlock.Text>
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
<Border BorderThickness="0" BorderBrush="Transparent" Margin="9 0 0 0"> <Border
<Image x:Name="ImageIcon" Width="32" Height="32" HorizontalAlignment="Center" Source="{Binding Image}" Visibility="{Binding ShowIcon}" Margin="0 0 0 0" Stretch="UniformToFill"/> Margin="9,0,0,0"
BorderBrush="Transparent"
BorderThickness="0">
<Image
x:Name="ImageIcon"
Width="32"
Height="32"
Margin="0,0,0,0"
HorizontalAlignment="Center"
Source="{Binding Image}"
Stretch="Uniform"
Visibility="{Binding ShowIcon}" />
</Border> </Border>
<Border BorderThickness="0" BorderBrush="Transparent" Margin="9 0 0 0"> <Border
<TextBlock Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Glyph.Glyph}" FontFamily="{Binding Glyph.FontFamily}" Visibility="{Binding ShowGlyph}" Style="{DynamicResource ItemGlyph}"/> Margin="9,0,0,0"
BorderBrush="Transparent"
BorderThickness="0">
<TextBlock
Grid.Column="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{Binding Glyph.FontFamily}"
Style="{DynamicResource ItemGlyph}"
Text="{Binding Glyph.Glyph}"
Visibility="{Binding ShowGlyph}" />
</Border> </Border>
<Grid Margin="6 0 10 0" Grid.Column="1" HorizontalAlignment="Stretch"> <Grid
Grid.Column="1"
Margin="6,0,10,0"
HorizontalAlignment="Stretch">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition />
<RowDefinition Height="Auto" x:Name="SubTitleRowDefinition" /> <RowDefinition x:Name="SubTitleRowDefinition" Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Style="{DynamicResource ItemTitleStyle}" DockPanel.Dock="Left" <TextBlock
VerticalAlignment="Center" ToolTip="{Binding ShowTitleToolTip}" x:Name="Title" x:Name="Title"
Text="{Binding Result.Title}"> VerticalAlignment="Center"
DockPanel.Dock="Left"
Style="{DynamicResource ItemTitleStyle}"
Text="{Binding Result.Title}"
ToolTip="{Binding ShowTitleToolTip}">
<vm:ResultsViewModel.FormattedText> <vm:ResultsViewModel.FormattedText>
<MultiBinding Converter="{StaticResource HighlightTextConverter}"> <MultiBinding Converter="{StaticResource HighlightTextConverter}">
<Binding Path="Result.Title" /> <Binding Path="Result.Title" />
@ -77,8 +126,13 @@
</MultiBinding> </MultiBinding>
</vm:ResultsViewModel.FormattedText> </vm:ResultsViewModel.FormattedText>
</TextBlock> </TextBlock>
<TextBlock Style="{DynamicResource ItemSubTitleStyle}" ToolTip="{Binding ShowSubTitleToolTip}" <TextBlock
Grid.Row="1" x:Name="SubTitle" Text="{Binding Result.SubTitle}" MinWidth="750"> x:Name="SubTitle"
Grid.Row="1"
MinWidth="750"
Style="{DynamicResource ItemSubTitleStyle}"
Text="{Binding Result.SubTitle}"
ToolTip="{Binding ShowSubTitleToolTip}">
<vm:ResultsViewModel.FormattedText> <vm:ResultsViewModel.FormattedText>
<MultiBinding Converter="{StaticResource HighlightTextConverter}"> <MultiBinding Converter="{StaticResource HighlightTextConverter}">
<Binding Path="Result.SubTitle" /> <Binding Path="Result.SubTitle" />
@ -92,11 +146,9 @@
</Grid> </Grid>
</Button.Content> </Button.Content>
</Button> </Button>
<!-- a result item height is 52 including margin --> <!-- a result item height is 52 including margin -->
<DataTemplate.Triggers> <DataTemplate.Triggers>
<DataTrigger <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Value="True">
Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBoxItem}}, Path=IsSelected}"
Value="True">
<Setter TargetName="Title" Property="Style" Value="{DynamicResource ItemTitleSelectedStyle}" /> <Setter TargetName="Title" Property="Style" Value="{DynamicResource ItemTitleSelectedStyle}" />
<Setter TargetName="SubTitle" Property="Style" Value="{DynamicResource ItemSubTitleSelectedStyle}" /> <Setter TargetName="SubTitle" Property="Style" Value="{DynamicResource ItemSubTitleSelectedStyle}" />
<Setter TargetName="Hotkey" Property="Style" Value="{DynamicResource ItemHotkeySelectedStyle}" /> <Setter TargetName="Hotkey" Property="Style" Value="{DynamicResource ItemHotkeySelectedStyle}" />
@ -105,7 +157,7 @@
</DataTemplate.Triggers> </DataTemplate.Triggers>
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ListBox.ItemTemplate>
<!--http://stackoverflow.com/questions/16819577/setting-background-color-or-wpf-4-0-listbox-windows-8/#16820062--> <!-- http://stackoverflow.com/questions/16819577/setting-background-color-or-wpf-4-0-listbox-windows-8/#16820062 -->
<ListBox.ItemContainerStyle> <ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}"> <Style TargetType="{x:Type ListBoxItem}">
<EventSetter Event="MouseEnter" Handler="OnMouseEnter" /> <EventSetter Event="MouseEnter" Handler="OnMouseEnter" />
@ -117,23 +169,23 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}"> <ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="Bd" <Border
Background="{TemplateBinding Background}" x:Name="Bd"
BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"
SnapsToDevicePixels="True"> BorderBrush="{TemplateBinding BorderBrush}"
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="True">
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" <ContentPresenter
Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
ContentStringFormat="{TemplateBinding ContentStringFormat}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True"> <Trigger Property="IsSelected" Value="True">
<Setter TargetName="Bd" Property="Background" <Setter TargetName="Bd" Property="Background" Value="{DynamicResource ItemSelectedBackgroundColor}" />
Value="{DynamicResource ItemSelectedBackgroundColor}" /> <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource ItemSelectedBackgroundColor}" />
<Setter TargetName="Bd" Property="BorderBrush"
Value="{DynamicResource ItemSelectedBackgroundColor}" />
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>

View file

@ -0,0 +1,275 @@
<Window
x:Class="Flow.Launcher.SelectFileManagerWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019"
Title="{DynamicResource fileManagerWindow}"
Width="600"
Background="{DynamicResource PopuBGColor}"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
Foreground="{DynamicResource PopupTextColor}"
ResizeMode="NoResize"
SizeToContent="Height"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
</WindowChrome.WindowChrome>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="80" />
</Grid.RowDefinitions>
<Grid>
<StackPanel>
<StackPanel>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="4"
Click="btnCancel_Click"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Width="46"
Height="32"
Data="M 18,11 27,20 M 18,20 27,11"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1">
<Path.Style>
<Style TargetType="Path">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Opacity" Value="0.5" />
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
</Button>
</Grid>
</StackPanel>
<StackPanel Margin="26,12,26,0">
<StackPanel Grid.Row="1" Margin="0,0,0,12">
<TextBlock
Grid.Column="0"
Margin="0,0,0,0"
FontFamily="Segoe UI"
FontSize="20"
FontWeight="SemiBold"
Text="{DynamicResource fileManagerWindow}"
TextAlignment="Left" />
</StackPanel>
<StackPanel>
<TextBlock
FontSize="14"
Text="{DynamicResource fileManager_tips}"
TextAlignment="Left"
TextWrapping="WrapWithOverflow" />
<TextBlock Margin="0,14,0,0" FontSize="14">
<TextBlock Text="{DynamicResource fileManager_tips2}" TextWrapping="WrapWithOverflow" />
</TextBlock>
</StackPanel>
<StackPanel Margin="14,28,0,0" Orientation="Horizontal">
<TextBlock
Grid.Column="1"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource fileManager_name}" />
<ComboBox
Name="comboBox"
Width="200"
Height="35"
Margin="14,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
ItemsSource="{Binding CustomExplorers}"
SelectedIndex="{Binding SelectedCustomExplorerIndex}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Button
Margin="10,0,0,0"
Click="btnAdd_Click"
Content="{DynamicResource add}" />
<Button
Margin="10,0,0,0"
Click="btnDelete_Click"
Content="{DynamicResource delete}"
IsEnabled="{Binding CustomExplorer.Editable}" />
</StackPanel>
<Rectangle
Height="1"
Margin="0,20,0,12"
Fill="{StaticResource Color03B}" />
<StackPanel
Margin="0,0,0,0"
HorizontalAlignment="Stretch"
DataContext="{Binding CustomExplorer}"
Orientation="Horizontal">
<Grid Width="545">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
Grid.Column="0"
Margin="14,5,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource fileManager_profile_name}" />
<TextBox
x:Name="ProfileTextBox"
Grid.Row="0"
Grid.Column="1"
Width="Auto"
Margin="10,5,15,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
IsEnabled="{Binding Editable}"
Text="{Binding Name}" />
<TextBlock
Grid.Row="1"
Grid.Column="0"
Margin="14,10,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource fileManager_path}" />
<DockPanel Grid.Row="1" Grid.Column="1">
<TextBox
x:Name="PathTextBox"
Width="250"
Margin="10,10,10,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
IsEnabled="{Binding Editable}"
Text="{Binding Path}" />
<Button
Name="btnBrowseFile"
Width="80"
Margin="0,10,15,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Click="btnBrowseFile_Click"
Content="{DynamicResource selectPythonDirectory}"
DockPanel.Dock="Right">
<Button.Style>
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="{x:Type Button}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ProfileTextBox, UpdateSourceTrigger=PropertyChanged, Path=IsEnabled}" Value="False">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</DockPanel>
<TextBlock
Grid.Row="2"
Grid.Column="0"
Margin="14,10,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource fileManager_directory_arg}"
TextWrapping="WrapWithOverflow" />
<TextBox
x:Name="directoryArgTextBox"
Grid.Row="2"
Grid.Column="1"
Width="Auto"
Margin="10,10,15,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
IsEnabled="{Binding Editable}"
Text="{Binding DirectoryArgument}" />
<TextBlock
Grid.Row="3"
Grid.Column="0"
Margin="14,10,0,20"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource fileManager_file_arg}"
TextWrapping="WrapWithOverflow" />
<TextBox
x:Name="fileArgTextBox"
Grid.Row="3"
Grid.Column="1"
Width="Auto"
Margin="10,10,15,20"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
IsEnabled="{Binding Editable}"
Text="{Binding FileArgument}" />
</Grid>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
<Border
Grid.Row="2"
Background="{DynamicResource PopupButtonAreaBGColor}"
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
BorderThickness="0,1,0,0">
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Button
x:Name="btnCancel"
Width="145"
Margin="0,0,5,0"
Click="btnCancel_Click"
Content="{DynamicResource cancel}" />
<Button
x:Name="btnDone"
Width="145"
Margin="5,0,0,0"
Click="btnDone_Click"
Content="{DynamicResource done}"
ForceCursor="True">
<Button.Style>
<Style BasedOn="{StaticResource AccentButtonStyle}" TargetType="{x:Type Button}">
<Style.Triggers>
<DataTrigger Binding="{Binding Text.Length, ElementName=ProfileTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
<DataTrigger Binding="{Binding Text.Length, ElementName=PathTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
<DataTrigger Binding="{Binding Text.Length, ElementName=directoryArgTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
<DataTrigger Binding="{Binding Text.Length, ElementName=fileArgTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</StackPanel>
</Border>
</Grid>
</Window>

View file

@ -0,0 +1,88 @@
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.ViewModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Flow.Launcher
{
public partial class SelectFileManagerWindow : Window, INotifyPropertyChanged
{
private int selectedCustomExplorerIndex;
public event PropertyChangedEventHandler PropertyChanged;
public Settings Settings { get; }
public int SelectedCustomExplorerIndex
{
get => selectedCustomExplorerIndex; set
{
selectedCustomExplorerIndex = value;
PropertyChanged?.Invoke(this, new(nameof(CustomExplorer)));
}
}
public ObservableCollection<CustomExplorerViewModel> CustomExplorers { get; set; }
public CustomExplorerViewModel CustomExplorer => CustomExplorers[SelectedCustomExplorerIndex];
public SelectFileManagerWindow(Settings settings)
{
Settings = settings;
CustomExplorers = new ObservableCollection<CustomExplorerViewModel>(Settings.CustomExplorerList.Select(x => x.Copy()));
SelectedCustomExplorerIndex = Settings.CustomExplorerIndex;
InitializeComponent();
}
private void btnCancel_Click(object sender, RoutedEventArgs e)
{
Close();
}
private void btnDone_Click(object sender, RoutedEventArgs e)
{
Settings.CustomExplorerList = CustomExplorers.ToList();
Settings.CustomExplorerIndex = SelectedCustomExplorerIndex;
Close();
}
private void btnAdd_Click(object sender, RoutedEventArgs e)
{
CustomExplorers.Add(new()
{
Name = "New Profile"
});
SelectedCustomExplorerIndex = CustomExplorers.Count - 1;
}
private void btnDelete_Click(object sender, RoutedEventArgs e)
{
CustomExplorers.RemoveAt(SelectedCustomExplorerIndex--);
}
private void btnBrowseFile_Click(object sender, RoutedEventArgs e)
{
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
Nullable<bool> result = dlg.ShowDialog();
if (result == true)
{
TextBox path = (TextBox)(((FrameworkElement)sender).Parent as FrameworkElement).FindName("PathTextBox");
path.Text = dlg.FileName;
path.Focus();
((Button)sender).Focus();
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,20 +1,26 @@
using System; using Flow.Launcher.Core.ExternalPlugins;
using System.IO;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Navigation;
using Microsoft.Win32;
using Flow.Launcher.Core.Plugin; using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Core.Resource; using Flow.Launcher.Core.Resource;
using Flow.Launcher.Helper;
using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin; using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using Flow.Launcher.Helper; using Microsoft.Win32;
using System.Windows.Controls; using ModernWpf;
using Flow.Launcher.Core.ExternalPlugins; using System;
using System.IO;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Navigation;
using Button = System.Windows.Controls.Button;
using Control = System.Windows.Controls.Control;
using MessageBox = System.Windows.MessageBox;
using TextBox = System.Windows.Controls.TextBox;
using ThemeManager = ModernWpf.ThemeManager;
namespace Flow.Launcher namespace Flow.Launcher
{ {
@ -39,6 +45,7 @@ namespace Flow.Launcher
#region General #region General
private void OnLoaded(object sender, RoutedEventArgs e) private void OnLoaded(object sender, RoutedEventArgs e)
{ {
RefreshMaximizeRestoreButton();
// Fix (workaround) for the window freezes after lock screen (Win+L) // Fix (workaround) for the window freezes after lock screen (Win+L)
// https://stackoverflow.com/questions/4951058/software-rendering-mode-wpf // https://stackoverflow.com/questions/4951058/software-rendering-mode-wpf
HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource; HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource;
@ -58,39 +65,30 @@ namespace Flow.Launcher
public static void SetStartup() public static void SetStartup()
{ {
using (var key = Registry.CurrentUser.OpenSubKey(StartupPath, true)) using var key = Registry.CurrentUser.OpenSubKey(StartupPath, true);
{ key?.SetValue(Constant.FlowLauncher, Constant.ExecutablePath);
key?.SetValue(Infrastructure.Constant.FlowLauncher, Infrastructure.Constant.ExecutablePath);
}
} }
private void RemoveStartup() private void RemoveStartup()
{ {
using (var key = Registry.CurrentUser.OpenSubKey(StartupPath, true)) using var key = Registry.CurrentUser.OpenSubKey(StartupPath, true);
{ key?.DeleteValue(Constant.FlowLauncher, false);
key?.DeleteValue(Infrastructure.Constant.FlowLauncher, false);
}
} }
public static bool StartupSet() public static bool StartupSet()
{ {
using (var key = Registry.CurrentUser.OpenSubKey(StartupPath, true)) using var key = Registry.CurrentUser.OpenSubKey(StartupPath, true);
var path = key?.GetValue(Constant.FlowLauncher) as string;
if (path != null)
{ {
var path = key?.GetValue(Infrastructure.Constant.FlowLauncher) as string; return path == Constant.ExecutablePath;
if (path != null)
{
return path == Infrastructure.Constant.ExecutablePath;
}
else
{
return false;
}
} }
return false;
} }
private void OnSelectPythonDirectoryClick(object sender, RoutedEventArgs e) private void OnSelectPythonDirectoryClick(object sender, RoutedEventArgs e)
{ {
var dlg = new System.Windows.Forms.FolderBrowserDialog var dlg = new FolderBrowserDialog
{ {
SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)
}; };
@ -115,6 +113,12 @@ namespace Flow.Launcher
} }
} }
private void OnSelectFileManagerClick(object sender, RoutedEventArgs e)
{
SelectFileManagerWindow fileManagerChangeWindow = new SelectFileManagerWindow(settings);
fileManagerChangeWindow.ShowDialog();
}
#endregion #endregion
#region Hotkey #region Hotkey
@ -213,7 +217,7 @@ namespace Flow.Launcher
var uri = new Uri(website); var uri = new Uri(website);
if (Uri.CheckSchemeName(uri.Scheme)) if (Uri.CheckSchemeName(uri.Scheme))
{ {
SearchWeb.NewTabInBrowser(website); website.NewTabInBrowser();
} }
} }
} }
@ -225,7 +229,7 @@ namespace Flow.Launcher
{ {
var directory = viewModel.SelectedPlugin.PluginPair.Metadata.PluginDirectory; var directory = viewModel.SelectedPlugin.PluginPair.Metadata.PluginDirectory;
if (!string.IsNullOrEmpty(directory)) if (!string.IsNullOrEmpty(directory))
FilesFolders.OpenPath(directory); PluginManager.API.OpenDirectory(directory);
} }
} }
#endregion #endregion
@ -247,7 +251,7 @@ namespace Flow.Launcher
private void OnRequestNavigate(object sender, RequestNavigateEventArgs e) private void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{ {
SearchWeb.NewTabInBrowser(e.Uri.AbsoluteUri); e.Uri.AbsoluteUri.NewTabInBrowser();
e.Handled = true; e.Handled = true;
} }
@ -261,9 +265,19 @@ namespace Flow.Launcher
Close(); Close();
} }
private void OpenPluginFolder(object sender, RoutedEventArgs e) private void OpenThemeFolder(object sender, RoutedEventArgs e)
{ {
FilesFolders.OpenPath(Path.Combine(DataLocation.DataDirectory(), Constant.Themes)); PluginManager.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Themes));
}
private void OpenSettingFolder(object sender, RoutedEventArgs e)
{
PluginManager.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Settings));
}
private void OpenLogFolder(object sender, RoutedEventArgs e)
{
PluginManager.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Logs, Constant.Version));
} }
private void OnPluginStoreRefreshClick(object sender, RoutedEventArgs e) private void OnPluginStoreRefreshClick(object sender, RoutedEventArgs e)
@ -276,10 +290,65 @@ namespace Flow.Launcher
if(sender is Button { DataContext: UserPlugin plugin }) if(sender is Button { DataContext: UserPlugin plugin })
{ {
var pluginsManagerPlugin = PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7"); var pluginsManagerPlugin = PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7");
var actionKeywrod = pluginsManagerPlugin.Metadata.ActionKeywords.Count == 0 ? "" : pluginsManagerPlugin.Metadata.ActionKeywords[0]; var actionKeyword = pluginsManagerPlugin.Metadata.ActionKeywords.Count == 0 ? "" : pluginsManagerPlugin.Metadata.ActionKeywords[0];
API.ChangeQuery($"{actionKeywrod} install {plugin.Name}"); API.ChangeQuery($"{actionKeyword} install {plugin.Name}");
API.ShowMainWindow(); API.ShowMainWindow();
} }
} }
private void window_MouseDown(object sender, MouseButtonEventArgs e) /* for close hotkey popup */
{
if (Keyboard.FocusedElement is not TextBox textBox)
{
return;
}
var tRequest = new TraversalRequest(FocusNavigationDirection.Next);
textBox.MoveFocus(tRequest);
}
private void ColorSchemeSelectedIndexChanged(object sender, EventArgs e)
=> ThemeManager.Current.ApplicationTheme = settings.ColorScheme switch
{
Constant.Light => ApplicationTheme.Light,
Constant.Dark => ApplicationTheme.Dark,
Constant.System => null,
_ => ThemeManager.Current.ApplicationTheme
};
/* Custom TitleBar */
private void OnMinimizeButtonClick(object sender, RoutedEventArgs e)
{
WindowState = WindowState.Minimized;
}
private void OnMaximizeRestoreButtonClick(object sender, RoutedEventArgs e)
{
WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
}
private void OnCloseButtonClick(object sender, RoutedEventArgs e)
{
Close();
}
private void RefreshMaximizeRestoreButton()
{
if (WindowState == WindowState.Maximized)
{
maximizeButton.Visibility = Visibility.Collapsed;
restoreButton.Visibility = Visibility.Visible;
}
else
{
maximizeButton.Visibility = Visibility.Visible;
restoreButton.Visibility = Visibility.Collapsed;
}
}
private void Window_StateChanged(object sender, EventArgs e)
{
RefreshMaximizeRestoreButton();
}
} }
} }

View file

@ -0,0 +1,103 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#9fb2bf" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="SelectionBrush" Value="#515a6b"/>
<Setter Property="FontSize" Value="24" />
<Setter Property="Background" Value="#282c34" />
<Setter Property="Foreground" Value="#61afef" />
<Setter Property="CaretBrush" Value="#ffb86c" />
<Setter Property="FontSize" Value="26" />
<Setter Property="Padding" Value="0 4 66 0" />
<Setter Property="Height" Value="42" />
</Style>
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#282c34" />
<Setter Property="Foreground" Value="#454e61" />
<Setter Property="FontSize" Value="26" />
<Setter Property="Padding" Value="0 4 66 0" />
<Setter Property="Height" Value="42" />
</Style>
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
<Setter Property="BorderThickness" Value="2" />
<Setter Property="BorderBrush" Value="#44475a" />
<Setter Property="CornerRadius" Value="5" />
<Setter Property="Background" Value="#282c34" />
</Style>
<Style x:Key="WindowStyle" BasedOn="{StaticResource BaseWindowStyle}" TargetType="{x:Type Window}">
<Setter Property="Width" Value="576" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
</Style>
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}">
</Style>
<!-- Item Style -->
<Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#9fb2bf" />
</Style>
<Style x:Key="ItemSubTitleStyle" BasedOn="{StaticResource BaseItemSubTitleStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Foreground" Value="#6272a4 " />
<Setter Property="FontSize" Value="13" />
</Style>
<Style x:Key="ItemNumberStyle" BasedOn="{StaticResource BaseItemNumberStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#6272a4" />
</Style>
<Style x:Key="ItemTitleSelectedStyle" BasedOn="{StaticResource BaseItemTitleSelectedStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Cursor" Value="Arrow" />
<Setter Property="Foreground" Value="#e5c07b" />
</Style>
<Style x:Key="ItemSubTitleSelectedStyle" BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Cursor" Value="Arrow" />
<Setter Property="Foreground" Value="#c678dd" />
</Style>
<SolidColorBrush x:Key="ItemSelectedBackgroundColor">#2c313c</SolidColorBrush>
<Style x:Key="ItemImageSelectedStyle" BasedOn="{StaticResource BaseItemImageSelectedStyle}" TargetType="{x:Type Image}" >
<Setter Property="Cursor" Value="Arrow" />
</Style>
<Style x:Key="HighlightStyle">
<Setter Property="Inline.Foreground" Value="#e06c75 " />
</Style>
<Style x:Key="ItemHotkeyStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="#6272a4" />
</Style>
<Style x:Key="ItemHotkeySelectedStyle" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseItemHotkeySelecetedStyle}">
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="#56b6c2" />
</Style>
<!-- button style in the middle of the scrollbar -->
<Style x:Key="ThumbStyle" BasedOn="{StaticResource BaseThumbStyle}" TargetType="{x:Type Thumb}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Width" Value="2"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border CornerRadius="2" DockPanel.Dock="Right" Background="#b4b5b7" BorderBrush="Transparent" BorderThickness="0" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollBarStyle" BasedOn="{StaticResource BaseScrollBarStyle}" TargetType="{x:Type ScrollBar}">
</Style>
<Style x:Key="SeparatorStyle" BasedOn="{StaticResource BaseSeparatorStyle}" TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="#495162"/>
<Setter Property="Height" Value="1"/>
<Setter Property="Margin" Value="12 0 12 8"/>
</Style>
<Style x:Key="SearchIconStyle" TargetType="{x:Type Path}" BasedOn="{StaticResource BaseSearchIconStyle}">
<Setter Property="Fill" Value="#495162" />
<Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" />
<Setter Property="Opacity" Value="0.8" />
</Style>
</ResourceDictionary>

View file

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"> xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure">
<!-- Further font customisations are dynamically loaded in Theme.cs --> <!-- Further font customisations are dynamically loaded in Theme.cs -->
<Style x:Key="BaseQueryBoxStyle" TargetType="{x:Type TextBox}"> <Style x:Key="BaseQueryBoxStyle" TargetType="{x:Type TextBox}">
@ -54,7 +55,7 @@
<Setter Property="CornerRadius" Value="5" /> <Setter Property="CornerRadius" Value="5" />
</Style> </Style>
<Style x:Key="BaseWindowStyle" TargetType="{x:Type Window}"> <Style x:Key="BaseWindowStyle" TargetType="{x:Type Window}">
<Setter Property="Width" Value="750" /> <Setter Property="Width" Value="600" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/> <Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
</Style> </Style>
@ -222,31 +223,16 @@
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<Style x:Key="BaseSeparatorStyle" TargetType="Rectangle"> <Style x:Key="BaseSeparatorStyle" TargetType="Rectangle">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ResultListBox, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=ContextMenu, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=History, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style> </Style>
<Style x:Key="HighlightStyle"> <Style x:Key="HighlightStyle">
<Setter Property="Inline.FontWeight" Value="Bold" /> <Setter Property="Inline.FontWeight" Value="Bold" />
</Style> </Style>
<Style x:Key="BaseItemHotkeyStyle" TargetType="{x:Type TextBlock}"> <Style x:Key="BaseItemHotkeyStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="15" /> <Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="#8f8f8f" /> <Setter Property="Foreground" Value="#8f8f8f" />
</Style> </Style>
<Style x:Key="BaseItemHotkeySelecetedStyle" TargetType="{x:Type TextBlock}"> <Style x:Key="BaseItemHotkeySelecetedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="15" /> <Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="#8f8f8f" /> <Setter Property="Foreground" Value="#8f8f8f" />

View file

@ -0,0 +1,95 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ebebeb" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#ebebeb" />
<Setter Property="Background" Value="Transparent" />
</Style>
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Transparent" />
</Style>
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="5" />
<Setter Property="BorderThickness" Value="1 1 0 0" />
<Setter Property="BorderBrush" Value="#666666" />
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="#333333" Opacity="0.95"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="WindowStyle" BasedOn="{StaticResource BaseWindowStyle}" TargetType="{x:Type Window}">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="White" Opacity="0.5"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}">
</Style>
<!-- Item Style -->
<Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Margin" Value="0, -10"/>
<Setter Property="Foreground" Value="#ebebeb"/>
</Style>
<Style x:Key="ItemSubTitleStyle" BasedOn="{StaticResource BaseItemSubTitleStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Foreground" Value="#787878"/>
</Style>
<Style x:Key="ItemTitleSelectedStyle" BasedOn="{StaticResource BaseItemTitleSelectedStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Margin" Value="0, -10"/>
<Setter Property="Foreground" Value="#ffffff"/>
</Style>
<Style x:Key="ItemSubTitleSelectedStyle" BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Foreground" Value="#949494"/>
</Style>
<SolidColorBrush x:Key="ItemSelectedBackgroundColor">#545454</SolidColorBrush>
<!-- button style in the middle of the scrollbar -->
<Style x:Key="ThumbStyle" BasedOn="{StaticResource BaseThumbStyle}" TargetType="{x:Type Thumb}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border CornerRadius="2" DockPanel.Dock="Right" Background="#525252" BorderBrush="Transparent" BorderThickness="0" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollBarStyle" BasedOn="{StaticResource BaseScrollBarStyle}" TargetType="{x:Type ScrollBar}">
<Setter Property="Background" Value="#a0a0a0"/>
</Style>
<Style x:Key="SearchIconStyle" TargetType="{x:Type Path}" BasedOn="{StaticResource BaseSearchIconStyle}">
<Setter Property="Fill" Value="#FFFFFF" />
<Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" />
<Setter Property="Opacity" Value="0.2" />
</Style>
<Style x:Key="SeparatorStyle" BasedOn="{StaticResource BaseSeparatorStyle}" TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="#787878"/>
<Setter Property="Height" Value="1"/>
<Setter Property="Margin" Value="0 0 0 8"/>
<Setter Property="Opacity" Value="0.3" />
</Style>
<Style x:Key="ItemHotkeyStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="#787878" />
<Setter Property="Opacity" Value="0.1" />
</Style>
<Style x:Key="ItemHotkeySelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="#787878" />
<Setter Property="Opacity" Value="0.1" />
</Style>
</ResourceDictionary>

View file

@ -0,0 +1,103 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#f8f8f2" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="SelectionBrush" Value="#ff79c6"/>
<Setter Property="FontSize" Value="24" />
<Setter Property="Background" Value="#282a36" />
<Setter Property="Foreground" Value="#f8f8f2" />
<Setter Property="CaretBrush" Value="#ffb86c" />
<Setter Property="FontSize" Value="26" />
<Setter Property="Padding" Value="0 4 66 0" />
<Setter Property="Height" Value="42" />
</Style>
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#282a36" />
<Setter Property="Foreground" Value="#6272a4" />
<Setter Property="FontSize" Value="26" />
<Setter Property="Padding" Value="0 4 66 0" />
<Setter Property="Height" Value="42" />
</Style>
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
<Setter Property="BorderThickness" Value="2" />
<Setter Property="BorderBrush" Value="#44475a" />
<Setter Property="CornerRadius" Value="5" />
<Setter Property="Background" Value="#282a36" />
</Style>
<Style x:Key="WindowStyle" BasedOn="{StaticResource BaseWindowStyle}" TargetType="{x:Type Window}">
<Setter Property="Width" Value="576" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
</Style>
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}">
</Style>
<!-- Item Style -->
<Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#f8f8f2" />
</Style>
<Style x:Key="ItemSubTitleStyle" BasedOn="{StaticResource BaseItemSubTitleStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Foreground" Value="#6272a4" />
<Setter Property="FontSize" Value="13" />
</Style>
<Style x:Key="ItemNumberStyle" BasedOn="{StaticResource BaseItemNumberStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#6272a4" />
</Style>
<Style x:Key="ItemTitleSelectedStyle" BasedOn="{StaticResource BaseItemTitleSelectedStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Cursor" Value="Arrow" />
<Setter Property="Foreground" Value="#ff79c6" />
</Style>
<Style x:Key="ItemSubTitleSelectedStyle" BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Cursor" Value="Arrow" />
<Setter Property="Foreground" Value="#6272a4" />
</Style>
<SolidColorBrush x:Key="ItemSelectedBackgroundColor">#44475a</SolidColorBrush>
<Style x:Key="ItemImageSelectedStyle" BasedOn="{StaticResource BaseItemImageSelectedStyle}" TargetType="{x:Type Image}" >
<Setter Property="Cursor" Value="Arrow" />
</Style>
<Style x:Key="HighlightStyle">
<Setter Property="Inline.Foreground" Value="#bd93f9" />
</Style>
<Style x:Key="ItemHotkeyStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="#6272a4" />
</Style>
<Style x:Key="ItemHotkeySelectedStyle" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseItemHotkeySelecetedStyle}">
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="#ff79c6" />
</Style>
<!-- button style in the middle of the scrollbar -->
<Style x:Key="ThumbStyle" BasedOn="{StaticResource BaseThumbStyle}" TargetType="{x:Type Thumb}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Width" Value="2"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border CornerRadius="2" DockPanel.Dock="Right" Background="#44475a" BorderBrush="Transparent" BorderThickness="0" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollBarStyle" BasedOn="{StaticResource BaseScrollBarStyle}" TargetType="{x:Type ScrollBar}">
</Style>
<Style x:Key="SeparatorStyle" BasedOn="{StaticResource BaseSeparatorStyle}" TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="#44475a"/>
<Setter Property="Height" Value="1"/>
<Setter Property="Margin" Value="12 0 12 8"/>
</Style>
<Style x:Key="SearchIconStyle" TargetType="{x:Type Path}" BasedOn="{StaticResource BaseSearchIconStyle}">
<Setter Property="Fill" Value="#6272a4" />
<Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" />
<Setter Property="Opacity" Value="0.8" />
</Style>
</ResourceDictionary>

View file

@ -1,72 +1,109 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=mscorlib"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" /> <ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}"> <Style
x:Key="ItemGlyph"
BasedOn="{StaticResource BaseGlyphStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" /> <Setter Property="Foreground" Value="#ffffff" />
</Style> </Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}"> <Style
<Setter Property="SelectionBrush" Value="#4a5459"/> x:Key="QueryBoxStyle"
BasedOn="{StaticResource BaseQueryBoxStyle}"
TargetType="{x:Type TextBox}">
<Setter Property="SelectionBrush" Value="#4a5459" />
<Setter Property="FontSize" Value="24" /> <Setter Property="FontSize" Value="24" />
<Setter Property="Background" Value="#202020" /> <Setter Property="Background" Value="#202020" />
<Setter Property="Foreground" Value="#FFFFFF" /> <Setter Property="Foreground" Value="#FFFFFF" />
<Setter Property="CaretBrush" Value="#FFFFFF" /> <Setter Property="CaretBrush" Value="#FFFFFF" />
<Setter Property="FontSize" Value="26" /> <Setter Property="FontSize" Value="26" />
<Setter Property="Padding" Value="0 4 66 0" /> <Setter Property="Padding" Value="0,4,66,0" />
<Setter Property="Height" Value="42" /> <Setter Property="Height" Value="42" />
</Style> </Style>
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}"> <Style
x:Key="QuerySuggestionBoxStyle"
BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}"
TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#202020" /> <Setter Property="Background" Value="#202020" />
<Setter Property="Foreground" Value="#7b7b7b" /> <Setter Property="Foreground" Value="#7b7b7b" />
<Setter Property="FontSize" Value="26" /> <Setter Property="FontSize" Value="26" />
<Setter Property="Padding" Value="0 4 66 0" /> <Setter Property="Padding" Value="0,4,66,0" />
<Setter Property="Height" Value="42" /> <Setter Property="Height" Value="42" />
</Style> </Style>
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}"> <Style
x:Key="WindowBorderStyle"
BasedOn="{StaticResource BaseWindowBorderStyle}"
TargetType="{x:Type Border}">
<Setter Property="BorderThickness" Value="1" /> <Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="#3f3f3f" /> <Setter Property="BorderBrush" Value="#3f3f3f" />
<Setter Property="CornerRadius" Value="5" /> <Setter Property="CornerRadius" Value="5" />
<Setter Property="Background" Value="#202020" /> <Setter Property="Background" Value="#202020" />
</Style> </Style>
<Style x:Key="WindowStyle" BasedOn="{StaticResource BaseWindowStyle}" TargetType="{x:Type Window}"> <Style
x:Key="WindowStyle"
BasedOn="{StaticResource BaseWindowStyle}"
TargetType="{x:Type Window}">
<Setter Property="Width" Value="576" /> <Setter Property="Width" Value="576" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/> <Setter Property="RenderOptions.ClearTypeHint" Value="Enabled" />
</Style> </Style>
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}"> <Style
x:Key="PendingLineStyle"
BasedOn="{StaticResource BasePendingLineStyle}"
TargetType="{x:Type Line}">
<Setter Property="Stroke" Value="White" /> <Setter Property="Stroke" Value="White" />
</Style> </Style>
<!-- Item Style --> <!-- Item Style -->
<Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}"> <Style
x:Key="ItemTitleStyle"
BasedOn="{StaticResource BaseItemTitleStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" /> <Setter Property="Foreground" Value="#ffffff" />
</Style> </Style>
<Style x:Key="ItemSubTitleStyle" BasedOn="{StaticResource BaseItemSubTitleStyle}" TargetType="{x:Type TextBlock}" > <Style
x:Key="ItemSubTitleStyle"
BasedOn="{StaticResource BaseItemSubTitleStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#7b7b7b" /> <Setter Property="Foreground" Value="#7b7b7b" />
<Setter Property="FontSize" Value="13" /> <Setter Property="FontSize" Value="13" />
<Setter Property="FontWeight" Value="Regular" /> <Setter Property="FontWeight" Value="Regular" />
</Style> </Style>
<Style x:Key="ItemNumberStyle" BasedOn="{StaticResource BaseItemNumberStyle}" TargetType="{x:Type TextBlock}"> <Style
x:Key="ItemNumberStyle"
BasedOn="{StaticResource BaseItemNumberStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" /> <Setter Property="Foreground" Value="#ffffff" />
</Style> </Style>
<Style x:Key="ItemTitleSelectedStyle" BasedOn="{StaticResource BaseItemTitleSelectedStyle}" TargetType="{x:Type TextBlock}" > <Style
x:Key="ItemTitleSelectedStyle"
BasedOn="{StaticResource BaseItemTitleSelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Cursor" Value="Arrow" /> <Setter Property="Cursor" Value="Arrow" />
<Setter Property="Foreground" Value="#ffffff" /> <Setter Property="Foreground" Value="#ffffff" />
</Style> </Style>
<Style x:Key="ItemSubTitleSelectedStyle" BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}" TargetType="{x:Type TextBlock}" > <Style
x:Key="ItemSubTitleSelectedStyle"
BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Cursor" Value="Arrow" /> <Setter Property="Cursor" Value="Arrow" />
<Setter Property="Foreground" Value="#7b7b7b" /> <Setter Property="Foreground" Value="#7b7b7b" />
<Setter Property="FontSize" Value="13" /> <Setter Property="FontSize" Value="13" />
<Setter Property="FontWeight" Value="Regular" /> <Setter Property="FontWeight" Value="Regular" />
</Style> </Style>
<SolidColorBrush x:Key="ItemSelectedBackgroundColor">#2d2d2d</SolidColorBrush> <SolidColorBrush x:Key="ItemSelectedBackgroundColor">#198F8F8F</SolidColorBrush>
<Style x:Key="ItemImageSelectedStyle" BasedOn="{StaticResource BaseItemImageSelectedStyle}" TargetType="{x:Type Image}" > <Style
x:Key="ItemImageSelectedStyle"
BasedOn="{StaticResource BaseItemImageSelectedStyle}"
TargetType="{x:Type Image}">
<Setter Property="Cursor" Value="Arrow" /> <Setter Property="Cursor" Value="Arrow" />
</Style> </Style>
<Style x:Key="HighlightStyle"> <Style x:Key="HighlightStyle">
<Setter Property="Inline.FontWeight" Value="Bold" /> <Setter Property="Inline.Foreground" Value="#0078d7" />
</Style> </Style>
<Style x:Key="ItemHotkeyStyle" TargetType="{x:Type TextBlock}"> <Style x:Key="ItemHotkeyStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="13" /> <Setter Property="FontSize" Value="13" />
@ -76,29 +113,45 @@
<Setter Property="FontSize" Value="13" /> <Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="#7b7b7b" /> <Setter Property="Foreground" Value="#7b7b7b" />
</Style> </Style>
<!-- button style in the middle of the scrollbar --> <!-- button style in the middle of the scrollbar -->
<Style x:Key="ThumbStyle" BasedOn="{StaticResource BaseThumbStyle}" TargetType="{x:Type Thumb}"> <Style
<Setter Property="SnapsToDevicePixels" Value="True"/> x:Key="ThumbStyle"
<Setter Property="OverridesDefaultStyle" Value="true"/> BasedOn="{StaticResource BaseThumbStyle}"
<Setter Property="IsTabStop" Value="false"/> TargetType="{x:Type Thumb}">
<Setter Property="Width" Value="2"/> <Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Focusable" Value="false"/> <Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Width" Value="2" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}"> <ControlTemplate TargetType="{x:Type Thumb}">
<Border CornerRadius="2" DockPanel.Dock="Right" Background="#9a9a9a" BorderBrush="Transparent" BorderThickness="0" /> <Border
Background="#9a9a9a"
BorderBrush="Transparent"
BorderThickness="0"
CornerRadius="2"
DockPanel.Dock="Right" />
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<Style x:Key="ScrollBarStyle" BasedOn="{StaticResource BaseScrollBarStyle}" TargetType="{x:Type ScrollBar}"> <Style
x:Key="ScrollBarStyle"
BasedOn="{StaticResource BaseScrollBarStyle}"
TargetType="{x:Type ScrollBar}" />
<Style
x:Key="SeparatorStyle"
BasedOn="{StaticResource BaseSeparatorStyle}"
TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="#4d4d4d" />
<Setter Property="Height" Value="1" />
<Setter Property="Margin" Value="12,0,12,8" />
</Style> </Style>
<Style x:Key="SeparatorStyle" BasedOn="{StaticResource BaseSeparatorStyle}" TargetType="{x:Type Rectangle}"> <Style
<Setter Property="Fill" Value="#4d4d4d"/> x:Key="SearchIconStyle"
<Setter Property="Height" Value="1"/> BasedOn="{StaticResource BaseSearchIconStyle}"
<Setter Property="Margin" Value="12 0 12 8"/> TargetType="{x:Type Path}">
</Style>
<Style x:Key="SearchIconStyle" TargetType="{x:Type Path}" BasedOn="{StaticResource BaseSearchIconStyle}">
<Setter Property="Fill" Value="#4d4d4d" /> <Setter Property="Fill" Value="#4d4d4d" />
<Setter Property="Width" Value="32" /> <Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" /> <Setter Property="Height" Value="32" />

View file

@ -57,7 +57,7 @@
<Setter Property="Cursor" Value="Arrow" /> <Setter Property="Cursor" Value="Arrow" />
<Setter Property="Foreground" Value="#72767d" /> <Setter Property="Foreground" Value="#72767d" />
</Style> </Style>
<SolidColorBrush x:Key="ItemSelectedBackgroundColor">#eaeaea</SolidColorBrush> <SolidColorBrush x:Key="ItemSelectedBackgroundColor">#198F8F8F</SolidColorBrush>
<Style x:Key="ItemImageSelectedStyle" BasedOn="{StaticResource BaseItemImageSelectedStyle}" TargetType="{x:Type Image}" > <Style x:Key="ItemImageSelectedStyle" BasedOn="{StaticResource BaseItemImageSelectedStyle}" TargetType="{x:Type Image}" >
<Setter Property="Cursor" Value="Arrow" /> <Setter Property="Cursor" Value="Arrow" />
</Style> </Style>

View file

@ -0,0 +1,159 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="http://schemas.modernwpf.com/2019"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style
x:Key="ItemGlyph"
BasedOn="{StaticResource BaseGlyphStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
</Style>
<Style
x:Key="QueryBoxStyle"
BasedOn="{StaticResource BaseQueryBoxStyle}"
TargetType="{x:Type TextBox}">
<Setter Property="SelectionBrush" Value="{DynamicResource QuerySelectionBrush}" />
<Setter Property="FontSize" Value="24" />
<Setter Property="Background" Value="{DynamicResource Color01B}" />
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
<Setter Property="CaretBrush" Value="{DynamicResource Color05B}" />
<Setter Property="FontSize" Value="26" />
<Setter Property="Padding" Value="0,4,66,0" />
<Setter Property="Height" Value="42" />
</Style>
<Style
x:Key="QuerySuggestionBoxStyle"
BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}"
TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="{DynamicResource Color01B}" />
<Setter Property="Foreground" Value="{DynamicResource QuerySuggestionBoxForeground}" />
<Setter Property="FontSize" Value="26" />
<Setter Property="Padding" Value="0,4,66,0" />
<Setter Property="Height" Value="42" />
</Style>
<Style
x:Key="WindowBorderStyle"
BasedOn="{StaticResource BaseWindowBorderStyle}"
TargetType="{x:Type Border}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="{DynamicResource SystemThemeBorder}" />
<Setter Property="CornerRadius" Value="5" />
<Setter Property="Background" Value="{DynamicResource Color01B}" />
</Style>
<Style
x:Key="WindowStyle"
BasedOn="{StaticResource BaseWindowStyle}"
TargetType="{x:Type Window}">
<Setter Property="Width" Value="576" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled" />
</Style>
<Style
x:Key="PendingLineStyle"
BasedOn="{StaticResource BasePendingLineStyle}"
TargetType="{x:Type Line}" />
<!-- Item Style -->
<Style
x:Key="ItemTitleStyle"
BasedOn="{StaticResource BaseItemTitleStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
</Style>
<Style
x:Key="ItemSubTitleStyle"
BasedOn="{StaticResource BaseItemSubTitleStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="{DynamicResource SubTitleForeground}" />
<Setter Property="FontSize" Value="13" />
</Style>
<Style
x:Key="ItemNumberStyle"
BasedOn="{StaticResource BaseItemNumberStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#A6A6A6" />
</Style>
<Style
x:Key="ItemTitleSelectedStyle"
BasedOn="{StaticResource BaseItemTitleSelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Cursor" Value="Arrow" />
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
</Style>
<Style
x:Key="ItemSubTitleSelectedStyle"
BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Cursor" Value="Arrow" />
<Setter Property="Foreground" Value="{DynamicResource SubTitleSelectedForeground}" />
</Style>
<SolidColorBrush x:Key="ItemSelectedBackgroundColor" Color="{m:DynamicColor ItemSelectedBackgroundColorBrush}" />
<Style
x:Key="ItemImageSelectedStyle"
BasedOn="{StaticResource BaseItemImageSelectedStyle}"
TargetType="{x:Type Image}">
<Setter Property="Cursor" Value="Arrow" />
</Style>
<Style x:Key="HighlightStyle">
<Setter Property="Inline.Foreground" Value="{DynamicResource InlineHighlight}" />
</Style>
<Style x:Key="ItemHotkeyStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="{DynamicResource HotkeyForeground}" />
</Style>
<Style
x:Key="ItemHotkeySelectedStyle"
BasedOn="{StaticResource BaseItemHotkeySelecetedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="{DynamicResource HotkeySelectedForeground}" />
</Style>
<!-- button style in the middle of the scrollbar -->
<Style
x:Key="ThumbStyle"
BasedOn="{StaticResource BaseThumbStyle}"
TargetType="{x:Type Thumb}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Width" Value="2" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border
Background="{DynamicResource ThumbColor}"
BorderBrush="Transparent"
BorderThickness="0"
CornerRadius="2"
DockPanel.Dock="Right" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style
x:Key="ScrollBarStyle"
BasedOn="{StaticResource BaseScrollBarStyle}"
TargetType="{x:Type ScrollBar}" />
<Style
x:Key="SeparatorStyle"
BasedOn="{StaticResource BaseSeparatorStyle}"
TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="{DynamicResource SeparatorForeground}" />
<Setter Property="Height" Value="1" />
<Setter Property="Margin" Value="12,0,12,8" />
</Style>
<Style
x:Key="SearchIconStyle"
BasedOn="{StaticResource BaseSearchIconStyle}"
TargetType="{x:Type Path}">
<Setter Property="Fill" Value="{DynamicResource SearchIconForeground}" />
<Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" />
<Setter Property="Opacity" Value="1" />
</Style>
</ResourceDictionary>

View file

@ -3,8 +3,8 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
using System.Windows; using System.Windows;
using System.Windows.Media;
using System.Windows.Input; using System.Windows.Input;
using Flow.Launcher.Core.Plugin; using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Core.Resource; using Flow.Launcher.Core.Resource;
@ -20,8 +20,6 @@ using Flow.Launcher.Infrastructure.Logger;
using Microsoft.VisualStudio.Threading; using Microsoft.VisualStudio.Threading;
using System.Threading.Channels; using System.Threading.Channels;
using ISavable = Flow.Launcher.Plugin.ISavable; using ISavable = Flow.Launcher.Plugin.ISavable;
using System.Windows.Threading;
using NHotkey;
namespace Flow.Launcher.ViewModel namespace Flow.Launcher.ViewModel
@ -63,6 +61,13 @@ namespace Flow.Launcher.ViewModel
_lastQuery = new Query(); _lastQuery = new Query();
_settings = settings; _settings = settings;
_settings.PropertyChanged += (_, args) =>
{
if (args.PropertyName == nameof(Settings.WindowSize))
{
OnPropertyChanged(nameof(MainWindowWidth));
}
};
_historyItemsStorage = new FlowLauncherJsonStorage<History>(); _historyItemsStorage = new FlowLauncherJsonStorage<History>();
_userSelectedRecordStorage = new FlowLauncherJsonStorage<UserSelectedRecord>(); _userSelectedRecordStorage = new FlowLauncherJsonStorage<UserSelectedRecord>();
@ -149,25 +154,6 @@ namespace Flow.Launcher.ViewModel
} }
} }
private void UpdateLastQUeryMode()
{
switch (_settings.LastQueryMode)
{
case LastQueryMode.Empty:
ChangeQueryText(string.Empty);
break;
case LastQueryMode.Preserved:
LastQuerySelected = true;
break;
case LastQueryMode.Selected:
LastQuerySelected = false;
break;
default:
throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>");
}
}
private void InitializeKeyCommands() private void InitializeKeyCommands()
{ {
EscCommand = new RelayCommand(_ => EscCommand = new RelayCommand(_ =>
@ -207,7 +193,7 @@ namespace Flow.Launcher.ViewModel
{ {
SearchWeb.NewTabInBrowser("https://github.com/Flow-Launcher/Flow.Launcher/wiki/Flow-Launcher/"); SearchWeb.NewTabInBrowser("https://github.com/Flow-Launcher/Flow.Launcher/wiki/Flow-Launcher/");
}); });
OpenSettingCommand = new RelayCommand(_ => { App.API.OpenSettingDialog(); });
OpenResultCommand = new RelayCommand(index => OpenResultCommand = new RelayCommand(index =>
{ {
var results = SelectedResults; var results = SelectedResults;
@ -273,7 +259,7 @@ namespace Flow.Launcher.ViewModel
ReloadPluginDataCommand = new RelayCommand(_ => ReloadPluginDataCommand = new RelayCommand(_ =>
{ {
Hide(); Hide();
PluginManager PluginManager
.ReloadData() .ReloadData()
.ContinueWith(_ => .ContinueWith(_ =>
@ -293,9 +279,13 @@ namespace Flow.Launcher.ViewModel
#region ViewModel Properties #region ViewModel Properties
public ResultsViewModel Results { get; private set; } public ResultsViewModel Results { get; private set; }
public ResultsViewModel ContextMenu { get; private set; } public ResultsViewModel ContextMenu { get; private set; }
public ResultsViewModel History { get; private set; } public ResultsViewModel History { get; private set; }
public bool GameModeStatus { get; set; }
private string _queryText; private string _queryText;
public string QueryText public string QueryText
@ -315,7 +305,7 @@ namespace Flow.Launcher.ViewModel
/// <param name="queryText"></param> /// <param name="queryText"></param>
public void ChangeQueryText(string queryText, bool reQuery = false) public void ChangeQueryText(string queryText, bool reQuery = false)
{ {
if (QueryText!=queryText) if (QueryText != queryText)
{ {
// re-query is done in QueryText's setter method // re-query is done in QueryText's setter method
QueryText = queryText; QueryText = queryText;
@ -372,6 +362,13 @@ namespace Flow.Launcher.ViewModel
public Visibility ProgressBarVisibility { get; set; } public Visibility ProgressBarVisibility { get; set; }
public Visibility MainWindowVisibility { get; set; } public Visibility MainWindowVisibility { get; set; }
public double MainWindowOpacity { get; set; } = 1;
// This is to be used for determining the visibility status of the mainwindow instead of MainWindowVisibility
// because it is more accurate and reliable representation than using Visibility as a condition check
public bool MainWindowVisibilityStatus { get; set; } = true;
public double MainWindowWidth => _settings.WindowSize;
public ICommand EscCommand { get; set; } public ICommand EscCommand { get; set; }
public ICommand SelectNextItemCommand { get; set; } public ICommand SelectNextItemCommand { get; set; }
@ -383,6 +380,7 @@ namespace Flow.Launcher.ViewModel
public ICommand LoadContextMenuCommand { get; set; } public ICommand LoadContextMenuCommand { get; set; }
public ICommand LoadHistoryCommand { get; set; } public ICommand LoadHistoryCommand { get; set; }
public ICommand OpenResultCommand { get; set; } public ICommand OpenResultCommand { get; set; }
public ICommand OpenSettingCommand { get; set; }
public ICommand ReloadPluginDataCommand { get; set; } public ICommand ReloadPluginDataCommand { get; set; }
public ICommand ClearQueryCommand { get; private set; } public ICommand ClearQueryCommand { get; private set; }
@ -696,41 +694,64 @@ namespace Flow.Launcher.ViewModel
OpenResultCommandModifiers = _settings.OpenResultModifiers ?? DefaultOpenResultModifiers; OpenResultCommandModifiers = _settings.OpenResultModifiers ?? DefaultOpenResultModifiers;
} }
public async void ToggleFlowLauncher() public void ToggleFlowLauncher()
{ {
if (MainWindowVisibility != Visibility.Visible) if (!MainWindowVisibilityStatus)
{ {
MainWindowVisibility = Visibility.Visible; Show();
} }
else else
{ {
switch (_settings.LastQueryMode) Hide();
{
case LastQueryMode.Empty:
ChangeQueryText(string.Empty);
Application.Current.MainWindow.Opacity = 0; // Trick for no delay
await Task.Delay(100);
Application.Current.MainWindow.Opacity = 1;
break;
case LastQueryMode.Preserved:
LastQuerySelected = true;
break;
case LastQueryMode.Selected:
LastQuerySelected = false;
break;
default:
throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>");
}
MainWindowVisibility = Visibility.Collapsed;
} }
} }
public void Hide() public void Show()
{ {
if (MainWindowVisibility != Visibility.Collapsed) if (_settings.UseSound)
{ {
ToggleFlowLauncher(); MediaPlayer media = new MediaPlayer();
media.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"));
media.Play();
} }
MainWindowVisibility = Visibility.Visible;
MainWindowVisibilityStatus = true;
if(_settings.UseAnimation)
((MainWindow)Application.Current.MainWindow).WindowAnimator();
MainWindowOpacity = 1;
}
public async void Hide()
{
// Trick for no delay
MainWindowOpacity = 0;
switch (_settings.LastQueryMode)
{
case LastQueryMode.Empty:
ChangeQueryText(string.Empty);
await Task.Delay(100); //Time for change to opacity
break;
case LastQueryMode.Preserved:
if (_settings.UseAnimation)
await Task.Delay(100);
LastQuerySelected = true;
break;
case LastQueryMode.Selected:
if (_settings.UseAnimation)
await Task.Delay(100);
LastQuerySelected = false;
break;
default:
throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>");
}
MainWindowVisibilityStatus = false;
MainWindowVisibility = Visibility.Collapsed;
} }
#endregion #endregion

View file

@ -15,7 +15,6 @@ using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Core.Resource; using Flow.Launcher.Core.Resource;
using Flow.Launcher.Helper; using Flow.Launcher.Helper;
using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Image;
using Flow.Launcher.Infrastructure.Storage; using Flow.Launcher.Infrastructure.Storage;
using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin; using Flow.Launcher.Plugin;
@ -37,9 +36,11 @@ namespace Flow.Launcher.ViewModel
Settings = _storage.Load(); Settings = _storage.Load();
Settings.PropertyChanged += (s, e) => Settings.PropertyChanged += (s, e) =>
{ {
if (e.PropertyName == nameof(Settings.ActivateTimes)) switch (e.PropertyName)
{ {
OnPropertyChanged(nameof(ActivatedTimes)); case nameof(Settings.ActivateTimes):
OnPropertyChanged(nameof(ActivatedTimes));
break;
} }
}; };
} }
@ -53,7 +54,7 @@ namespace Flow.Launcher.ViewModel
public bool AutoUpdates public bool AutoUpdates
{ {
get { return Settings.AutoUpdates; } get => Settings.AutoUpdates;
set set
{ {
Settings.AutoUpdates = value; Settings.AutoUpdates = value;
@ -67,7 +68,7 @@ namespace Flow.Launcher.ViewModel
private bool _portableMode = DataLocation.PortableDataLocationInUse(); private bool _portableMode = DataLocation.PortableDataLocationInUse();
public bool PortableMode public bool PortableMode
{ {
get { return _portableMode; } get => _portableMode;
set set
{ {
if (!_portable.CanUpdatePortability()) if (!_portable.CanUpdatePortability())
@ -272,7 +273,7 @@ namespace Flow.Launcher.ViewModel
#region theme #region theme
public static string Theme => @"http://www.wox.one/theme/builder"; public static string Theme => @"https://flow-launcher.github.io/docs/#/how-to-create-a-theme";
public string SelectedTheme public string SelectedTheme
{ {
@ -314,10 +315,51 @@ namespace Flow.Launcher.ViewModel
} }
} }
public class ColorScheme
{
public string Display { get; set; }
public ColorSchemes Value { get; set; }
}
public List<ColorScheme> ColorSchemes
{
get
{
List<ColorScheme> modes = new List<ColorScheme>();
var enums = (ColorSchemes[])Enum.GetValues(typeof(ColorSchemes));
foreach (var e in enums)
{
var key = $"ColorScheme{e}";
var display = _translater.GetTranslation(key);
var m = new ColorScheme { Display = display, Value = e, };
modes.Add(m);
}
return modes;
}
}
public double WindowWidthSize
{
get => Settings.WindowSize;
set => Settings.WindowSize = value;
}
public bool UseGlyphIcons public bool UseGlyphIcons
{ {
get { return Settings.UseGlyphIcons; } get => Settings.UseGlyphIcons;
set { Settings.UseGlyphIcons = value; } set => Settings.UseGlyphIcons = value;
}
public bool UseAnimation
{
get => Settings.UseAnimation;
set => Settings.UseAnimation = value;
}
public bool UseSound
{
get => Settings.UseSound;
set => Settings.UseSound = value;
} }
public Brush PreviewBackground public Brush PreviewBackground
@ -486,6 +528,8 @@ namespace Flow.Launcher.ViewModel
public string Website => Constant.Website; public string Website => Constant.Website;
public string ReleaseNotes => _updater.GitHubRepository + @"/releases/latest"; public string ReleaseNotes => _updater.GitHubRepository + @"/releases/latest";
public string Documentation => Constant.Documentation; public string Documentation => Constant.Documentation;
public string Docs => Constant.Docs;
public string Github => Constant.GitHub;
public static string Version => Constant.Version; public static string Version => Constant.Version;
public string ActivatedTimes => string.Format(_translater.GetTranslation("about_activate_times"), Settings.ActivateTimes); public string ActivatedTimes => string.Format(_translater.GetTranslation("about_activate_times"), Settings.ActivateTimes);
#endregion #endregion

View file

@ -26,7 +26,7 @@ namespace Flow.Launcher.Plugin.BrowserBookmark
} }
return bookmarks; return bookmarks;
} }
protected List<Bookmark> LoadBookmarksFromFile(string path, string source) protected List<Bookmark> LoadBookmarksFromFile(string path, string source)
{ {
if (!File.Exists(path)) if (!File.Exists(path))
@ -44,7 +44,9 @@ namespace Flow.Launcher.Plugin.BrowserBookmark
private void EnumerateFolderBookmark(JsonElement folderElement, List<Bookmark> bookmarks, string source) private void EnumerateFolderBookmark(JsonElement folderElement, List<Bookmark> bookmarks, string source)
{ {
foreach (var subElement in folderElement.GetProperty("children").EnumerateArray()) if (!folderElement.TryGetProperty("children", out var childrenElement))
return;
foreach (var subElement in childrenElement.EnumerateArray())
{ {
switch (subElement.GetProperty("type").GetString()) switch (subElement.GetProperty("type").GetString())
{ {

View file

@ -14,7 +14,7 @@
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_choose">Prehliadať</system:String> <system:String x:Key="flowlauncher_plugin_browserbookmark_settings_choose">Prehliadať</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_copyurl_title">Kopírovať URL</system:String> <system:String x:Key="flowlauncher_plugin_browserbookmark_copyurl_title">Kopírovať URL</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_copyurl_subtitle">Kopírovať URL záložky do schránky</system:String> <system:String x:Key="flowlauncher_plugin_browserbookmark_copyurl_subtitle">Kopírovať URL záložky do schránky</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_loadBrowserFrom" >Načítať prehliadač z:</system:String> <system:String x:Key="flowlauncher_plugin_browserbookmark_loadBrowserFrom">Načítať prehliadač z:</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_browserName">Názov prehliadača</system:String> <system:String x:Key="flowlauncher_plugin_browserbookmark_browserName">Názov prehliadača</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_browserBookDataDirectory">Umiestnenie priečinka Data</system:String> <system:String x:Key="flowlauncher_plugin_browserbookmark_browserBookDataDirectory">Umiestnenie priečinka Data</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_addBrowserBookmark">Pridať</system:String> <system:String x:Key="flowlauncher_plugin_browserbookmark_addBrowserBookmark">Pridať</system:String>

View file

@ -1,72 +1,106 @@
<UserControl x:Class="Flow.Launcher.Plugin.BrowserBookmark.Views.SettingsControl" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="Flow.Launcher.Plugin.BrowserBookmark.Views.SettingsControl"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Background="White" d:DesignHeight="300"
d:DesignHeight="300" d:DesignWidth="500" d:DesignWidth="500"
DataContext="{Binding RelativeSource={RelativeSource Self}}"> DataContext="{Binding RelativeSource={RelativeSource Self}}"
mc:Ignorable="d">
<Grid Margin="10"> <Grid Margin="10">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="50" /> <RowDefinition Height="50" />
<RowDefinition Height="80"/> <RowDefinition Height="80" />
<RowDefinition Height="auto"/> <RowDefinition Height="auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel> <StackPanel>
<Grid Grid.Row="0" Margin="30 20 0 0"> <Grid Grid.Row="0" Margin="30,20,0,0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="160" /> <ColumnDefinition Width="160" />
<ColumnDefinition Width="140"/> <ColumnDefinition Width="140" />
<ColumnDefinition Width="100"/> <ColumnDefinition Width="100" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Grid.Column="0" Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_openBookmarks}" <Label
FontSize="15" Margin="10 5 0 0"/> Grid.Column="0"
<RadioButton Grid.Column="1" Name="NewWindowBrowser" Margin="10,5,0,0"
IsChecked="{Binding OpenInNewBrowserWindow}" Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_openBookmarks}"
Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_newWindow}"/> FontSize="15" />
<RadioButton Grid.Column="2" Name="NewTabInBrowser" <RadioButton
IsChecked="{Binding OpenInNewTab, Mode=OneTime}" Name="NewWindowBrowser"
Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_newTab}"/> Grid.Column="1"
Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_newWindow}"
IsChecked="{Binding OpenInNewBrowserWindow}" />
<RadioButton
Name="NewTabInBrowser"
Grid.Column="2"
Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_newTab}"
IsChecked="{Binding OpenInNewTab, Mode=OneTime}" />
</Grid> </Grid>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" Grid.Row="1" Height="60" Margin="30,20,0,0"> <StackPanel
<Label Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_setBrowserFromPath}" Grid.Row="1"
Height="28" Margin="10"/> Height="60"
<TextBox x:Name="BrowserPathBox" Margin="30,20,0,0"
HorizontalAlignment="Left" VerticalAlignment="Top"
Height="30" Orientation="Horizontal">
TextWrapping="NoWrap" <Label
VerticalAlignment="Center" Height="28"
Text="{Binding Settings.BrowserPath}" Margin="10"
Width="240" Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_setBrowserFromPath}" />
Margin="10"/> <TextBox
<Button x:Name="ViewButton" Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_choose}" x:Name="BrowserPathBox"
HorizontalAlignment="Left" Margin="10" Width="100" Height="30" Click="OnChooseClick" FontSize="14" /> Width="240"
Height="34"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Text="{Binding Settings.BrowserPath}"
TextWrapping="NoWrap" />
<Button
x:Name="ViewButton"
Width="100"
Height="30"
Margin="10"
HorizontalAlignment="Left"
Click="OnChooseClick"
Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_choose}"
FontSize="14" />
</StackPanel> </StackPanel>
<StackPanel Grid.Row="2" Orientation="Vertical" Margin="30,20,0,0"> <StackPanel
<TextBlock Text="{DynamicResource flowlauncher_plugin_browserbookmark_loadBrowserFrom}" Margin="10"/> Grid.Row="2"
<ListView Grid.Row="2" ItemsSource="{Binding Settings.CustomChromiumBrowsers}" Margin="30,20,0,0"
SelectedItem="{Binding SelectedCustomBrowser}" Orientation="Vertical">
Margin="10" <TextBlock Margin="10" Text="{DynamicResource flowlauncher_plugin_browserbookmark_loadBrowserFrom}" />
BorderBrush="DarkGray" <ListView
BorderThickness="1" Name="CustomBrowsers"
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}" Grid.Row="2"
Height="auto" Height="auto"
Name="CustomBrowsers" Margin="10"
MouseDoubleClick="MouseDoubleClickOnSelectedCustomBrowser"> BorderBrush="DarkGray"
BorderThickness="1"
ItemsSource="{Binding Settings.CustomChromiumBrowsers}"
MouseDoubleClick="MouseDoubleClickOnSelectedCustomBrowser"
SelectedItem="{Binding SelectedCustomBrowser}"
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
<ListView.View> <ListView.View>
<GridView> <GridView>
<GridViewColumn DisplayMemberBinding="{Binding Name, Mode=OneWay}" Header="{DynamicResource flowlauncher_plugin_browserbookmark_browserName}"/> <GridViewColumn DisplayMemberBinding="{Binding Name, Mode=OneWay}" Header="{DynamicResource flowlauncher_plugin_browserbookmark_browserName}" />
<GridViewColumn DisplayMemberBinding="{Binding DataDirectoryPath, Mode=OneWay}" Header="{DynamicResource flowlauncher_plugin_browserbookmark_browserBookmarkDataDirectory}"/> <GridViewColumn DisplayMemberBinding="{Binding DataDirectoryPath, Mode=OneWay}" Header="{DynamicResource flowlauncher_plugin_browserbookmark_browserBookmarkDataDirectory}" />
</GridView> </GridView>
</ListView.View> </ListView.View>
</ListView> </ListView>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button Content="{DynamicResource flowlauncher_plugin_browserbookmark_addBrowserBookmark}" <Button
Margin="10" Click="NewCustomBrowser" Width="80" /> Width="80"
<Button Content="{DynamicResource flowlauncher_plugin_browserbookmark_removeBrowserBookmark}" Margin="10"
Margin="10" Click="DeleteCustomBrowser" Width="80"/> Click="NewCustomBrowser"
Content="{DynamicResource flowlauncher_plugin_browserbookmark_addBrowserBookmark}" />
<Button
Width="80"
Margin="10"
Click="DeleteCustomBrowser"
Content="{DynamicResource flowlauncher_plugin_browserbookmark_removeBrowserBookmark}" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</Grid> </Grid>

View file

@ -4,7 +4,7 @@
"Name": "Browser Bookmarks", "Name": "Browser Bookmarks",
"Description": "Search your browser bookmarks", "Description": "Search your browser bookmarks",
"Author": "qianlifeng, Ioannis G.", "Author": "qianlifeng, Ioannis G.",
"Version": "1.5.2", "Version": "1.5.3",
"Language": "csharp", "Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher", "Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.BrowserBookmark.dll", "ExecuteFileName": "Flow.Launcher.Plugin.BrowserBookmark.dll",

View file

@ -230,7 +230,7 @@ namespace Flow.Launcher.Plugin.Explorer
{ {
try try
{ {
FilesFolders.OpenContainingFolder(record.FullPath); Context.API.OpenDirectory(Path.GetDirectoryName(record.FullPath), record.FullPath);
} }
catch (Exception e) catch (Exception e)
{ {

View file

@ -34,7 +34,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
{ {
try try
{ {
FilesFolders.OpenPath(path); Context.API.OpenDirectory(path);
return true; return true;
} }
catch (Exception ex) catch (Exception ex)
@ -101,7 +101,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
Score = 500, Score = 500,
Action = c => Action = c =>
{ {
FilesFolders.OpenPath(retrievedDirectoryPath); Context.API.OpenDirectory(retrievedDirectoryPath);
return true; return true;
}, },
TitleToolTip = retrievedDirectoryPath, TitleToolTip = retrievedDirectoryPath,
@ -150,7 +150,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
} }
else if (c.SpecialKeyState.CtrlPressed) else if (c.SpecialKeyState.CtrlPressed)
{ {
FilesFolders.OpenContainingFolder(filePath); Context.API.OpenDirectory(Path.GetDirectoryName(filePath), filePath);
} }
else else
{ {

View file

@ -205,7 +205,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex
} }
var mainWindow = Application.Current.MainWindow; var mainWindow = Application.Current.MainWindow;
mainWindow.Visibility = Visibility.Visible; mainWindow.Show();
mainWindow.Focus(); mainWindow.Focus();
return false; return false;

View file

@ -10,7 +10,7 @@
"Name": "Explorer", "Name": "Explorer",
"Description": "Search and manage files and folders. Explorer utilises Windows Index Search", "Description": "Search and manage files and folders. Explorer utilises Windows Index Search",
"Author": "Jeremy Wu", "Author": "Jeremy Wu",
"Version": "1.9.1", "Version": "1.10.1",
"Language": "csharp", "Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher", "Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll", "ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll",

View file

@ -4,13 +4,16 @@
<!--Dialogues--> <!--Dialogues-->
<system:String x:Key="plugin_pluginsmanager_downloading_plugin">Downloading plugin</system:String> <system:String x:Key="plugin_pluginsmanager_downloading_plugin">Downloading plugin</system:String>
<system:String x:Key="plugin_pluginsmanager_please_wait">Please wait...</system:String>
<system:String x:Key="plugin_pluginsmanager_download_success">Successfully downloaded</system:String> <system:String x:Key="plugin_pluginsmanager_download_success">Successfully downloaded</system:String>
<system:String x:Key="plugin_pluginsmanager_download_error">Error: Unable to download the plugin</system:String>
<system:String x:Key="plugin_pluginsmanager_uninstall_prompt">{0} by {1} {2}{3}Would you like to uninstall this plugin? After the uninstallation Flow will automatically restart.</system:String> <system:String x:Key="plugin_pluginsmanager_uninstall_prompt">{0} by {1} {2}{3}Would you like to uninstall this plugin? After the uninstallation Flow will automatically restart.</system:String>
<system:String x:Key="plugin_pluginsmanager_install_prompt">{0} by {1} {2}{3}Would you like to install this plugin? After the installation Flow will automatically restart.</system:String> <system:String x:Key="plugin_pluginsmanager_install_prompt">{0} by {1} {2}{3}Would you like to install this plugin? After the installation Flow will automatically restart.</system:String>
<system:String x:Key="plugin_pluginsmanager_install_title">Plugin Install</system:String> <system:String x:Key="plugin_pluginsmanager_install_title">Plugin Install</system:String>
<system:String x:Key="plugin_pluginsmanager_install_from_web">Download and install {0}</system:String>
<system:String x:Key="plugin_pluginsmanager_uninstall_title">Plugin Uninstall</system:String> <system:String x:Key="plugin_pluginsmanager_uninstall_title">Plugin Uninstall</system:String>
<system:String x:Key="plugin_pluginsmanager_install_errormetadatafile">Install failed: unable to find the plugin.json metadata file from the new plugin</system:String> <system:String x:Key="plugin_pluginsmanager_install_success_restart">Plugin successfully installed. Restarting Flow, please wait...</system:String>
<system:String x:Key="plugin_pluginsmanager_install_errormetadatafile">Unable to find the plugin.json metadata file from the extracted zip file.</system:String>
<system:String x:Key="plugin_pluginsmanager_install_error_duplicate">Error: A plugin which has the same or greater version with {0} already exists.</system:String>
<system:String x:Key="plugin_pluginsmanager_install_error_title">Error installing plugin</system:String> <system:String x:Key="plugin_pluginsmanager_install_error_title">Error installing plugin</system:String>
<system:String x:Key="plugin_pluginsmanager_install_error_subtitle">Error occured while trying to install {0}</system:String> <system:String x:Key="plugin_pluginsmanager_install_error_subtitle">Error occured while trying to install {0}</system:String>
<system:String x:Key="plugin_pluginsmanager_update_noresult_title">No update available</system:String> <system:String x:Key="plugin_pluginsmanager_update_noresult_title">No update available</system:String>
@ -21,12 +24,15 @@
<system:String x:Key="plugin_pluginsmanager_update_alreadyexists">This plugin is already installed</system:String> <system:String x:Key="plugin_pluginsmanager_update_alreadyexists">This plugin is already installed</system:String>
<system:String x:Key="plugin_pluginsmanager_update_failed_title">Plugin Manifest Download Failed</system:String> <system:String x:Key="plugin_pluginsmanager_update_failed_title">Plugin Manifest Download Failed</system:String>
<system:String x:Key="plugin_pluginsmanager_update_failed_subtitle">Please check if you can connect to github.com. This error means you may not be able to install or update plugins.</system:String> <system:String x:Key="plugin_pluginsmanager_update_failed_subtitle">Please check if you can connect to github.com. This error means you may not be able to install or update plugins.</system:String>
<system:String x:Key="plugin_pluginsmanager_install_unknown_source_warning_title">Installing from an unknown source</system:String>
<system:String x:Key="plugin_pluginsmanager_install_unknown_source_warning">You are installing this plugin from an unknown source and it may contain potential risks!{0}{0}Please ensure you understand where this plugin is from and that it is safe.{0}{0}Would you like to continue still?{0}{0}(You can switch off this warning via settings)</system:String>
<!--Controls--> <!--Controls-->
<!--Plugin Infos--> <!--Plugin Infos-->
<system:String x:Key="plugin_pluginsmanager_plugin_name">Plugins Manager</system:String> <system:String x:Key="plugin_pluginsmanager_plugin_name">Plugins Manager</system:String>
<system:String x:Key="plugin_pluginsmanager_plugin_description">Management of installing, uninstalling or updating Flow Launcher plugins</system:String> <system:String x:Key="plugin_pluginsmanager_plugin_description">Management of installing, uninstalling or updating Flow Launcher plugins</system:String>
<system:String x:Key="plugin_pluginsmanager_unknown_author">Unknown Author</system:String>
<!--Context menu items--> <!--Context menu items-->
<system:String x:Key="plugin_pluginsmanager_plugin_contextmenu_openwebsite_title">Open website</system:String> <system:String x:Key="plugin_pluginsmanager_plugin_contextmenu_openwebsite_title">Open website</system:String>
@ -36,6 +42,8 @@
<system:String x:Key="plugin_pluginsmanager_plugin_contextmenu_newissue_title">Suggest an enhancement or submit an issue</system:String> <system:String x:Key="plugin_pluginsmanager_plugin_contextmenu_newissue_title">Suggest an enhancement or submit an issue</system:String>
<system:String x:Key="plugin_pluginsmanager_plugin_contextmenu_newissue_subtitle">Suggest an enhancement or submit an issue to the plugin developer</system:String> <system:String x:Key="plugin_pluginsmanager_plugin_contextmenu_newissue_subtitle">Suggest an enhancement or submit an issue to the plugin developer</system:String>
<system:String x:Key="plugin_pluginsmanager_plugin_contextmenu_pluginsmanifest_title">Go to Flow's plugins repository</system:String> <system:String x:Key="plugin_pluginsmanager_plugin_contextmenu_pluginsmanifest_title">Go to Flow's plugins repository</system:String>
<system:String x:Key="plugin_pluginsmanager_plugin_contextmenu_pluginsmanifest_subtitle">Visit the PluginsManifest repository to see comunity-made plugin submissions</system:String> <system:String x:Key="plugin_pluginsmanager_plugin_contextmenu_pluginsmanifest_subtitle">Visit the PluginsManifest repository to see community-made plugin submissions</system:String>
<!--Settings menu items-->
<system:String x:Key="plugin_pluginsmanager_plugin_settings_unknown_source">Install from unknown source warning</system:String>
</ResourceDictionary> </ResourceDictionary>

View file

@ -4,7 +4,6 @@
<!--Dialogues--> <!--Dialogues-->
<system:String x:Key="plugin_pluginsmanager_downloading_plugin">Sťahovanie pluginu</system:String> <system:String x:Key="plugin_pluginsmanager_downloading_plugin">Sťahovanie pluginu</system:String>
<system:String x:Key="plugin_pluginsmanager_please_wait">Čakajte, prosím…</system:String>
<system:String x:Key="plugin_pluginsmanager_download_success">Úspešne stiahnuté</system:String> <system:String x:Key="plugin_pluginsmanager_download_success">Úspešne stiahnuté</system:String>
<system:String x:Key="plugin_pluginsmanager_uninstall_prompt">{0} od {1} {2}{3}Chcete odinštalovať tento plugin? Po odinštalovaní sa Flow automaticky reštartuje.</system:String> <system:String x:Key="plugin_pluginsmanager_uninstall_prompt">{0} od {1} {2}{3}Chcete odinštalovať tento plugin? Po odinštalovaní sa Flow automaticky reštartuje.</system:String>
<system:String x:Key="plugin_pluginsmanager_install_prompt">{0} by {1} {2}{3}Chcete nainštalovať tento plugin? Po nainštalovaní sa Flow automaticky reštartuje.</system:String> <system:String x:Key="plugin_pluginsmanager_install_prompt">{0} by {1} {2}{3}Chcete nainštalovať tento plugin? Po nainštalovaní sa Flow automaticky reštartuje.</system:String>

View file

@ -4,7 +4,6 @@
<!--Dialogues--> <!--Dialogues-->
<system:String x:Key="plugin_pluginsmanager_downloading_plugin">下载插件</system:String> <system:String x:Key="plugin_pluginsmanager_downloading_plugin">下载插件</system:String>
<system:String x:Key="plugin_pluginsmanager_please_wait">请稍等...</system:String>
<system:String x:Key="plugin_pluginsmanager_download_success">下载完成</system:String> <system:String x:Key="plugin_pluginsmanager_download_success">下载完成</system:String>
<system:String x:Key="plugin_pluginsmanager_uninstall_prompt">{0} by {1} {2}{3} 您要卸载此插件吗? 卸载后Flow Launcher 将自动重启。</system:String> <system:String x:Key="plugin_pluginsmanager_uninstall_prompt">{0} by {1} {2}{3} 您要卸载此插件吗? 卸载后Flow Launcher 将自动重启。</system:String>
<system:String x:Key="plugin_pluginsmanager_install_prompt">{0} by {1} {2}{3} 您要安装此插件吗? 安装后Flow Launcher 将自动重启</system:String> <system:String x:Key="plugin_pluginsmanager_install_prompt">{0} by {1} {2}{3} 您要安装此插件吗? 安装后Flow Launcher 将自动重启</system:String>

View file

@ -55,7 +55,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
public async Task<List<Result>> QueryAsync(Query query, CancellationToken token) public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
{ {
var search = query.Search.ToLower(); var search = query.Search;
if (string.IsNullOrWhiteSpace(search)) if (string.IsNullOrWhiteSpace(search))
return pluginManager.GetDefaultHotKeys(); return pluginManager.GetDefaultHotKeys();
@ -70,9 +70,13 @@ namespace Flow.Launcher.Plugin.PluginsManager
return search switch return search switch
{ {
var s when s.StartsWith(Settings.HotKeyInstall) => await pluginManager.RequestInstallOrUpdate(s, token), //search could be url, no need ToLower() when passed in
var s when s.StartsWith(Settings.HotkeyUninstall) => pluginManager.RequestUninstall(s), var s when s.StartsWith(Settings.HotKeyInstall, StringComparison.OrdinalIgnoreCase)
var s when s.StartsWith(Settings.HotkeyUpdate) => await pluginManager.RequestUpdate(s, token), => await pluginManager.RequestInstallOrUpdate(search, token),
var s when s.StartsWith(Settings.HotkeyUninstall, StringComparison.OrdinalIgnoreCase)
=> pluginManager.RequestUninstall(search),
var s when s.StartsWith(Settings.HotkeyUpdate, StringComparison.OrdinalIgnoreCase)
=> await pluginManager.RequestUpdate(search, token),
_ => pluginManager.GetDefaultHotKeys().Where(hotkey => _ => pluginManager.GetDefaultHotKeys().Where(hotkey =>
{ {
hotkey.Score = StringMatcher.FuzzySearch(search, hotkey.Title).Score; hotkey.Score = StringMatcher.FuzzySearch(search, hotkey.Title).Score;

View file

@ -9,6 +9,8 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net.Http;
using System.Text.Json;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
@ -17,6 +19,8 @@ namespace Flow.Launcher.Plugin.PluginsManager
{ {
internal class PluginsManager internal class PluginsManager
{ {
const string zip = "zip";
private PluginInitContext Context { get; set; } private PluginInitContext Context { get; set; }
private Settings Settings { get; set; } private Settings Settings { get; set; }
@ -47,7 +51,6 @@ namespace Flow.Launcher.Plugin.PluginsManager
private Task _downloadManifestTask = Task.CompletedTask; private Task _downloadManifestTask = Task.CompletedTask;
internal Task UpdateManifestAsync() internal Task UpdateManifestAsync()
{ {
if (_downloadManifestTask.Status == TaskStatus.Running) if (_downloadManifestTask.Status == TaskStatus.Running)
@ -118,7 +121,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
$"{Context.CurrentPluginMetadata.ActionKeywords.FirstOrDefault()} {Settings.HotkeyUpdate} {plugin.Name}"); $"{Context.CurrentPluginMetadata.ActionKeywords.FirstOrDefault()} {Settings.HotkeyUpdate} {plugin.Name}");
var mainWindow = Application.Current.MainWindow; var mainWindow = Application.Current.MainWindow;
mainWindow.Visibility = Visibility.Visible; mainWindow.Show();
mainWindow.Focus(); mainWindow.Focus();
shouldHideWindow = false; shouldHideWindow = false;
@ -138,13 +141,15 @@ namespace Flow.Launcher.Plugin.PluginsManager
MessageBoxButton.YesNo) == MessageBoxResult.No) MessageBoxButton.YesNo) == MessageBoxResult.No)
return; return;
var filePath = Path.Combine(DataLocation.PluginsDirectory, $"{plugin.Name}-{plugin.Version}.zip"); // at minimum should provide a name, but handle plugin that is not downloaded from plugins manifest and is a url download
var downloadFilename = string.IsNullOrEmpty(plugin.Version)
? $"{plugin.Name}-{Guid.NewGuid()}.zip"
: $"{plugin.Name}-{plugin.Version}.zip";
var filePath = Path.Combine(DataLocation.PluginsDirectory, downloadFilename);
try try
{ {
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
Context.API.GetTranslation("plugin_pluginsmanager_please_wait"));
await Http.DownloadAsync(plugin.UrlDownload, filePath).ConfigureAwait(false); await Http.DownloadAsync(plugin.UrlDownload, filePath).ConfigureAwait(false);
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"), Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
@ -154,7 +159,11 @@ namespace Flow.Launcher.Plugin.PluginsManager
} }
catch (Exception e) catch (Exception e)
{ {
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_install_error_title"), if (e is HttpRequestException)
MessageBox.Show(Context.API.GetTranslation("plugin_pluginsmanager_download_error"),
Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"));
Context.API.ShowMsgError(Context.API.GetTranslation("plugin_pluginsmanager_install_error_title"),
string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_error_subtitle"), string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_error_subtitle"),
plugin.Name)); plugin.Name));
@ -163,6 +172,9 @@ namespace Flow.Launcher.Plugin.PluginsManager
return; return;
} }
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_install_title"),
Context.API.GetTranslation("plugin_pluginsmanager_install_success_restart"));
Context.API.RestartApp(); Context.API.RestartApp();
} }
@ -183,7 +195,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
if (autocompletedResults.Any()) if (autocompletedResults.Any())
return autocompletedResults; return autocompletedResults;
var uninstallSearch = search.Replace(Settings.HotkeyUpdate, string.Empty).TrimStart(); var uninstallSearch = search.Replace(Settings.HotkeyUpdate, string.Empty, StringComparison.OrdinalIgnoreCase).TrimStart();
var resultsForUpdate = var resultsForUpdate =
from existingPlugin in Context.API.GetAllPlugins() from existingPlugin in Context.API.GetAllPlugins()
@ -239,10 +251,6 @@ namespace Flow.Launcher.Plugin.PluginsManager
Task.Run(async delegate Task.Run(async delegate
{ {
Context.API.ShowMsg(
Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
Context.API.GetTranslation("plugin_pluginsmanager_please_wait"));
await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath) await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath)
.ConfigureAwait(false); .ConfigureAwait(false);
@ -302,6 +310,62 @@ namespace Flow.Launcher.Plugin.PluginsManager
.ToList(); .ToList();
} }
internal List<Result> InstallFromWeb(string url)
{
var filename = url.Split("/").Last();
var name = filename.Split(string.Format(".{0}", zip)).First();
var plugin = new UserPlugin
{
ID = "",
Name = name,
Version = string.Empty,
Author = Context.API.GetTranslation("plugin_pluginsmanager_unknown_author"),
UrlDownload = url
};
var result = new Result
{
Title = string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_from_web"), filename),
SubTitle = plugin.UrlDownload,
IcoPath = icoPath,
Action = e =>
{
if (e.SpecialKeyState.CtrlPressed)
{
SearchWeb.NewTabInBrowser(plugin.UrlDownload);
return ShouldHideWindow;
}
if (Settings.WarnFromUnknownSource)
{
if (!InstallSourceKnown(plugin.UrlDownload)
&& MessageBox.Show(string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_unknown_source_warning"),
Environment.NewLine),
Context.API.GetTranslation("plugin_pluginsmanager_install_unknown_source_warning_title"),
MessageBoxButton.YesNo) == MessageBoxResult.No)
return false;
}
Application.Current.MainWindow.Hide();
_ = InstallOrUpdate(plugin);
return ShouldHideWindow;
}
};
return new List<Result> { result };
}
private bool InstallSourceKnown(string url)
{
var author = url.Split('/')[3];
var acceptedSource = "https://github.com";
var contructedUrlPart = string.Format("{0}/{1}/", acceptedSource, author);
return url.StartsWith(acceptedSource) && Context.API.GetAllPlugins().Any(x => x.Metadata.Website.StartsWith(contructedUrlPart));
}
internal async ValueTask<List<Result>> RequestInstallOrUpdate(string searchName, CancellationToken token) internal async ValueTask<List<Result>> RequestInstallOrUpdate(string searchName, CancellationToken token)
{ {
if (!PluginsManifest.UserPlugins.Any()) if (!PluginsManifest.UserPlugins.Any())
@ -311,7 +375,11 @@ namespace Flow.Launcher.Plugin.PluginsManager
token.ThrowIfCancellationRequested(); token.ThrowIfCancellationRequested();
var searchNameWithoutKeyword = searchName.Replace(Settings.HotKeyInstall, string.Empty).Trim(); var searchNameWithoutKeyword = searchName.Replace(Settings.HotKeyInstall, string.Empty, StringComparison.OrdinalIgnoreCase).Trim();
if (Uri.IsWellFormedUriString(searchNameWithoutKeyword, UriKind.Absolute)
&& searchNameWithoutKeyword.Split('.').Last() == zip)
return InstallFromWeb(searchNameWithoutKeyword);
var results = var results =
PluginsManifest PluginsManifest
@ -369,11 +437,26 @@ namespace Flow.Launcher.Plugin.PluginsManager
if (string.IsNullOrEmpty(metadataJsonFilePath) || string.IsNullOrEmpty(pluginFolderPath)) if (string.IsNullOrEmpty(metadataJsonFilePath) || string.IsNullOrEmpty(pluginFolderPath))
{ {
MessageBox.Show(Context.API.GetTranslation("plugin_pluginsmanager_install_errormetadatafile")); MessageBox.Show(Context.API.GetTranslation("plugin_pluginsmanager_install_errormetadatafile"),
return; Context.API.GetTranslation("plugin_pluginsmanager_install_error_title"));
throw new FileNotFoundException (
string.Format("Unable to find plugin.json from the extracted zip file, or this path {0} does not exist", pluginFolderPath));
} }
string newPluginPath = Path.Combine(DataLocation.PluginsDirectory, $"{plugin.Name}-{plugin.Version}"); if (SameOrLesserPluginVersionExists(metadataJsonFilePath))
{
MessageBox.Show(string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_error_duplicate"), plugin.Name),
Context.API.GetTranslation("plugin_pluginsmanager_install_error_title"));
throw new InvalidOperationException(
string.Format("A plugin with the same ID and version already exists, " +
"or the version is greater than this downloaded plugin {0}",
plugin.Name));
}
var directory = string.IsNullOrEmpty(plugin.Version) ? $"{plugin.Name}-{Guid.NewGuid()}" : $"{plugin.Name}-{plugin.Version}";
var newPluginPath = Path.Combine(DataLocation.PluginsDirectory, directory);
FilesFolders.CopyAll(pluginFolderPath, newPluginPath); FilesFolders.CopyAll(pluginFolderPath, newPluginPath);
@ -390,7 +473,7 @@ namespace Flow.Launcher.Plugin.PluginsManager
if (autocompletedResults.Any()) if (autocompletedResults.Any())
return autocompletedResults; return autocompletedResults;
var uninstallSearch = search.Replace(Settings.HotkeyUninstall, string.Empty).TrimStart(); var uninstallSearch = search.Replace(Settings.HotkeyUninstall, string.Empty, StringComparison.OrdinalIgnoreCase).TrimStart();
var results = Context.API var results = Context.API
.GetAllPlugins() .GetAllPlugins()
@ -466,5 +549,13 @@ namespace Flow.Launcher.Plugin.PluginsManager
return new List<Result>(); return new List<Result>();
} }
private bool SameOrLesserPluginVersionExists(string metadataPath)
{
var newMetadata = JsonSerializer.Deserialize<PluginMetadata>(File.ReadAllText(metadataPath));
return Context.API.GetAllPlugins()
.Any(x => x.Metadata.ID == newMetadata.ID
&& newMetadata.Version.CompareTo(x.Metadata.Version) <= 0);
}
} }
} }

View file

@ -7,8 +7,11 @@ namespace Flow.Launcher.Plugin.PluginsManager
internal class Settings internal class Settings
{ {
internal string HotKeyInstall { get; set; } = "install"; internal string HotKeyInstall { get; set; } = "install";
internal string HotkeyUninstall { get; set; } = "uninstall"; internal string HotkeyUninstall { get; set; } = "uninstall";
internal string HotkeyUpdate { get; set; } = "update"; internal string HotkeyUpdate { get; set; } = "update";
public bool WarnFromUnknownSource { get; set; } = true;
} }
} }

View file

@ -14,5 +14,11 @@ namespace Flow.Launcher.Plugin.PluginsManager.ViewModels
Context = context; Context = context;
Settings = settings; Settings = settings;
} }
public bool WarnFromUnknownSource
{
get => Settings.WarnFromUnknownSource;
set => Settings.WarnFromUnknownSource = value;
}
} }
} }

View file

@ -3,10 +3,18 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Flow.Launcher.Plugin.PluginsManager.ViewModels"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<Grid> <Grid Margin="70 15 0 15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="{DynamicResource plugin_pluginsmanager_plugin_settings_unknown_source}"
VerticalAlignment="Center"
FontSize="14"/>
<CheckBox Grid.Column="1" IsChecked="{Binding WarnFromUnknownSource}" />
</Grid> </Grid>
</UserControl> </UserControl>

View file

@ -16,7 +16,7 @@ namespace Flow.Launcher.Plugin.PluginsManager.Views
this.viewModel = viewModel; this.viewModel = viewModel;
//RefreshView(); this.DataContext = viewModel;
} }
} }
} }

View file

@ -6,7 +6,7 @@
"Name": "Plugins Manager", "Name": "Plugins Manager",
"Description": "Management of installing, uninstalling or updating Flow Launcher plugins", "Description": "Management of installing, uninstalling or updating Flow Launcher plugins",
"Author": "Jeremy Wu", "Author": "Jeremy Wu",
"Version": "1.9.0", "Version": "1.10.0",
"Language": "csharp", "Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher", "Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll", "ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll",

View file

@ -26,7 +26,7 @@ namespace Flow.Launcher.Plugin.Program
private static bool IsStartupIndexProgramsRequired => _settings.LastIndexTime.AddDays(3) < DateTime.Today; private static bool IsStartupIndexProgramsRequired => _settings.LastIndexTime.AddDays(3) < DateTime.Today;
private static PluginInitContext _context; internal static PluginInitContext Context { get; private set; }
private static BinaryStorage<Win32[]> _win32Storage; private static BinaryStorage<Win32[]> _win32Storage;
private static BinaryStorage<UWP.Application[]> _uwpStorage; private static BinaryStorage<UWP.Application[]> _uwpStorage;
@ -63,7 +63,7 @@ namespace Flow.Launcher.Plugin.Program
.AsParallel() .AsParallel()
.WithCancellation(token) .WithCancellation(token)
.Where(p => p.Enabled) .Where(p => p.Enabled)
.Select(p => p.Result(query.Search, _context.API)) .Select(p => p.Result(query.Search, Context.API))
.Where(r => r?.Score > 0) .Where(r => r?.Score > 0)
.ToList()); .ToList());
@ -80,7 +80,7 @@ namespace Flow.Launcher.Plugin.Program
public async Task InitAsync(PluginInitContext context) public async Task InitAsync(PluginInitContext context)
{ {
_context = context; Context = context;
_settings = context.API.LoadSettingJsonStorage<Settings>(); _settings = context.API.LoadSettingJsonStorage<Settings>();
@ -155,17 +155,17 @@ namespace Flow.Launcher.Plugin.Program
public Control CreateSettingPanel() public Control CreateSettingPanel()
{ {
return new ProgramSetting(_context, _settings, _win32s, _uwps); return new ProgramSetting(Context, _settings, _win32s, _uwps);
} }
public string GetTranslatedPluginTitle() public string GetTranslatedPluginTitle()
{ {
return _context.API.GetTranslation("flowlauncher_plugin_program_plugin_name"); return Context.API.GetTranslation("flowlauncher_plugin_program_plugin_name");
} }
public string GetTranslatedPluginDescription() public string GetTranslatedPluginDescription()
{ {
return _context.API.GetTranslation("flowlauncher_plugin_program_plugin_description"); return Context.API.GetTranslation("flowlauncher_plugin_program_plugin_description");
} }
public List<Result> LoadContextMenus(Result selectedResult) public List<Result> LoadContextMenus(Result selectedResult)
@ -174,19 +174,19 @@ namespace Flow.Launcher.Plugin.Program
var program = selectedResult.ContextData as IProgram; var program = selectedResult.ContextData as IProgram;
if (program != null) if (program != null)
{ {
menuOptions = program.ContextMenus(_context.API); menuOptions = program.ContextMenus(Context.API);
} }
menuOptions.Add( menuOptions.Add(
new Result new Result
{ {
Title = _context.API.GetTranslation("flowlauncher_plugin_program_disable_program"), Title = Context.API.GetTranslation("flowlauncher_plugin_program_disable_program"),
Action = c => Action = c =>
{ {
DisableProgram(program); DisableProgram(program);
_context.API.ShowMsg( Context.API.ShowMsg(
_context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"), Context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"),
_context.API.GetTranslation( Context.API.GetTranslation(
"flowlauncher_plugin_program_disable_dlgtitle_success_message")); "flowlauncher_plugin_program_disable_dlgtitle_success_message"));
return false; return false;
}, },
@ -235,7 +235,7 @@ namespace Flow.Launcher.Plugin.Program
{ {
var name = "Plugin: Program"; var name = "Plugin: Program";
var message = $"Unable to start: {info.FileName}"; var message = $"Unable to start: {info.FileName}";
_context.API.ShowMsg(name, message, string.Empty); Context.API.ShowMsg(name, message, string.Empty);
} }
} }

View file

@ -362,14 +362,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
Action = _ => Action = _ =>
{ {
Main.StartProcess(Process.Start, Main.Context.API.OpenDirectory(Package.Location);
new ProcessStartInfo(
!string.IsNullOrEmpty(Main._settings.CustomizedExplorer)
? Main._settings.CustomizedExplorer
: Settings.Explorer,
Main._settings.CustomizedArgs
.Replace("%s",$"\"{Package.Location}\"")
.Trim()));
return true; return true;
}, },

View file

@ -177,20 +177,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
Title = api.GetTranslation("flowlauncher_plugin_program_open_containing_folder"), Title = api.GetTranslation("flowlauncher_plugin_program_open_containing_folder"),
Action = _ => Action = _ =>
{ {
var args = !string.IsNullOrWhiteSpace(Main._settings.CustomizedArgs) Main.Context.API.OpenDirectory(ParentDirectory, FullPath);
? Main._settings.CustomizedArgs
.Replace("%s", $"\"{ParentDirectory}\"")
.Replace("%f", $"\"{FullPath}\"")
: Main._settings.CustomizedExplorer == Settings.Explorer
? $"/select,\"{FullPath}\""
: Settings.ExplorerArgs;
Main.StartProcess(Process.Start,
new ProcessStartInfo(
!string.IsNullOrWhiteSpace(Main._settings.CustomizedExplorer)
? Main._settings.CustomizedExplorer
: Settings.Explorer,
args));
return true; return true;
}, },

View file

@ -1,91 +1,166 @@
<UserControl x:Class="Flow.Launcher.Plugin.Program.Views.ProgramSetting" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="Flow.Launcher.Plugin.Program.Views.ProgramSetting"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:program="clr-namespace:Flow.Launcher.Plugin.Program" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
DataContext="{Binding RelativeSource={RelativeSource Self}}" xmlns:program="clr-namespace:Flow.Launcher.Plugin.Program"
mc:Ignorable="d" Height="450"
d:DesignHeight="404.508" d:DesignWidth="600"> d:DesignHeight="404.508"
<Grid Margin="10"> d:DesignWidth="600"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
mc:Ignorable="d">
<Grid Margin="20">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="120"/> <RowDefinition Height="120" />
<RowDefinition Height="*"/> <RowDefinition Height="*" />
<RowDefinition Height="50"/> <RowDefinition Height="50" />
<RowDefinition Height="50"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Stretch"> <StackPanel
<StackPanel Orientation="Vertical" Width="Auto"> Grid.Row="0"
<CheckBox Name="StartMenuEnabled" IsChecked="{Binding EnableStartMenuSource}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_index_start}" ToolTip="{DynamicResource flowlauncher_plugin_program_index_start_tooltip}" /> HorizontalAlignment="Stretch"
<CheckBox Name="RegistryEnabled" IsChecked="{Binding EnableRegistrySource}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_index_registry}" ToolTip="{DynamicResource flowlauncher_plugin_program_index_registry_tooltip}" /> Orientation="Horizontal">
<CheckBox Name="DescriptionEnabled" IsChecked="{Binding EnableDescription}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_enable_description}" ToolTip="{DynamicResource flowlauncher_plugin_program_enable_description_tooltip}" /> <StackPanel Width="Auto" Orientation="Vertical">
<CheckBox
Name="StartMenuEnabled"
Margin="5"
Content="{DynamicResource flowlauncher_plugin_program_index_start}"
IsChecked="{Binding EnableStartMenuSource}"
ToolTip="{DynamicResource flowlauncher_plugin_program_index_start_tooltip}" />
<CheckBox
Name="RegistryEnabled"
Margin="5"
Content="{DynamicResource flowlauncher_plugin_program_index_registry}"
IsChecked="{Binding EnableRegistrySource}"
ToolTip="{DynamicResource flowlauncher_plugin_program_index_registry_tooltip}" />
<CheckBox
Name="DescriptionEnabled"
Margin="5"
Content="{DynamicResource flowlauncher_plugin_program_enable_description}"
IsChecked="{Binding EnableDescription}"
ToolTip="{DynamicResource flowlauncher_plugin_program_enable_description_tooltip}" />
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Width="Auto"> <StackPanel
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnLoadAllProgramSource" Click="btnLoadAllProgramSource_OnClick" Content="{DynamicResource flowlauncher_plugin_program_all_programs}" /> Width="Auto"
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnProgramSuffixes" Click="BtnProgramSuffixes_OnClick" Content="{DynamicResource flowlauncher_plugin_program_suffixes}" /> HorizontalAlignment="Right"
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnReindex" Click="btnReindex_Click" Content="{DynamicResource flowlauncher_plugin_program_reindex}" /> Orientation="Horizontal">
<Button
x:Name="btnLoadAllProgramSource"
Width="100"
Height="31"
Margin="10"
HorizontalAlignment="Right"
Click="btnLoadAllProgramSource_OnClick"
Content="{DynamicResource flowlauncher_plugin_program_all_programs}" />
<Button
x:Name="btnProgramSuffixes"
Width="100"
Height="31"
Margin="10"
HorizontalAlignment="Right"
Click="BtnProgramSuffixes_OnClick"
Content="{DynamicResource flowlauncher_plugin_program_suffixes}" />
<Button
x:Name="btnReindex"
Width="100"
Height="31"
Margin="10"
HorizontalAlignment="Right"
Click="btnReindex_Click"
Content="{DynamicResource flowlauncher_plugin_program_reindex}" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<ListView x:Name="programSourceView" Grid.Row="1" AllowDrop="True" SelectionMode="Extended" Style="{StaticResource {x:Static GridView.GridViewStyleKey}}" <ListView
Margin="0,13,0,10" x:Name="programSourceView"
BorderBrush="DarkGray" Grid.Row="1"
BorderThickness="1" Margin="0,13,0,10"
GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler" AllowDrop="True"
PreviewMouseRightButtonUp="ProgramSourceView_PreviewMouseRightButtonUp" BorderBrush="DarkGray"
DragEnter="programSourceView_DragEnter" BorderThickness="1"
Drop="programSourceView_Drop"> DragEnter="programSourceView_DragEnter"
Drop="programSourceView_Drop"
GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler"
PreviewMouseRightButtonUp="ProgramSourceView_PreviewMouseRightButtonUp"
SelectionMode="Extended"
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
<ListView.ItemContainerStyle> <ListView.ItemContainerStyle>
<Style TargetType="ListViewItem"> <Style TargetType="ListViewItem">
<EventSetter Event="PreviewMouseUp" Handler="Row_OnClick"/> <EventSetter Event="PreviewMouseUp" Handler="Row_OnClick" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style> </Style>
</ListView.ItemContainerStyle> </ListView.ItemContainerStyle>
<ListView.View> <ListView.View>
<GridView> <GridView>
<GridViewColumn Header="Name" Width="150"> <GridViewColumn Width="150" Header="Name">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Name}"/> <TextBlock Text="{Binding Name}" />
</DataTemplate> </DataTemplate>
</GridViewColumn.CellTemplate> </GridViewColumn.CellTemplate>
</GridViewColumn> </GridViewColumn>
<GridViewColumn Header="Enabled"> <GridViewColumn Header="Enabled">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Enabled}" MaxWidth="60" TextAlignment="Center"/> <TextBlock
MaxWidth="60"
Text="{Binding Enabled}"
TextAlignment="Center" />
</DataTemplate> </DataTemplate>
</GridViewColumn.CellTemplate> </GridViewColumn.CellTemplate>
</GridViewColumn> </GridViewColumn>
<GridViewColumn Header="{DynamicResource flowlauncher_plugin_program_location}" Width="550"> <GridViewColumn Width="550" Header="{DynamicResource flowlauncher_plugin_program_location}">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Location, ConverterParameter=(null), Converter={program:LocationConverter}}"/> <TextBlock Text="{Binding Location, ConverterParameter=(null), Converter={program:LocationConverter}}" />
</DataTemplate> </DataTemplate>
</GridViewColumn.CellTemplate> </GridViewColumn.CellTemplate>
</GridViewColumn> </GridViewColumn>
</GridView> </GridView>
</ListView.View> </ListView.View>
</ListView> </ListView>
<DockPanel Grid.Row="2" Margin="0,0,0,0" Grid.RowSpan="1"> <DockPanel
<StackPanel x:Name="indexingPanel" Visibility="Hidden" HorizontalAlignment="Left" Orientation="Horizontal"> Grid.Row="2"
<ProgressBar x:Name="progressBarIndexing" Height="20" Width="80" Minimum="0" Maximum="100" IsIndeterminate="True" /> Grid.RowSpan="1"
<TextBlock Margin="10 0 0 0" Height="20" HorizontalAlignment="Center" Text="{DynamicResource flowlauncher_plugin_program_indexing}" /> Margin="0,0,0,0">
<StackPanel
x:Name="indexingPanel"
HorizontalAlignment="Left"
Orientation="Horizontal"
Visibility="Hidden">
<ProgressBar
x:Name="progressBarIndexing"
Width="80"
Height="20"
IsIndeterminate="True"
Maximum="100"
Minimum="0" />
<TextBlock
Height="20"
Margin="10,0,0,0"
HorizontalAlignment="Center"
Text="{DynamicResource flowlauncher_plugin_program_indexing}" />
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button x:Name="btnProgramSourceStatus" Click="btnProgramSourceStatus_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_disable}" /> <Button
<Button x:Name="btnEditProgramSource" Click="btnEditProgramSource_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_edit}"/> x:Name="btnProgramSourceStatus"
<Button x:Name="btnAddProgramSource" Click="btnAddProgramSource_OnClick" Width="100" Margin="10 10 0 10" Content="{DynamicResource flowlauncher_plugin_program_add}"/> Width="100"
Margin="10"
Click="btnProgramSourceStatus_OnClick"
Content="{DynamicResource flowlauncher_plugin_program_disable}" />
<Button
x:Name="btnEditProgramSource"
Width="100"
Margin="10"
Click="btnEditProgramSource_OnClick"
Content="{DynamicResource flowlauncher_plugin_program_edit}" />
<Button
x:Name="btnAddProgramSource"
Width="100"
Margin="10,10,0,10"
Click="btnAddProgramSource_OnClick"
Content="{DynamicResource flowlauncher_plugin_program_add}" />
</StackPanel> </StackPanel>
</DockPanel> </DockPanel>
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Stretch">
<TextBlock Text="{DynamicResource flowlauncher_plugin_program_customizedexplorer}" VerticalAlignment="Center" FontSize="15"
ToolTip= "{DynamicResource flowlauncher_plugin_program_tooltip_customizedexplorer}"/>
<TextBox Margin="10,0,10,0" TextWrapping="NoWrap" VerticalAlignment="Center" Width="200" Height="30" FontSize="15"
Text="{Binding CustomizedExplorerPath}" x:Name="CustomizeExplorerBox"/>
<TextBlock Text="{DynamicResource flowlauncher_plugin_program_args}" VerticalAlignment="Center" FontSize="15"
ToolTip="{DynamicResource flowlauncher_plugin_program_tooltip_args}" />
<TextBox Margin="10,0,0,0" Width="135" Height="30" FontSize="15" x:Name="CustomizeArgsBox" Text="{Binding CustomizedExplorerArg}"></TextBox>
</StackPanel>
</Grid> </Grid>
</UserControl> </UserControl>

View file

@ -347,15 +347,5 @@ namespace Flow.Launcher.Plugin.Program.Views
btnProgramSourceStatus.Content = "Enable"; btnProgramSourceStatus.Content = "Enable";
} }
} }
private void CustomizeExplorer(object sender, TextChangedEventArgs e)
{
_settings.CustomizedExplorer = CustomizeExplorerBox.Text;
}
private void CustomizeExplorerArgs(object sender, TextChangedEventArgs e)
{
_settings.CustomizedArgs = CustomizeArgsBox.Text;
}
} }
} }

View file

@ -4,7 +4,7 @@
"Name": "Program", "Name": "Program",
"Description": "Search programs in Flow.Launcher", "Description": "Search programs in Flow.Launcher",
"Author": "qianlifeng", "Author": "qianlifeng",
"Version": "1.6.1", "Version": "1.7.0",
"Language": "csharp", "Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher", "Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Program.dll", "ExecuteFileName": "Flow.Launcher.Plugin.Program.dll",

View file

@ -193,51 +193,63 @@ namespace Flow.Launcher.Plugin.Shell
var workingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); var workingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
var runAsAdministratorArg = !runAsAdministrator && !_settings.RunAsAdministrator ? "" : "runas"; var runAsAdministratorArg = !runAsAdministrator && !_settings.RunAsAdministrator ? "" : "runas";
ProcessStartInfo info; ProcessStartInfo info = new()
if (_settings.Shell == Shell.Cmd)
{ {
var arguments = _settings.LeaveShellOpen ? $"/k \"{command}\"" : $"/c \"{command}\" & pause"; Verb = runAsAdministratorArg,
WorkingDirectory = workingDirectory,
info = ShellCommand.SetProcessStartInfo("cmd.exe", workingDirectory, arguments, runAsAdministratorArg); };
} switch (_settings.Shell)
else if (_settings.Shell == Shell.Powershell)
{ {
string arguments; case Shell.Cmd:
if (_settings.LeaveShellOpen)
{
arguments = $"-NoExit \"{command}\"";
}
else
{
arguments = $"\"{command} ; Read-Host -Prompt \\\"Press Enter to continue\\\"\"";
}
info = ShellCommand.SetProcessStartInfo("powershell.exe", workingDirectory, arguments, runAsAdministratorArg);
}
else if (_settings.Shell == Shell.RunCommand)
{
var parts = command.Split(new[] { ' ' }, 2);
if (parts.Length == 2)
{
var filename = parts[0];
if (ExistInPath(filename))
{ {
var arguments = parts[1]; info.FileName = "cmd.exe";
info = ShellCommand.SetProcessStartInfo(filename, workingDirectory, arguments, runAsAdministratorArg); info.ArgumentList.Add(_settings.LeaveShellOpen ? "/k" : "/c");
info.ArgumentList.Add(command);
break;
} }
else
case Shell.Powershell:
{ {
info = ShellCommand.SetProcessStartInfo(command, verb: runAsAdministratorArg); info.FileName = "powershell.exe";
if (_settings.LeaveShellOpen)
{
info.ArgumentList.Add("-NoExit");
info.ArgumentList.Add(command);
}
else
{
info.ArgumentList.Add("-Command");
info.ArgumentList.Add(command);
}
break;
} }
}
else case Shell.RunCommand:
{ {
info = ShellCommand.SetProcessStartInfo(command, verb: runAsAdministratorArg); var parts = command.Split(new[] { ' ' }, 2);
} if (parts.Length == 2)
} {
else var filename = parts[0];
{ if (ExistInPath(filename))
throw new NotImplementedException(); {
var arguments = parts[1];
info.FileName = filename;
info.ArgumentList.Add(arguments);
}
else
{
info.FileName = command;
}
}
else
{
info.FileName = command;
}
break;
}
default:
throw new NotImplementedException();
} }
info.UseShellExecute = true; info.UseShellExecute = true;
@ -251,7 +263,7 @@ namespace Flow.Launcher.Plugin.Shell
{ {
try try
{ {
startProcess(info); ShellCommand.Execute(startProcess, info);
} }
catch (FileNotFoundException e) catch (FileNotFoundException e)
{ {
@ -329,7 +341,7 @@ namespace Flow.Launcher.Plugin.Shell
// show the main window and set focus to the query box // show the main window and set focus to the query box
Window mainWindow = Application.Current.MainWindow; Window mainWindow = Application.Current.MainWindow;
mainWindow.Visibility = Visibility.Visible; mainWindow.Show();
mainWindow.Focus(); mainWindow.Focus();
} }

View file

@ -4,7 +4,7 @@
"Name": "Shell", "Name": "Shell",
"Description": "Provide executing commands from Flow Launcher", "Description": "Provide executing commands from Flow Launcher",
"Author": "qianlifeng", "Author": "qianlifeng",
"Version": "1.4.5", "Version": "1.4.6",
"Language": "csharp", "Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher", "Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Shell.dll", "ExecuteFileName": "Flow.Launcher.Plugin.Shell.dll",

View file

@ -8,6 +8,7 @@
<system:String x:Key="flowlauncher_plugin_sys_shutdown_computer">Vypnúť počítač</system:String> <system:String x:Key="flowlauncher_plugin_sys_shutdown_computer">Vypnúť počítač</system:String>
<system:String x:Key="flowlauncher_plugin_sys_restart_computer">Reštartovať počítač</system:String> <system:String x:Key="flowlauncher_plugin_sys_restart_computer">Reštartovať počítač</system:String>
<system:String x:Key="flowlauncher_plugin_sys_restart_advanced">Reštartovať počítač s rozšírenými možnosťami spúšťania pre núdzový režim a režim ladenia, ako aj s ďalšími možnosťami</system:String>
<system:String x:Key="flowlauncher_plugin_sys_log_off">Odhlásiť</system:String> <system:String x:Key="flowlauncher_plugin_sys_log_off">Odhlásiť</system:String>
<system:String x:Key="flowlauncher_plugin_sys_lock">Zamknúť počítač</system:String> <system:String x:Key="flowlauncher_plugin_sys_lock">Zamknúť počítač</system:String>
<system:String x:Key="flowlauncher_plugin_sys_exit">Zavrieť Flow Launcher</system:String> <system:String x:Key="flowlauncher_plugin_sys_exit">Zavrieť Flow Launcher</system:String>
@ -29,6 +30,7 @@
<system:String x:Key="flowlauncher_plugin_sys_dlgtext_all_applicableplugins_reloaded">Všetky dáta pluginov aktualizované</system:String> <system:String x:Key="flowlauncher_plugin_sys_dlgtext_all_applicableplugins_reloaded">Všetky dáta pluginov aktualizované</system:String>
<system:String x:Key="flowlauncher_plugin_sys_dlgtext_shutdown_computer">Naozaj chcete počítač vypnúť?</system:String> <system:String x:Key="flowlauncher_plugin_sys_dlgtext_shutdown_computer">Naozaj chcete počítač vypnúť?</system:String>
<system:String x:Key="flowlauncher_plugin_sys_dlgtext_restart_computer">Naozaj chcete počítač reštartovať?</system:String> <system:String x:Key="flowlauncher_plugin_sys_dlgtext_restart_computer">Naozaj chcete počítač reštartovať?</system:String>
<system:String x:Key="flowlauncher_plugin_sys_dlgtext_restart_computer_advanced">Naozaj chcete počítač reštartovať s pokročilými možnosťami spúšťania?</system:String>
<system:String x:Key="flowlauncher_plugin_sys_plugin_name">Systémové príkazy</system:String> <system:String x:Key="flowlauncher_plugin_sys_plugin_name">Systémové príkazy</system:String>
<system:String x:Key="flowlauncher_plugin_sys_plugin_description">Poskytuje príkazy súvisiace so systémom ako je vypnutie, uzamknutie počítača atď.</system:String> <system:String x:Key="flowlauncher_plugin_sys_plugin_description">Poskytuje príkazy súvisiace so systémom ako je vypnutie, uzamknutie počítača atď.</system:String>

View file

@ -190,8 +190,8 @@ namespace Flow.Launcher.Plugin.Sys
var info = ShellCommand.SetProcessStartInfo("shutdown", arguments:"/h"); var info = ShellCommand.SetProcessStartInfo("shutdown", arguments:"/h");
info.WindowStyle = ProcessWindowStyle.Hidden; info.WindowStyle = ProcessWindowStyle.Hidden;
info.UseShellExecute = true; info.UseShellExecute = true;
Process.Start(info); ShellCommand.Execute(info);
return true; return true;
} }
@ -304,7 +304,7 @@ namespace Flow.Launcher.Plugin.Sys
Action = c => Action = c =>
{ {
var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version); var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version);
FilesFolders.OpenPath(logPath); context.API.OpenDirectory(logPath);
return true; return true;
} }
}, },
@ -326,7 +326,7 @@ namespace Flow.Launcher.Plugin.Sys
IcoPath = "Images\\app.png", IcoPath = "Images\\app.png",
Action = c => Action = c =>
{ {
FilesFolders.OpenPath(DataLocation.DataDirectory()); context.API.OpenDirectory(DataLocation.DataDirectory());
return true; return true;
} }
} }

View file

@ -4,7 +4,7 @@
"Name": "System Commands", "Name": "System Commands",
"Description": "Provide System related commands. e.g. shutdown,lock, setting etc.", "Description": "Provide System related commands. e.g. shutdown,lock, setting etc.",
"Author": "qianlifeng", "Author": "qianlifeng",
"Version": "1.4.0", "Version": "1.5.1",
"Language": "csharp", "Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher", "Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Sys.dll", "ExecuteFileName": "Flow.Launcher.Plugin.Sys.dll",

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -2,6 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"> xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="flowlauncher_plugin_websearch_window_title">Search Source Setting</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_open_search_in">Open search in:</system:String> <system:String x:Key="flowlauncher_plugin_websearch_open_search_in">Open search in:</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_new_window">New Window</system:String> <system:String x:Key="flowlauncher_plugin_websearch_new_window">New Window</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_new_tab">New Tab</system:String> <system:String x:Key="flowlauncher_plugin_websearch_new_tab">New Tab</system:String>
@ -14,9 +15,14 @@
<system:String x:Key="flowlauncher_plugin_websearch_action_keyword">Action Keyword</system:String> <system:String x:Key="flowlauncher_plugin_websearch_action_keyword">Action Keyword</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_url">URL</system:String> <system:String x:Key="flowlauncher_plugin_websearch_url">URL</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_search">Search</system:String> <system:String x:Key="flowlauncher_plugin_websearch_search">Search</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion">Search suggestions</system:String> <system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion">Use Search Query Autocomplete: </system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion_provider">Autocomplete Data from: </system:String>
<system:String x:Key="flowlauncher_plugin_websearch_pls_select_web_search">Please select a web search</system:String> <system:String x:Key="flowlauncher_plugin_websearch_pls_select_web_search">Please select a web search</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_delete_warning">Are you sure you want to delete {0}?</system:String> <system:String x:Key="flowlauncher_plugin_websearch_delete_warning">Are you sure you want to delete {0}?</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_guide_1">If you have a web search service you want to use, you can add it to Flow. For example, you can follow the url format in the address bar if you want to search 'casino' on Netflix: "https://www.netflix.com/search?q=Casino". To do this, change the search term 'Casino' as follows.</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_guide_2">https://www.netflix.com/search?q={q}</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_guide_3">Add it to the URL section below. You can now search Netflix with Flow using any search terms.</system:String>
<!--web search edit--> <!--web search edit-->
<system:String x:Key="flowlauncher_plugin_websearch_title">Title</system:String> <system:String x:Key="flowlauncher_plugin_websearch_title">Title</system:String>

View file

@ -1,63 +1,365 @@
<Window x:Class="Flow.Launcher.Plugin.WebSearch.SearchSourceSettingWindow" <Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="Flow.Launcher.Plugin.WebSearch.SearchSourceSettingWindow"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vm="clr-namespace:Flow.Launcher.Plugin.WebSearch" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" xmlns:vm="clr-namespace:Flow.Launcher.Plugin.WebSearch"
ResizeMode="NoResize" Title="{DynamicResource flowlauncher_plugin_websearch_window_title}"
WindowStartupLocation="CenterScreen" Width="550"
Title="Search Source Setting" Height="400" Width="500" d:DataContext="{d:DesignInstance vm:SearchSourceViewModel}"
d:DataContext="{d:DesignInstance vm:SearchSourceViewModel}"> Background="{DynamicResource PopuBGColor}"
Foreground="{DynamicResource PopupTextColor}"
ResizeMode="NoResize"
SizeToContent="Height"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
</WindowChrome.WindowChrome>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition />
<RowDefinition /> <RowDefinition Height="80" />
<RowDefinition />
<RowDefinition />
<RowDefinition Height="60" />
<RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"
HorizontalAlignment="Right" Text="{DynamicResource flowlauncher_plugin_websearch_title}" />
<TextBox Text="{Binding SearchSource.Title}" Margin="10" Grid.Row="0" Width="300" Grid.Column="1"
VerticalAlignment="Center"
HorizontalAlignment="Left" />
<TextBlock Margin="10" FontSize="14" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" <StackPanel Grid.Row="0">
HorizontalAlignment="Right" Text="{DynamicResource flowlauncher_plugin_websearch_url}" /> <StackPanel>
<TextBox Text="{Binding SearchSource.Url}" Margin="10" Grid.Row="1" Width="300" Grid.Column="1" <Grid>
VerticalAlignment="Center" <Grid.ColumnDefinitions>
HorizontalAlignment="Left" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="4"
Click="OnCancelButtonClick"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Width="46"
Height="32"
Data="M 18,11 27,20 M 18,20 27,11"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1">
<Path.Style>
<Style TargetType="Path">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Opacity" Value="0.5" />
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
</Button>
</Grid>
</StackPanel>
<StackPanel Margin="26,12,26,0">
<Grid>
<StackPanel>
<StackPanel Grid.Row="0" Margin="0,0,0,12">
<TextBlock
Grid.Column="0"
Margin="0,0,0,0"
FontFamily="Segoe UI"
FontSize="20"
FontWeight="SemiBold"
Text="{DynamicResource flowlauncher_plugin_websearch_window_title}"
TextAlignment="Left" />
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_websearch_guide_1}"
TextAlignment="Left"
TextWrapping="WrapWithOverflow" />
<TextBlock
Margin="0,12,0,12"
FontSize="14"
FontWeight="SemiBold"
Text="{DynamicResource flowlauncher_plugin_websearch_guide_2}"
TextAlignment="Center"
TextWrapping="WrapWithOverflow" />
<TextBlock
Margin="0,0,0,14"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_websearch_guide_3}"
TextAlignment="Left"
TextWrapping="WrapWithOverflow" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock
Width="100"
Margin="10"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_websearch_title}" />
<TextBox
Width="330"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Text="{Binding SearchSource.Title}" />
<TextBlock Margin="10" FontSize="14" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" </StackPanel>
HorizontalAlignment="Right" Text="{DynamicResource flowlauncher_plugin_websearch_action_keyword}" /> <StackPanel Orientation="Horizontal">
<TextBox Text="{Binding SearchSource.ActionKeyword}" Margin="10" Grid.Row="2" Width="300" Grid.Column="1" <TextBlock
VerticalAlignment="Center" HorizontalAlignment="Left" /> Grid.Row="4"
Grid.Column="0"
<TextBlock Margin="10" FontSize="14" Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" Width="100"
HorizontalAlignment="Right" Text="{DynamicResource flowlauncher_plugin_websearch_enable}" /> Margin="10"
<CheckBox IsChecked="{Binding SearchSource.Enabled}" Margin="10" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left"
VerticalAlignment="Center" /> VerticalAlignment="Center"
FontSize="14"
<TextBlock Margin="10" FontSize="14" Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Text="{DynamicResource flowlauncher_plugin_websearch_icon}" />
HorizontalAlignment="Right" Text="{DynamicResource flowlauncher_plugin_websearch_icon}" /> <Button
<StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="1" Margin="10"> Height="35"
<Image Name="imgPreviewIcon" Width="24" Height="24" Margin="0 0 20 0" /> Margin="10,0,0,0"
<Button Click="OnSelectIconClick" Height="35" VerticalAlignment="Center"
Content="{DynamicResource flowlauncher_plugin_websearch_select_icon}" /> Click="OnSelectIconClick"
Content="{DynamicResource flowlauncher_plugin_websearch_select_icon}" />
<Image
Name="imgPreviewIcon"
Width="24"
Height="24"
Margin="14,0,0,0"
VerticalAlignment="Center" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock
Width="100"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_websearch_url}" />
<TextBox
Grid.Row="1"
Grid.Column="1"
Width="330"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Text="{Binding SearchSource.Url}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock
Grid.Row="2"
Grid.Column="0"
Width="100"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_websearch_action_keyword}" />
<TextBox
Grid.Row="2"
Grid.Column="1"
Width="330"
Margin="10,0,10,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Text="{Binding SearchSource.ActionKeyword}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock
Grid.Row="3"
Grid.Column="0"
Width="100"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_websearch_enable}" />
<CheckBox
Grid.Row="3"
Grid.Column="1"
Margin="10"
VerticalAlignment="Center"
IsChecked="{Binding SearchSource.Enabled}" />
</StackPanel>
</StackPanel>
</Grid>
</StackPanel>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="5" Grid.Column="1"> <Border
<Button Click="OnCancelButtonClick" Grid.Row="1"
Margin="10 0 10 0" Width="80" Height="35" Background="{DynamicResource PopupButtonAreaBGColor}"
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
BorderThickness="0,1,0,0">
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Button
Width="100"
Margin="10,0,5,0"
Click="OnCancelButtonClick"
Content="{DynamicResource flowlauncher_plugin_websearch_cancel}" /> Content="{DynamicResource flowlauncher_plugin_websearch_cancel}" />
<Button Click="OnConfirmButtonClick" <Button
Margin="10 0 10 0" Width="80" Height="35" Width="100"
Margin="5,0,10,0"
Click="OnConfirmButtonClick"
Content="{DynamicResource flowlauncher_plugin_websearch_confirm}" /> Content="{DynamicResource flowlauncher_plugin_websearch_confirm}" />
</StackPanel>
</Border>
</Grid>
<!--
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="80" />
</Grid.RowDefinitions>
<Border
Padding="26,26,26,0"
Background="#ffffff"
BorderBrush="#e5e5e5"
BorderThickness="0,0,0,1">
<Grid>
<StackPanel>
<StackPanel Grid.Row="0" Margin="0,0,0,12">
<TextBlock
Grid.Column="0"
Margin="0,0,0,0"
FontFamily="Segoe UI"
FontSize="20"
FontWeight="SemiBold"
Text="{DynamicResource flowlauncher_plugin_websearch_window_title}"
TextAlignment="Left" />
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock
FontSize="14"
Foreground="#1b1b1b"
Text="{DynamicResource flowlauncher_plugin_websearch_guide_1}"
TextAlignment="Left"
TextWrapping="WrapWithOverflow" />
<TextBlock
Margin="0,12,0,12"
FontSize="14"
FontWeight="SemiBold"
Foreground="#1b1b1b"
Text="{DynamicResource flowlauncher_plugin_websearch_guide_2}"
TextAlignment="Center"
TextWrapping="WrapWithOverflow" />
<TextBlock
Margin="0,0,0,14"
FontSize="14"
Foreground="#1b1b1b"
Text="{DynamicResource flowlauncher_plugin_websearch_guide_3}"
TextAlignment="Left"
TextWrapping="WrapWithOverflow" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock
Width="100"
Margin="10"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_websearch_title}" />
<TextBox
Width="330"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Text="{Binding SearchSource.Title}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock
Grid.Row="4"
Grid.Column="0"
Width="100"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_websearch_icon}" />
<Button
Height="35"
Margin="10,0,0,0"
VerticalAlignment="Center"
Click="OnSelectIconClick"
Content="{DynamicResource flowlauncher_plugin_websearch_select_icon}" />
<Image
Name="imgPreviewIcon"
Width="24"
Height="24"
Margin="14,0,0,0"
VerticalAlignment="Center" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock
Width="100"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_websearch_url}" />
<TextBox
Grid.Row="1"
Grid.Column="1"
Width="330"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Text="{Binding SearchSource.Url}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock
Grid.Row="2"
Grid.Column="0"
Width="100"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_websearch_action_keyword}" />
<TextBox
Grid.Row="2"
Grid.Column="1"
Width="330"
Margin="10,0,10,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Text="{Binding SearchSource.ActionKeyword}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock
Grid.Row="3"
Grid.Column="0"
Width="100"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource flowlauncher_plugin_websearch_enable}" />
<CheckBox
Grid.Row="3"
Grid.Column="1"
Margin="10"
VerticalAlignment="Center"
IsChecked="{Binding SearchSource.Enabled}" />
</StackPanel>
</StackPanel>
</Grid>
</Border>
<StackPanel
Grid.Row="1"
HorizontalAlignment="Center"
Orientation="Horizontal">
<Button
Width="100"
Margin="10,0,5,0"
Click="OnCancelButtonClick"
Content="{DynamicResource flowlauncher_plugin_websearch_cancel}" />
<Button
Width="100"
Margin="5,0,10,0"
Click="OnConfirmButtonClick"
Content="{DynamicResource flowlauncher_plugin_websearch_confirm}" />
</StackPanel> </StackPanel>
</Grid> </Grid>
-->
</Window> </Window>

View file

@ -1,117 +1,203 @@
<UserControl x:Class="Flow.Launcher.Plugin.WebSearch.SettingsControl" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="Flow.Launcher.Plugin.WebSearch.SettingsControl"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vm="clr-namespace:Flow.Launcher.Plugin.WebSearch" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" xmlns:vm="clr-namespace:Flow.Launcher.Plugin.WebSearch"
Background="White" d:DataContext="{d:DesignInstance vm:SettingsViewModel}"
d:DataContext="{d:DesignInstance vm:SettingsViewModel}" d:DesignHeight="300"
d:DesignHeight="300" d:DesignWidth="500"> d:DesignWidth="500"
mc:Ignorable="d">
<UserControl.Resources> <UserControl.Resources>
<Style TargetType="TextBox" x:Key="BrowserPathBoxStyle"> <Style x:Key="BrowserPathBoxStyle" TargetType="TextBox">
<Setter Property="Height" Value="28"/> <Setter Property="Height" Value="28" />
<Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="VerticalContentAlignment" Value="Center" />
</Style> </Style>
<DataTemplate x:Key="HeaderTemplateArrowUp"> <DataTemplate x:Key="HeaderTemplateArrowUp">
<DockPanel> <DockPanel>
<TextBlock HorizontalAlignment="Center" Text="{Binding}"/> <TextBlock HorizontalAlignment="Center" Text="{Binding}" />
<Path x:Name="arrow" <Path
StrokeThickness = "1" x:Name="arrow"
Fill = "gray" Data="M 5,10 L 15,10 L 10,5 L 5,10"
Data = "M 5,10 L 15,10 L 10,5 L 5,10"/> Fill="gray"
StrokeThickness="1" />
</DockPanel> </DockPanel>
</DataTemplate> </DataTemplate>
<DataTemplate x:Key="HeaderTemplateArrowDown"> <DataTemplate x:Key="HeaderTemplateArrowDown">
<DockPanel> <DockPanel>
<TextBlock HorizontalAlignment="Center" Text="{Binding }"/> <TextBlock HorizontalAlignment="Center" Text="{Binding}" />
<Path x:Name="arrow" <Path
StrokeThickness = "1" x:Name="arrow"
Fill = "gray" Data="M 5,5 L 10,10 L 15,5 L 5,5"
Data = "M 5,5 L 10,10 L 15,5 L 5,5"/> Fill="gray"
StrokeThickness="1" />
</DockPanel> </DockPanel>
</DataTemplate> </DataTemplate>
</UserControl.Resources> </UserControl.Resources>
<Grid Margin="14"> <Grid Margin="14,14,14,0">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="48" /> <RowDefinition Height="48" />
<RowDefinition Height="45" /> <RowDefinition Height="40" />
<RowDefinition /> <RowDefinition />
<RowDefinition Height="56" />
<RowDefinition Height="50" /> <RowDefinition Height="50" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Grid.Row="0"> <StackPanel
<CheckBox IsChecked="{Binding Settings.EnableSuggestion}" Grid.Row="0"
Margin="0 0 20 0" Margin="14,0,0,0"
Name="EnableSuggestion" HorizontalAlignment="Left"
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion}" /> Orientation="Horizontal">
<ComboBox ItemsSource="{Binding Settings.Suggestions}" <Label Margin="0,15,20,0" Content="{DynamicResource flowlauncher_plugin_websearch_open_search_in}" />
SelectedItem="{Binding Settings.SelectedSuggestion}" <RadioButton
IsEnabled="{Binding ElementName=EnableSuggestion, Path=IsChecked}" /> Name="NewWindowBrowser"
<!-- Not sure why binding IsEnabled directly to Settings.EnableWebSaerchSuggestion is not working --> Margin="0,0,20,0"
Click="OnNewBrowserWindowClick"
Content="{DynamicResource flowlauncher_plugin_websearch_new_window}"
GroupName="OpenSearchBehaviour" />
<RadioButton
Name="NewTabInBrowser"
Click="OnNewTabClick"
Content="{DynamicResource flowlauncher_plugin_websearch_new_tab}"
GroupName="OpenSearchBehaviour" />
</StackPanel> </StackPanel>
<StackPanel Grid.Row="1" HorizontalAlignment="Left" Orientation="Horizontal"> <StackPanel
<Label Content="{DynamicResource flowlauncher_plugin_websearch_open_search_in}" Margin="0 15 20 0"/> Grid.Row="1"
<RadioButton Name="NewWindowBrowser" GroupName="OpenSearchBehaviour" Content="{DynamicResource flowlauncher_plugin_websearch_new_window}" Click="OnNewBrowserWindowClick" Margin="14,3,0,0"
Margin="0 0 20 0"/> HorizontalAlignment="Left"
<RadioButton Name="NewTabInBrowser" GroupName="OpenSearchBehaviour" Content="{DynamicResource flowlauncher_plugin_websearch_new_tab}" Click="OnNewTabClick" /> Orientation="Horizontal">
<Label
Margin="0,0,10,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Content="{DynamicResource flowlaucnher_plugin_websearch_set_browser_path}" />
<TextBox
x:Name="browserPathBox"
Width="250"
Margin="0,0,0,0"
HorizontalAlignment="Left"
Style="{StaticResource BrowserPathBoxStyle}"
TextChanged="OnBrowserPathTextChanged" />
<Button
x:Name="viewButton"
Width="80"
Margin="10,0,0,0"
HorizontalAlignment="Left"
Click="OnChooseClick"
Content="{DynamicResource flowlauncher_plugin_websearch_choose}"
FontSize="13" />
</StackPanel> </StackPanel>
<StackPanel Grid.Row="2" HorizontalAlignment="Left" Margin="0 3 0 0"> <ListView
<Label Content="{DynamicResource flowlaucnher_plugin_websearch_set_browser_path}" Margin="0 0 350 0" HorizontalAlignment="Left" Width="140"/> x:Name="SearchSourcesListView"
<TextBox x:Name="browserPathBox" HorizontalAlignment="Left" Margin="160,-22,0,0" TextChanged="OnBrowserPathTextChanged" Grid.Row="2"
Width="214" Style="{StaticResource BrowserPathBoxStyle}"/> Margin="0,18,0,0"
<Button x:Name="viewButton" HorizontalAlignment="Left" Margin="400,-30,0,0" BorderBrush="DarkGray"
Click="OnChooseClick" FontSize="13" Content="{DynamicResource flowlauncher_plugin_websearch_choose}" Width="80"/> BorderThickness="1"
</StackPanel> GridViewColumnHeader.Click="SortByColumn"
<ListView ItemsSource="{Binding Settings.SearchSources}" ItemsSource="{Binding Settings.SearchSources}"
SelectedItem="{Binding Settings.SelectedSearchSource}" MouseDoubleClick="MouseDoubleClickItem"
x:Name="SearchSourcesListView" SelectedItem="{Binding Settings.SelectedSearchSource}"
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
Grid.Row="3"
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}"
BorderBrush="DarkGray"
BorderThickness="1"
GridViewColumnHeader.Click="SortByColumn"
MouseDoubleClick="MouseDoubleClickItem">
<ListView.View> <ListView.View>
<GridView> <GridView>
<GridViewColumn Header="{DynamicResource flowlauncher_plugin_websearch_title}" <GridViewColumn Width="50">
DisplayMemberBinding="{Binding Title}"
Width="130">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Title}"/> <Image
Width="20"
Height="20"
Margin="6,0,0,0"
Source="{Binding Path=IconPath}" />
</DataTemplate> </DataTemplate>
</GridViewColumn.CellTemplate> </GridViewColumn.CellTemplate>
</GridViewColumn> </GridViewColumn>
<GridViewColumn Header="{DynamicResource flowlauncher_plugin_websearch_action_keyword}"
DisplayMemberBinding="{Binding ActionKeyword}" <GridViewColumn
Width="137"> Width="130"
DisplayMemberBinding="{Binding ActionKeyword}"
Header="{DynamicResource flowlauncher_plugin_websearch_action_keyword}">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding ActionKeyword}"/> <TextBlock Text="{Binding ActionKeyword}" />
</DataTemplate> </DataTemplate>
</GridViewColumn.CellTemplate> </GridViewColumn.CellTemplate>
</GridViewColumn> </GridViewColumn>
<GridViewColumn Header="{DynamicResource flowlauncher_plugin_websearch_url}" <GridViewColumn
DisplayMemberBinding="{Binding Url}" Width="350"
Width="auto"> DisplayMemberBinding="{Binding Title}"
Header="{DynamicResource flowlauncher_plugin_websearch_title}">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Url}"/> <TextBlock Text="{Binding Title}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn
Width="80"
DisplayMemberBinding="{Binding Enabled}"
Header="{DynamicResource flowlauncher_plugin_websearch_enable}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Enabled}" />
</DataTemplate> </DataTemplate>
</GridViewColumn.CellTemplate> </GridViewColumn.CellTemplate>
</GridViewColumn> </GridViewColumn>
</GridView> </GridView>
</ListView.View> </ListView.View>
</ListView> </ListView>
<StackPanel Grid.Row="4" HorizontalAlignment="Right" Orientation="Horizontal"> <StackPanel
<Button Click="OnDeleteSearchSearchClick" Width="100" Margin="10" Grid.Row="3"
Content="{DynamicResource flowlauncher_plugin_websearch_delete}" /> HorizontalAlignment="Right"
<Button Click="OnEditSearchSourceClick" Width="100" Margin="10" Orientation="Horizontal">
Content="{DynamicResource flowlauncher_plugin_websearch_edit}" /> <Button
<Button Click="OnAddSearchSearchClick" Width="100" Margin="10 10 10 10" Width="100"
Content="{DynamicResource flowlauncher_plugin_websearch_add}" /> Margin="10"
Click="OnDeleteSearchSearchClick"
Content="{DynamicResource flowlauncher_plugin_websearch_delete}" />
<Button
Width="100"
Margin="10"
Click="OnEditSearchSourceClick"
Content="{DynamicResource flowlauncher_plugin_websearch_edit}" />
<Button
Width="100"
Margin="10,10,0,10"
Click="OnAddSearchSearchClick"
Content="{DynamicResource flowlauncher_plugin_websearch_add}" />
</StackPanel> </StackPanel>
<Border
Grid.Row="4"
Margin="0,0,0,0"
HorizontalAlignment="Stretch"
BorderBrush="#cecece"
BorderThickness="0,1,0,0">
<DockPanel Margin="0,14,0,0" HorizontalAlignment="Right">
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
<Label
Margin="14,0,10,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion_provider}" />
<ComboBox
Height="30"
Margin="0,0,20,0"
VerticalAlignment="Center"
FontSize="11"
IsEnabled="{Binding ElementName=EnableSuggestion, Path=IsChecked}"
ItemsSource="{Binding Settings.Suggestions}"
SelectedItem="{Binding Settings.SelectedSuggestion}" />
<Label
Margin="0,0,10,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion}" />
<CheckBox
Name="EnableSuggestion"
Margin="0,0,0,0"
IsChecked="{Binding Settings.EnableSuggestion}" />
</StackPanel>
<!-- Not sure why binding IsEnabled directly to Settings.EnableWebSaerchSuggestion is not working -->
</DockPanel>
</Border>
</Grid> </Grid>
</UserControl> </UserControl>

View file

@ -26,7 +26,7 @@
"Name": "Web Searches", "Name": "Web Searches",
"Description": "Provide the web search ability", "Description": "Provide the web search ability",
"Author": "qianlifeng", "Author": "qianlifeng",
"Version": "1.4.0", "Version": "1.4.1",
"Language": "csharp", "Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher", "Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.WebSearch.dll", "ExecuteFileName": "Flow.Launcher.Plugin.WebSearch.dll",

View file

@ -7,6 +7,48 @@
"Url": "https://www.google.com/search?q={q}", "Url": "https://www.google.com/search?q={q}",
"Enabled": true "Enabled": true
}, },
{
"Title": "Youtube",
"ActionKeyword": "youtube",
"IconPath": "Images\\youtube.png",
"Url": "http://www.youtube.com/results?search_query={q}",
"Enabled": true
},
{
"Title": "Netflix",
"ActionKeyword": "netflix",
"IconPath": "Images\\netflix.png",
"Url": "https://www.netflix.com/search?q={q}",
"Enabled": true
},
{
"Title": "Google Translate",
"ActionKeyword": "translate",
"IconPath": "Images\\google_translate.png",
"Url": "http://translate.google.com/#auto|en|{q}",
"Enabled": true
},
{
"Title": "Gmail",
"ActionKeyword": "gmail",
"IconPath": "Images\\gmail.png",
"Url": "https://mail.google.com/mail/ca/u/0/#apps/{q}",
"Enabled": true
},
{
"Title": "Google Drive",
"ActionKeyword": "drive",
"IconPath": "Images\\google_drive.png",
"Url": "http://drive.google.com/?hl=en&tab=bo#search/{q}",
"Enabled": true
},
{
"Title": "Youtube Music",
"ActionKeyword": "ytmusic",
"IconPath": "Images\\youtubemusic.png",
"Url": "https://music.youtube.com/search?q={q}",
"Enabled": true
},
{ {
"Title": "Wikipedia", "Title": "Wikipedia",
"ActionKeyword": "wiki", "ActionKeyword": "wiki",
@ -14,13 +56,6 @@
"Url": "http://en.wikipedia.org/wiki/{q}", "Url": "http://en.wikipedia.org/wiki/{q}",
"Enabled": true "Enabled": true
}, },
{
"Title": "FindIcon",
"ActionKeyword": "findicon",
"IconPath": "Images\\pictures.png",
"Url": "http://findicons.com/search/{q}",
"Enabled": true
},
{ {
"Title": "Facebook", "Title": "Facebook",
"ActionKeyword": "facebook", "ActionKeyword": "facebook",
@ -42,13 +77,6 @@
"Url": "http://maps.google.com/maps?q={q}", "Url": "http://maps.google.com/maps?q={q}",
"Enabled": true "Enabled": true
}, },
{
"Title": "Google Translate",
"ActionKeyword": "translate",
"IconPath": "Images\\google_translate.png",
"Url": "http://translate.google.com/#auto|en|{q}",
"Enabled": true
},
{ {
"Title": "Duckduckgo", "Title": "Duckduckgo",
"ActionKeyword": "duckduckgo", "ActionKeyword": "duckduckgo",
@ -70,20 +98,6 @@
"Url": "https://gist.github.com/search?q={q}", "Url": "https://gist.github.com/search?q={q}",
"Enabled": true "Enabled": true
}, },
{
"Title": "Gmail",
"ActionKeyword": "gmail",
"IconPath": "Images\\gmail.png",
"Url": "https://mail.google.com/mail/ca/u/0/#apps/{q}",
"Enabled": true
},
{
"Title": "Google Drive",
"ActionKeyword": "drive",
"IconPath": "Images\\google_drive.png",
"Url": "http://drive.google.com/?hl=en&tab=bo#search/{q}",
"Enabled": true
},
{ {
"Title": "Wolframalpha", "Title": "Wolframalpha",
"ActionKeyword": "wolframalpha", "ActionKeyword": "wolframalpha",
@ -112,13 +126,6 @@
"Url": "https://www.google.com/search?q={q}&tbm=isch", "Url": "https://www.google.com/search?q={q}&tbm=isch",
"Enabled": true "Enabled": true
}, },
{
"Title": "Youtube",
"ActionKeyword": "youtube",
"IconPath": "Images\\youtube.png",
"Url": "http://www.youtube.com/results?search_query={q}",
"Enabled": true
},
{ {
"Title": "Bing", "Title": "Bing",
"ActionKeyword": "bing", "ActionKeyword": "bing",

View file

@ -78,6 +78,6 @@ on_success:
- ps: | - ps: |
if ($env:APPVEYOR_REPO_BRANCH -eq "master" -and $env:APPVEYOR_REPO_TAG -eq "true") if ($env:APPVEYOR_REPO_BRANCH -eq "master" -and $env:APPVEYOR_REPO_TAG -eq "true")
{ {
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe iwr https://github.com/microsoft/winget-create/releases/download/v0.2.0.29-preview/wingetcreate.exe -OutFile wingetcreate.exe
.\wingetcreate.exe update Flow-Launcher.Flow-Launcher -s true -u https://github.com/Flow-Launcher/Flow.Launcher/releases/download/v$env:flowVersion/Flow-Launcher-Setup.exe -v $env:flowVersion -t $env:winget_token .\wingetcreate.exe update Flow-Launcher.Flow-Launcher -s true -u https://github.com/Flow-Launcher/Flow.Launcher/releases/download/v$env:flowVersion/Flow-Launcher-Setup.exe -v $env:flowVersion -t $env:winget_token
} }