mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add StartEn Setting
This commit is contained in:
parent
9c369c4ead
commit
5cc4a36762
5 changed files with 52 additions and 4 deletions
|
|
@ -147,6 +147,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
/// </summary>
|
||||
public bool ShouldUsePinyin { get; set; } = false;
|
||||
public bool AlwaysPreview { get; set; } = false;
|
||||
public bool AlwaysStartEn { get; set; } = false;
|
||||
|
||||
[JsonInclude, JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public SearchPrecisionScore QuerySearchPrecision { get; private set; } = SearchPrecisionScore.Regular;
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@
|
|||
<system:String x:Key="defaultFileManagerToolTip">Select the file manager to use when opening the folder.</system:String>
|
||||
<system:String x:Key="defaultBrowser">Default Web Browser</system:String>
|
||||
<system:String x:Key="defaultBrowserToolTip">Setting for New Tab, New Window, Private Mode.</system:String>
|
||||
<system:String x:Key="typingStartEn">Always Start in English Layout</system:String>
|
||||
<system:String x:Key="typingStartEnTooltip">If you are using both native language and English keyboard layouts, start the flow in English layout state.</system:String>
|
||||
<system:String x:Key="pythonDirectory">Python Directory</system:String>
|
||||
<system:String x:Key="autoUpdates">Auto Update</system:String>
|
||||
<system:String x:Key="selectPythonDirectory">Select</system:String>
|
||||
|
|
|
|||
|
|
@ -244,6 +244,7 @@
|
|||
</TextBox>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<StackPanel
|
||||
x:Name="ClockPanel"
|
||||
IsHitTestVisible="False"
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ using System.Security.Cryptography;
|
|||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.VisualBasic.Devices;
|
||||
using Microsoft.FSharp.Data.UnitSystems.SI.UnitNames;
|
||||
using NLog.Targets;
|
||||
using YamlDotNet.Core.Tokens;
|
||||
using Key = System.Windows.Input.Key;
|
||||
|
||||
namespace Flow.Launcher
|
||||
{
|
||||
|
|
@ -128,6 +131,7 @@ namespace Flow.Launcher
|
|||
UpdatePosition();
|
||||
PreviewReset();
|
||||
Activate();
|
||||
QueryTextBox_StartEn();
|
||||
QueryTextBox.Focus();
|
||||
_settings.ActivateTimes++;
|
||||
if (!_viewModel.LastQuerySelected)
|
||||
|
|
@ -191,6 +195,9 @@ namespace Flow.Launcher
|
|||
case nameof(Settings.Language):
|
||||
UpdateNotifyIconText();
|
||||
break;
|
||||
case nameof(Settings.AlwaysStartEn):
|
||||
QueryTextBox_StartEn();
|
||||
break;
|
||||
case nameof(Settings.Hotkey):
|
||||
UpdateNotifyIconText();
|
||||
break;
|
||||
|
|
@ -696,5 +703,19 @@ namespace Flow.Launcher
|
|||
be.UpdateSource();
|
||||
}
|
||||
}
|
||||
|
||||
private void QueryTextBox_StartEn()
|
||||
{
|
||||
if (_settings.AlwaysStartEn)
|
||||
{
|
||||
QueryTextBox.SetValue(InputMethod.PreferredImeConversionModeProperty, ImeConversionModeValues.Alphanumeric);
|
||||
QueryTextBox.SetValue(InputMethod.PreferredImeStateProperty, InputMethodState.Off);
|
||||
}
|
||||
else
|
||||
{
|
||||
QueryTextBox.ClearValue(InputMethod.PreferredImeConversionModeProperty);
|
||||
QueryTextBox.ClearValue(InputMethod.PreferredImeStateProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -737,9 +737,11 @@
|
|||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource AlwaysPreview}" />
|
||||
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource AlwaysPreviewToolTip}" />
|
||||
</StackPanel>
|
||||
<CheckBox
|
||||
IsChecked="{Binding Settings.AlwaysPreview}"
|
||||
Style="{DynamicResource SideControlCheckBox}"
|
||||
<ui:ToggleSwitch
|
||||
Grid.Column="2"
|
||||
FocusVisualMargin="5"
|
||||
IsOn="{Binding Settings.AlwaysPreview}"
|
||||
Style="{DynamicResource SideToggleSwitch}"
|
||||
ToolTip="{DynamicResource AlwaysPreviewToolTip}" />
|
||||
<TextBlock Style="{StaticResource Glyph}">
|
||||

|
||||
|
|
@ -943,13 +945,34 @@
|
|||
Text="{Binding Settings.PluginSettings.PythonDirectory, TargetNullValue='No Setting'}" />
|
||||
<Button
|
||||
Height="34"
|
||||
Margin="10,10,18,10"
|
||||
Margin="10,0,18,0"
|
||||
Click="OnSelectPythonDirectoryClick"
|
||||
Content="{DynamicResource selectPythonDirectory}" />
|
||||
</StackPanel>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
|
||||
<Border Margin="0,30,0,0" Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
Style="{DynamicResource SettingTitleLabel}"
|
||||
Text="{DynamicResource typingStartEn}" />
|
||||
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource typingStartEnTooltip}" />
|
||||
</StackPanel>
|
||||
<ui:ToggleSwitch
|
||||
Grid.Column="2"
|
||||
FocusVisualMargin="5"
|
||||
IsOn="{Binding Settings.AlwaysStartEn}"
|
||||
Style="{DynamicResource SideToggleSwitch}" />
|
||||
<TextBlock Style="{StaticResource Glyph}">
|
||||

|
||||
</TextBlock>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
|
||||
<Border Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
|
|
|
|||
Loading…
Reference in a new issue