Add UI to toggle QuickLook usage

This commit is contained in:
Vic 2023-04-22 15:00:21 +08:00
parent 99b5197372
commit 1e1f29b163
4 changed files with 26 additions and 4 deletions

View file

@ -159,7 +159,11 @@ namespace Flow.Launcher.Infrastructure.UserSettings
/// when false Alphabet static service will always return empty results
/// </summary>
public bool ShouldUsePinyin { get; set; } = false;
public bool UseQuickLook { get; set; } = false;
public bool AlwaysPreview { get; set; } = false;
public bool AlwaysStartEn { get; set; } = false;
[JsonInclude, JsonConverter(typeof(JsonStringEnumConverter))]

View file

@ -80,6 +80,8 @@
<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="AlwaysPreview">Always Preview</system:String>
<system:String x:Key="AlwaysPreviewToolTip">Always open preview panel when Flow activates. Press {0} to toggle preview.</system:String>
<system:String x:Key="UseQuickLook">Use QuickLook</system:String>
<system:String x:Key="UseQuickLookToolTip">Use QuickLook to preview file results.</system:String>
<system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String>
<!-- Setting Plugin -->

View file

@ -859,6 +859,24 @@
</ItemsControl>
</Border>
<Border Style="{DynamicResource SettingGroupBox}">
<ItemsControl Style="{StaticResource SettingGrid}">
<StackPanel Style="{StaticResource TextPanel}">
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource UseQuickLook}" />
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource UseQuickLookToolTip}" />
</StackPanel>
<ui:ToggleSwitch
Grid.Column="2"
FocusVisualMargin="5"
IsOn="{Binding Settings.UseQuickLook}"
Style="{DynamicResource SideToggleSwitch}"
ToolTip="{DynamicResource UseQuickLookToolTip}" />
<TextBlock Style="{StaticResource Glyph}">
&#xe8a1;
</TextBlock>
</ItemsControl>
</Border>
<Border Margin="0,30,0,0" Style="{DynamicResource SettingGroupBox}">
<ItemsControl Style="{StaticResource SettingGrid}">
<StackPanel Style="{StaticResource TextPanel}">

View file

@ -575,8 +575,7 @@ namespace Flow.Launcher.ViewModel
[RelayCommand]
private void TogglePreview()
{
bool useThirdPartyPreview = true;
if (useThirdPartyPreview)
if (Settings.UseQuickLook)
{
if (!ExternalPreviewOpen)
{
@ -624,8 +623,7 @@ namespace Flow.Launcher.ViewModel
private void UpdatePreview()
{
bool useThirdPartyPreview = true;
if (useThirdPartyPreview)
if (Settings.UseQuickLook)
{
if (ExternalPreviewOpen)
{