- Add 'Always open priview' in settings

This commit is contained in:
DB p 2022-09-02 15:12:32 +09:00
parent e8ccd46589
commit 7b7e038900
4 changed files with 37 additions and 4 deletions

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
@ -137,6 +137,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
/// when false Alphabet static service will always return empty results
/// </summary>
public bool ShouldUsePinyin { get; set; } = false;
public bool AlwaysPreview { get; set; } = false;
[JsonInclude, JsonConverter(typeof(JsonStringEnumConverter))]
public SearchPrecisionScore QuerySearchPrecision { get; private set; } = SearchPrecisionScore.Regular;
@ -220,4 +221,4 @@ namespace Flow.Launcher.Infrastructure.UserSettings
Light,
Dark
}
}
}

View file

@ -56,6 +56,8 @@
<system:String x:Key="querySearchPrecisionToolTip">Changes minimum match score required for results.</system:String>
<system:String x:Key="ShouldUsePinyin">Should Use Pinyin</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="AlwaysPreview">Always open preview when start search</system:String>
<system:String x:Key="AlwaysPreviewToolTip">If uncheck, preview not showing when start launch. Please use F2 key.</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

@ -44,7 +44,7 @@ namespace Flow.Launcher
_viewModel = mainVM;
_settings = settings;
InitializeComponent();
InitializePosition();
InitializePosition();
animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"));
}
@ -108,6 +108,7 @@ namespace Flow.Launcher
}
UpdatePosition();
PreviewReset();
Activate();
QueryTextBox.Focus();
_settings.ActivateTimes++;
@ -309,7 +310,7 @@ namespace Flow.Launcher
return;
_animating = true;
UpdatePosition();
UpdatePosition();
Storyboard sb = new Storyboard();
Storyboard iconsb = new Storyboard();
CircleEase easing = new CircleEase(); // or whatever easing class you want
@ -542,6 +543,19 @@ namespace Flow.Launcher
}
}
public void PreviewReset()
{
if (_settings.AlwaysPreview == true)
{
ResultArea.SetValue(Grid.ColumnSpanProperty, 1);
Preview.Visibility = Visibility.Visible;
}
else
{
ResultArea.SetValue(Grid.ColumnSpanProperty, 2);
Preview.Visibility = Visibility.Collapsed;
}
}
public void PreviewToggle()
{

View file

@ -657,6 +657,22 @@
</ItemsControl>
</Border>
<Border Margin="0,30,0,0" Style="{DynamicResource SettingGroupBox}">
<ItemsControl Style="{StaticResource SettingGrid}">
<StackPanel Style="{StaticResource TextPanel}">
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource AlwaysPreview}" />
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource AlwaysPreviewToolTip}" />
</StackPanel>
<CheckBox
IsChecked="{Binding Settings.AlwaysPreview}"
Style="{DynamicResource SideControlCheckBox}"
ToolTip="{DynamicResource AlwaysPreviewToolTip}" />
<TextBlock Style="{StaticResource Glyph}">
&#xe8ff;
</TextBlock>
</ItemsControl>
</Border>
<Border Margin="0,30,0,0" Style="{DynamicResource SettingGroupBox}">
<ItemsControl Style="{StaticResource SettingGrid}">
<StackPanel Style="{StaticResource TextPanel}">