Merge branch 'dev' of github.com:Flow-Launcher/Flow.Launcher into HEAD

This commit is contained in:
Hongtao Zhang 2023-01-12 15:11:26 -06:00
commit 01f568f3c5
No known key found for this signature in database
GPG key ID: 75F655B91C7AC9BB
22 changed files with 419 additions and 89 deletions

View file

@ -41,25 +41,26 @@ body:
- type: input
attributes:
label: Flow Launcher Version
description: Go to "Settings" => "About".
value: v1.8.3
description: Go to "Settings" => "About". If you are using a prerelease version please append the build number.
placeholder: "Example: 1.11.0"
validations:
required: true
- type: input
attributes:
label: Windows Build Number
description: Run "ver" at CMD (command prompt).
value: 10.0.19043.1288
description: Run "ver" at CMD (command prompt) or go to Windows Settings -> Systems -> About.
placeholder: "Example: 10.0.19043.1288"
validations:
required: true
- type: textarea
id: logs
attributes:
label: Error Log
description: >
Log file place:
- The latest version place: `%AppData%\FlowLauncher\Logs\<version>\<date>.txt`
- For portable mode: `%LocalAppData%\FlowLauncher\<App-Version>\UserData\Logs\<version>\<date>.txt`
From flow type 'open log location' and find log file with the corresponding date containing the error info.
value: >
<details>

View file

@ -62,3 +62,25 @@ TobiasSekan
Img
img
resx
directx
mvvm
dlg
ddd
dddd
clearlogfolder
ACCENT_ENABLE_TRANSPARENTGRADIENT
ACCENT_ENABLE_BLURBEHIND
WCA_ACCENT_POLICY
HGlobal
dopusrt
firefox
msedge
svgc
ime
zindex
txb
btn
otf
searchplugin
Noresult
wpftk

View file

@ -36,7 +36,7 @@ namespace Flow.Launcher.Core.Resource
{
_themeDirectories.Add(DirectoryPath);
_themeDirectories.Add(UserDirectoryPath);
MakesureThemeDirectoriesExist();
MakeSureThemeDirectoriesExist();
var dicts = Application.Current.Resources.MergedDictionaries;
_oldResource = dicts.First(d =>
@ -55,20 +55,17 @@ namespace Flow.Launcher.Core.Resource
_oldTheme = Path.GetFileNameWithoutExtension(_oldResource.Source.AbsolutePath);
}
private void MakesureThemeDirectoriesExist()
private void MakeSureThemeDirectoriesExist()
{
foreach (string dir in _themeDirectories)
foreach (var dir in _themeDirectories.Where(dir => !Directory.Exists(dir)))
{
if (!Directory.Exists(dir))
try
{
try
{
Directory.CreateDirectory(dir);
}
catch (Exception e)
{
Log.Exception($"|Theme.MakesureThemeDirectoriesExist|Exception when create directory <{dir}>", e);
}
Directory.CreateDirectory(dir);
}
catch (Exception e)
{
Log.Exception($"|Theme.MakesureThemeDirectoriesExist|Exception when create directory <{dir}>", e);
}
}
}
@ -82,13 +79,14 @@ namespace Flow.Launcher.Core.Resource
{
if (string.IsNullOrEmpty(path))
throw new DirectoryNotFoundException("Theme path can't be found <{path}>");
Settings.Theme = theme;
// reload all resources even if the theme itself hasn't changed in order to pickup changes
// to things like fonts
UpdateResourceDictionary(GetResourceDictionary());
UpdateResourceDictionary(GetResourceDictionary(theme));
Settings.Theme = theme;
//always allow re-loading default theme, in case of failure of switching to a new theme from default theme
if (_oldTheme != theme || theme == defaultTheme)
{
@ -134,9 +132,9 @@ namespace Flow.Launcher.Core.Resource
_oldResource = dictionaryToUpdate;
}
private ResourceDictionary CurrentThemeResourceDictionary()
private ResourceDictionary GetThemeResourceDictionary(string theme)
{
var uri = GetThemePath(Settings.Theme);
var uri = GetThemePath(theme);
var dict = new ResourceDictionary
{
Source = new Uri(uri, UriKind.Absolute)
@ -145,10 +143,12 @@ namespace Flow.Launcher.Core.Resource
return dict;
}
public ResourceDictionary GetResourceDictionary()
private ResourceDictionary CurrentThemeResourceDictionary() => GetThemeResourceDictionary(Settings.Theme);
public ResourceDictionary GetResourceDictionary(string theme)
{
var dict = CurrentThemeResourceDictionary();
var dict = GetThemeResourceDictionary(theme);
if (dict["QueryBoxStyle"] is Style queryBoxStyle &&
dict["QuerySuggestionBoxStyle"] is Style querySuggestionBoxStyle)
{
@ -200,6 +200,11 @@ namespace Flow.Launcher.Core.Resource
return dict;
}
private ResourceDictionary GetCurrentResourceDictionary( )
{
return GetResourceDictionary(Settings.Theme);
}
public List<string> LoadAvailableThemes()
{
List<string> themes = new List<string>();
@ -229,7 +234,7 @@ namespace Flow.Launcher.Core.Resource
public void AddDropShadowEffectToCurrentTheme()
{
var dict = GetResourceDictionary();
var dict = GetCurrentResourceDictionary();
var windowBorderStyle = dict["WindowBorderStyle"] as Style;
@ -273,7 +278,7 @@ namespace Flow.Launcher.Core.Resource
public void RemoveDropShadowEffectFromCurrentTheme()
{
var dict = CurrentThemeResourceDictionary();
var dict = GetCurrentResourceDictionary();
var windowBorderStyle = dict["WindowBorderStyle"] as Style;
var effectSetter = windowBorderStyle.Setters.FirstOrDefault(setterBase => setterBase is Setter setter && setter.Property == Border.EffectProperty) as Setter;

View file

@ -15,7 +15,7 @@ namespace Flow.Launcher.Infrastructure
{
var explorerWindow = GetActiveExplorer();
string locationUrl = explorerWindow?.LocationURL;
return !string.IsNullOrEmpty(locationUrl) ? new Uri(locationUrl).LocalPath : null;
return !string.IsNullOrEmpty(locationUrl) ? new Uri(locationUrl).LocalPath + "\\" : null;
}
/// <summary>

View file

@ -13,6 +13,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public class Settings : BaseModel
{
private string language = "en";
private string _theme = Constant.DefaultTheme;
public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}";
public string OpenResultModifiers { get; set; } = KeyConstant.Alt;
public string ColorScheme { get; set; } = "System";
@ -29,7 +30,18 @@ namespace Flow.Launcher.Infrastructure.UserSettings
OnPropertyChanged();
}
}
public string Theme { get; set; } = Constant.DefaultTheme;
public string Theme
{
get => _theme;
set
{
if (value == _theme)
return;
_theme = value;
OnPropertyChanged();
OnPropertyChanged(nameof(MaxResultsToShow));
}
}
public bool UseDropShadowEffect { get; set; } = false;
public string QueryBoxFont { get; set; } = FontFamily.GenericSansSerif.Name;
public string QueryBoxFontStyle { get; set; }
@ -214,7 +226,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
}
}
public bool LeaveCmdOpen { get; set; }
public bool HideWhenDeactive { get; set; } = true;
public bool HideWhenDeactivated { get; set; } = true;
public SearchWindowPositions SearchWindowPosition { get; set; } = SearchWindowPositions.MouseScreenCenter;
public bool IgnoreHotkeysOnFullscreen { get; set; }

View file

@ -48,7 +48,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1">
<PrivateAssets>all</PrivateAssets>

View file

@ -0,0 +1,25 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace Flow.Launcher.Converters
{
public class DiameterToCenterPointConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is double d)
{
return new Point(d / 2, d / 2);
}
return new Point(0, 0);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
}

View file

@ -0,0 +1,27 @@
using System;
using System.Globalization;
using System.Windows.Data;
using Windows.Devices.PointOfService;
namespace Flow.Launcher.Converters
{
public class IconRadiusConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values.Length != 2)
throw new ArgumentException("IconRadiusConverter must have 2 parameters");
return values[1] switch
{
true => (double)values[0] / 2,
false => (double)values[0],
_ => throw new ArgumentException("The second argument should be boolean", nameof(values))
};
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
}

View file

@ -91,7 +91,7 @@
</PackageReference>
<PackageReference Include="InputSimulator" Version="1.0.4" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
<PackageReference Include="ModernWpfUI" Version="0.9.4" />
<PackageReference Include="ModernWpfUI" Version="0.9.6" />
<PackageReference Include="NHotkey.Wpf" Version="2.1.0" />
<PackageReference Include="NuGet.CommandLine" Version="6.3.1">
<PrivateAssets>all</PrivateAssets>

View file

@ -9,11 +9,11 @@
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
d:DataContext="{d:DesignInstance Type=vm:MainViewModel}"
Name="FlowMainWindow"
Title="Flow Launcher"
MinWidth="{Binding MainWindowWidth, Mode=OneWay}"
MaxWidth="{Binding MainWindowWidth, Mode=OneWay}"
d:DataContext="{d:DesignInstance Type=vm:MainViewModel}"
AllowDrop="True"
AllowsTransparency="True"
Background="Transparent"
@ -38,9 +38,9 @@
<converters:QuerySuggestionBoxConverter x:Key="QuerySuggestionBoxConverter" />
<converters:BorderClipConverter x:Key="BorderClipConverter" />
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
<converters:BoolToIMEConversionModeConverter x:Key="BoolToIMEConversionModeConverter"/>
<converters:BoolToIMEStateConverter x:Key="BoolToIMEStateConverter"/>
<converters:StringToKeyBindingConverter x:Key="StringToKeyBindingConverter"/>
<converters:BoolToIMEConversionModeConverter x:Key="BoolToIMEConversionModeConverter" />
<converters:BoolToIMEStateConverter x:Key="BoolToIMEStateConverter" />
<converters:StringToKeyBindingConverter x:Key="StringToKeyBindingConverter" />
</Window.Resources>
<Window.InputBindings>
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
@ -180,11 +180,11 @@
<KeyBinding
Key="F12"
Command="{Binding ToggleGameModeCommand}"
Modifiers="Ctrl"/>
Modifiers="Ctrl" />
<KeyBinding
Key="{Binding PreviewHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}"
Command="{Binding TogglePreviewCommand}"
Modifiers="{Binding PreviewHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}"/>
Modifiers="{Binding PreviewHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" />
</Window.InputBindings>
<Grid>
<Border MouseDown="OnMouseDown" Style="{DynamicResource WindowBorderStyle}">
@ -207,12 +207,12 @@
<TextBox
x:Name="QueryTextBox"
AllowDrop="True"
InputMethod.PreferredImeConversionMode="{Binding StartWithEnglishMode, Converter={StaticResource BoolToIMEConversionModeConverter}}"
InputMethod.PreferredImeState="{Binding StartWithEnglishMode, Converter={StaticResource BoolToIMEStateConverter}}"
PreviewDragOver="OnPreviewDragOver"
PreviewKeyUp="QueryTextBox_KeyUp"
Style="{DynamicResource QueryBoxStyle}"
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
InputMethod.PreferredImeConversionMode="{Binding StartWithEnglishMode, Converter={StaticResource BoolToIMEConversionModeConverter}}"
InputMethod.PreferredImeState="{Binding StartWithEnglishMode, Converter={StaticResource BoolToIMEStateConverter}}"
Visibility="Visible">
<TextBox.CommandBindings>
<CommandBinding Command="ApplicationCommands.Copy" Executed="OnCopy" />
@ -273,9 +273,6 @@
<Grid>
<Image
x:Name="PluginActivationIcon"
Width="32"
Height="32"
Margin="0,0,18,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Panel.ZIndex="2"
@ -403,10 +400,10 @@
VerticalAlignment="Stretch"
Style="{DynamicResource PreviewArea}"
Visibility="{Binding PreviewVisible, Converter={StaticResource BoolToVisibilityConverter}}">
<Border
Style="{DynamicResource PreviewBorderStyle}"
<Border
d:DataContext="{d:DesignInstance vm:ResultViewModel}"
DataContext="{Binding SelectedItem, ElementName=ResultListBox}"
Style="{DynamicResource PreviewBorderStyle}"
Visibility="{Binding ShowDefaultPreview}">
<Grid
Margin="20,0,10,0"
@ -478,10 +475,10 @@
</StackPanel>
</Grid>
</Border>
<Border
<Border
d:DataContext="{d:DesignInstance vm:ResultViewModel}"
DataContext="{Binding SelectedItem, ElementName=ResultListBox}"
Style="{DynamicResource PreviewBorderStyle}"
Style="{DynamicResource PreviewBorderStyle}"
Visibility="{Binding ShowCustomizedPreview}">
<ContentControl Content="{Binding Result.PreviewPanel.Value}" />
</Border>

View file

@ -485,7 +485,7 @@ namespace Flow.Launcher
if (_settings.UseAnimation)
await Task.Delay(100);
if (_settings.HideWhenDeactive)
if (_settings.HideWhenDeactivated)
{
_viewModel.Hide();
}

View file

@ -31,6 +31,10 @@
mc:Ignorable="d">
<!-- IsSynchronizedWithCurrentItem: http://stackoverflow.com/a/7833798/2833083 -->
<ListBox.Resources>
<converter:IconRadiusConverter x:Key="IconRadiusConverter" />
<converter:DiameterToCenterPointConverter x:Key="DiameterToCenterPointConverter" />
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
<Button HorizontalAlignment="Stretch">
@ -52,7 +56,7 @@
<converter:OpenResultHotkeyVisibilityConverter x:Key="OpenResultHotkeyVisibilityConverter" />
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60" />
<ColumnDefinition Style="{DynamicResource ImageAreaWidth}" />
<ColumnDefinition Width="9*" />
<ColumnDefinition Width="Auto" MinWidth="8" />
</Grid.ColumnDefinitions>
@ -99,20 +103,29 @@
BorderThickness="1">
<Image
x:Name="ImageIcon"
Width="{Binding IconXY}"
Height="{Binding IconXY}"
Margin="0,0,0,0"
HorizontalAlignment="Center"
IsHitTestVisible="False"
RenderOptions.BitmapScalingMode="Fant"
Source="{Binding Image, TargetNullValue={x:Null}}"
Stretch="Uniform"
Style="{DynamicResource ImageIconStyle}"
Visibility="{Binding ShowIcon}">
<Image.Clip>
<EllipseGeometry
Center="16 16"
RadiusX="{Binding IconRadius}"
RadiusY="{Binding IconRadius}" />
<EllipseGeometry Center="{Binding ElementName=ImageIcon, Path=ActualWidth, Converter={StaticResource DiameterToCenterPointConverter}}">
<EllipseGeometry.RadiusX>
<MultiBinding Converter="{StaticResource IconRadiusConverter}">
<Binding ElementName="ImageIcon" Path="ActualWidth" />
<Binding Path="Result.RoundedIcon" />
</MultiBinding>
</EllipseGeometry.RadiusX>
<EllipseGeometry.RadiusY>
<MultiBinding Converter="{StaticResource IconRadiusConverter}">
<Binding ElementName="ImageIcon" Path="ActualWidth" />
<Binding Path="Result.RoundedIcon" />
</MultiBinding>
</EllipseGeometry.RadiusY>
</EllipseGeometry>
</Image.Clip>
</Image>
</Border>
@ -196,7 +209,6 @@
<Setter TargetName="Title" Property="Style" Value="{DynamicResource ItemTitleSelectedStyle}" />
<Setter TargetName="SubTitle" Property="Style" Value="{DynamicResource ItemSubTitleSelectedStyle}" />
<Setter TargetName="Hotkey" Property="Style" Value="{DynamicResource ItemHotkeySelectedStyle}" />
<Setter TargetName="ImageIcon" Property="Style" Value="{DynamicResource ItemImageSelectedStyle}" />
<Setter TargetName="GlyphIcon" Property="Style" Value="{DynamicResource ItemGlyphSelectedStyle}" />
</DataTrigger>
</DataTemplate.Triggers>
@ -207,7 +219,7 @@
<Style TargetType="{x:Type ListBoxItem}">
<EventSetter Event="MouseEnter" Handler="OnMouseEnter" />
<EventSetter Event="MouseMove" Handler="OnMouseMove" />
<Setter Property="Height" Value="52" />
<Setter Property="Height" Value="{DynamicResource ResultItemHeight}" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="BorderThickness" Value="0" />
@ -240,4 +252,4 @@
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</ListBox>

View file

@ -673,7 +673,7 @@
<ui:ToggleSwitch
Grid.Column="2"
FocusVisualMargin="5"
IsOn="{Binding Settings.HideWhenDeactive}"
IsOn="{Binding Settings.HideWhenDeactivated}"
Style="{DynamicResource SideToggleSwitch}" />
</ItemsControl>
</Border>
@ -1821,7 +1821,7 @@
</Border.Clip>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="54" />
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
@ -2438,7 +2438,7 @@
<Border Margin="0,8,0,0" Style="{DynamicResource SettingGroupBox}">
<ItemsControl Style="{StaticResource SettingGrid}">
<StackPanel Style="{StaticResource TextPanel}">
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource previewHotkey}"/>
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource previewHotkey}" />
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource previewHotkeyToolTip}" />
</StackPanel>
<flowlauncher:HotkeyControl

View file

@ -6,7 +6,9 @@
<CornerRadius x:Key="ItemRadius">0</CornerRadius>
<Thickness x:Key="ItemMargin">0</Thickness>
<Thickness x:Key="ResultMargin">0</Thickness>
<!-- Further font customisations are dynamically loaded in Theme.cs -->
<!-- Further font customizations are dynamically loaded in Theme.cs -->
<system:Double x:Key="ResultItemHeight">52</system:Double>
<Style x:Key="BaseBulletStyle" TargetType="{x:Type Border}" />
<Style
@ -17,6 +19,10 @@
x:Key="ItemBulletSelectedStyle"
BasedOn="{StaticResource BaseBulletStyle}"
TargetType="{x:Type Border}" />
<Style x:Key="ImageIconStyle" TargetType="{x:Type Image}">
<Setter Property="Height" Value="32" />
<Setter Property="Width" Value="32" />
</Style>
<Style x:Key="BaseQueryBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="BorderThickness" Value="0" />
@ -301,7 +307,7 @@
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
<!-- Scrollbar in thr rigth of ScrollViewer -->
<!-- Scrollbar in the right of ScrollViewer -->
<ScrollBar
x:Name="PART_VerticalScrollBar"
Grid.Row="0"
@ -385,7 +391,7 @@
<Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="#8f8f8f" />
</Style>
<Style x:Key="BaseItemHotkeySelecetedStyle" TargetType="{x:Type TextBlock}">
<Style x:Key="BaseItemHotkeySelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="#8f8f8f" />
</Style>
@ -425,6 +431,9 @@
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="ImageAreaWidth" TargetType="{x:Type ColumnDefinition}">
<Setter Property="Width" Value="60" />
</Style>
<Style
x:Key="PreviewGlyph"
BasedOn="{StaticResource BasePreviewGlyph}"
@ -464,6 +473,14 @@
</Style.Triggers>
</Style>
<!-- for classic themes -->
<Style x:Key="PluginActivationIcon" TargetType="{x:Type Image}">
<Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" />
<Setter Property="Margin" Value="0,0,18,0" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="SearchIconStyle" TargetType="{x:Type Path}">
<Setter Property="Fill" Value="#555555" />
<Setter Property="Width" Value="32" />
@ -492,7 +509,7 @@
</Style>
<Style
x:Key="ItemHotkeySelectedStyle"
BasedOn="{StaticResource BaseItemHotkeySelecetedStyle}"
BasedOn="{StaticResource BaseItemHotkeySelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="#8f8f8f" />

View file

@ -106,7 +106,7 @@
</Style>
<Style
x:Key="ItemHotkeySelectedStyle"
BasedOn="{StaticResource BaseItemHotkeySelecetedStyle}"
BasedOn="{StaticResource BaseItemHotkeySelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="#ff79c6" />

View file

@ -0,0 +1,217 @@
<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>
<system:Double x:Key="ResultItemHeight">38</system:Double>
<Style x:Key="ImageAreaWidth" TargetType="{x:Type ColumnDefinition}">
<Setter Property="Width" Value="46" />
</Style>
<Style x:Key="ImageIconStyle" TargetType="{x:Type Image}">
<Setter Property="Height" Value="24" />
<Setter Property="Width" Value="24" />
</Style>
<Style
x:Key="ItemGlyph"
BasedOn="{StaticResource BaseGlyphStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="24" />
<Setter Property="Width" Value="24" />
<Setter Property="Height" Value="24" />
<Setter Property="Foreground" Value="#100f0f" />
</Style>
<Style
x:Key="QueryBoxStyle"
BasedOn="{StaticResource BaseQueryBoxStyle}"
TargetType="{x:Type TextBox}">
<Setter Property="Padding" Value="0,2,42,0" />
<Setter Property="Foreground" Value="#282728" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Height" Value="24" />
</Style>
<Style
x:Key="QuerySuggestionBoxStyle"
BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}"
TargetType="{x:Type TextBox}">
<Setter Property="Padding" Value="0,2,42,0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Height" Value="24" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Foreground" Value="#8f8c8f" />
</Style>
<Style
x:Key="WindowBorderStyle"
BasedOn="{StaticResource BaseWindowBorderStyle}"
TargetType="{x:Type Border}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="#bcbabd" />
<Setter Property="Background" Value="#edebee" />
<Setter Property="CornerRadius" Value="6" />
<Setter Property="UseLayoutRounding" Value="True" />
</Style>
<Style
x:Key="WindowStyle"
BasedOn="{StaticResource BaseWindowStyle}"
TargetType="{x:Type Window}" />
<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="FontSize" Value="14" />
<Setter Property="Foreground" Value="#100f0f" />
</Style>
<Style
x:Key="ItemSubTitleStyle"
BasedOn="{StaticResource BaseItemSubTitleStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="10" />
<Setter Property="Foreground" Value="#8f8d90" />
</Style>
<Style
x:Key="SeparatorStyle"
BasedOn="{StaticResource BaseSeparatorStyle}"
TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="#dedcde" />
<Setter Property="Height" Value="1" />
<Setter Property="Margin" Value="0,0,0,4" />
</Style>
<Style x:Key="HighlightStyle" />
<Style
x:Key="ItemTitleSelectedStyle"
BasedOn="{StaticResource BaseItemTitleSelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="#100f0f" />
</Style>
<Style
x:Key="ItemSubTitleSelectedStyle"
BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="10" />
<Setter Property="Foreground" Value="#8f8d90" />
</Style>
<SolidColorBrush x:Key="ItemSelectedBackgroundColor">#d6d4d7</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
Width="4"
Margin="0,0,2,0"
Background="#878687"
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="SearchIconStyle"
BasedOn="{StaticResource BaseSearchIconStyle}"
TargetType="{x:Type Path}">
<Setter Property="Fill" Value="#d5d3d6" />
<Setter Property="Width" Value="24" />
<Setter Property="Height" Value="24" />
</Style>
<Style x:Key="SearchIconPosition" TargetType="{x:Type Canvas}">
<Setter Property="Background" Value="#edebee" />
<Setter Property="Width" Value="24" />
<Setter Property="Height" Value="24" />
<Setter Property="Margin" Value="0,0,8,0" />
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
<Style x:Key="PluginActivationIcon" TargetType="{x:Type Image}">
<Setter Property="Width" Value="24" />
<Setter Property="Height" Value="24" />
<Setter Property="Margin" Value="0,0,8,0" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="ItemHotkeyStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="#8f8d90" />
</Style>
<Style x:Key="ItemHotkeySelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="#8f8d90" />
</Style>
<Style x:Key="ItemGlyphSelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#100f0f" />
<Setter Property="Width" Value="24" />
<Setter Property="Height" Value="24" />
<Setter Property="FontSize" Value="24" />
</Style>
<CornerRadius x:Key="ItemRadius">6</CornerRadius>
<Thickness x:Key="ItemMargin">4 0 4 0</Thickness>
<Thickness x:Key="ResultMargin">0 0 0 4</Thickness>
<Style
x:Key="ClockPanel"
BasedOn="{StaticResource ClockPanel}"
TargetType="{x:Type StackPanel}">
<Setter Property="Orientation" Value="Horizontal" />
<Setter Property="Margin" Value="0,0,42,0" />
</Style>
<Style
x:Key="ClockBox"
BasedOn="{StaticResource BaseClockBox}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="#8f8d90" />
<Setter Property="Margin" Value="0,0,10,0" />
</Style>
<Style
x:Key="DateBox"
BasedOn="{StaticResource BaseDateBox}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="#8f8d90" />
</Style>
<Style
x:Key="PreviewBorderStyle"
BasedOn="{StaticResource BasePreviewBorderStyle}"
TargetType="{x:Type Border}">
<Setter Property="Margin" Value="0,0,10,8" />
<Setter Property="BorderBrush" Value="#dedcde" />
</Style>
<Style
x:Key="PreviewItemTitleStyle"
BasedOn="{StaticResource BasePreviewItemTitleStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#100f0f" />
</Style>
<Style
x:Key="PreviewItemSubTitleStyle"
BasedOn="{StaticResource BasePreviewItemSubTitleStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#8f8d90" />
</Style>
<Style
x:Key="PreviewGlyph"
BasedOn="{StaticResource BasePreviewGlyph}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#100f0f" />
</Style>
</ResourceDictionary>

View file

@ -120,7 +120,7 @@
</Style>
<Style
x:Key="ItemHotkeySelectedStyle"
BasedOn="{StaticResource BaseItemHotkeySelecetedStyle}"
BasedOn="{StaticResource BaseItemHotkeySelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="#acacac" />

View file

@ -113,7 +113,7 @@
</Style>
<Style
x:Key="ItemHotkeySelectedStyle"
BasedOn="{StaticResource BaseItemHotkeySelecetedStyle}"
BasedOn="{StaticResource BaseItemHotkeySelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="{DynamicResource HotkeySelectedForeground}" />

View file

@ -710,7 +710,7 @@ namespace Flow.Launcher.ViewModel
if (query == null) // shortcut expanded
{
Results.Clear();
// Results.Visbility = Visibility.Collapsed;
// Results.Visibility = Visibility.Collapsed;
PluginIconPath = null;
SearchIconVisibility = Visibility.Visible;
return;

View file

@ -188,7 +188,7 @@ namespace Flow.Launcher.ViewModel
{
try
{
var image = await Task.Run(() => icon()).ConfigureAwait(false);
var image = icon();
return image;
}
catch (Exception e)

View file

@ -60,7 +60,7 @@ namespace Flow.Launcher.ViewModel
#region Properties
public int MaxHeight => MaxResults * 52;
public double MaxHeight => MaxResults * (double)Application.Current.FindResource("ResultItemHeight")!;
public int SelectedIndex { get; set; }

View file

@ -325,18 +325,14 @@ namespace Flow.Launcher.ViewModel
public IList<PluginViewModel> PluginViewModels
{
get
{
var metadatas = PluginManager.AllPlugins
.OrderBy(x => x.Metadata.Disabled)
.ThenBy(y => y.Metadata.Name)
.Select(p => new PluginViewModel
{
PluginPair = p
})
.ToList();
return metadatas;
}
get => PluginManager.AllPlugins
.OrderBy(x => x.Metadata.Disabled)
.ThenBy(y => y.Metadata.Name)
.Select(p => new PluginViewModel
{
PluginPair = p
})
.ToList();
}
public IList<PluginStoreItemViewModel> ExternalPlugins
@ -407,7 +403,6 @@ namespace Flow.Launcher.ViewModel
get { return Settings.Theme; }
set
{
Settings.Theme = value;
ThemeManager.Instance.ChangeTheme(value);
if (ThemeManager.Instance.BlurEnabled && Settings.UseDropShadowEffect)