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>
|
/// </summary>
|
||||||
public bool ShouldUsePinyin { get; set; } = false;
|
public bool ShouldUsePinyin { get; set; } = false;
|
||||||
public bool AlwaysPreview { get; set; } = false;
|
public bool AlwaysPreview { get; set; } = false;
|
||||||
|
public bool AlwaysStartEn { get; set; } = false;
|
||||||
|
|
||||||
[JsonInclude, JsonConverter(typeof(JsonStringEnumConverter))]
|
[JsonInclude, JsonConverter(typeof(JsonStringEnumConverter))]
|
||||||
public SearchPrecisionScore QuerySearchPrecision { get; private set; } = SearchPrecisionScore.Regular;
|
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="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="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="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="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>
|
||||||
|
|
|
||||||
|
|
@ -244,6 +244,7 @@
|
||||||
</TextBox>
|
</TextBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<StackPanel
|
<StackPanel
|
||||||
x:Name="ClockPanel"
|
x:Name="ClockPanel"
|
||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,9 @@ using System.Security.Cryptography;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Microsoft.VisualBasic.Devices;
|
using Microsoft.VisualBasic.Devices;
|
||||||
using Microsoft.FSharp.Data.UnitSystems.SI.UnitNames;
|
using Microsoft.FSharp.Data.UnitSystems.SI.UnitNames;
|
||||||
|
using NLog.Targets;
|
||||||
|
using YamlDotNet.Core.Tokens;
|
||||||
|
using Key = System.Windows.Input.Key;
|
||||||
|
|
||||||
namespace Flow.Launcher
|
namespace Flow.Launcher
|
||||||
{
|
{
|
||||||
|
|
@ -128,6 +131,7 @@ namespace Flow.Launcher
|
||||||
UpdatePosition();
|
UpdatePosition();
|
||||||
PreviewReset();
|
PreviewReset();
|
||||||
Activate();
|
Activate();
|
||||||
|
QueryTextBox_StartEn();
|
||||||
QueryTextBox.Focus();
|
QueryTextBox.Focus();
|
||||||
_settings.ActivateTimes++;
|
_settings.ActivateTimes++;
|
||||||
if (!_viewModel.LastQuerySelected)
|
if (!_viewModel.LastQuerySelected)
|
||||||
|
|
@ -191,6 +195,9 @@ namespace Flow.Launcher
|
||||||
case nameof(Settings.Language):
|
case nameof(Settings.Language):
|
||||||
UpdateNotifyIconText();
|
UpdateNotifyIconText();
|
||||||
break;
|
break;
|
||||||
|
case nameof(Settings.AlwaysStartEn):
|
||||||
|
QueryTextBox_StartEn();
|
||||||
|
break;
|
||||||
case nameof(Settings.Hotkey):
|
case nameof(Settings.Hotkey):
|
||||||
UpdateNotifyIconText();
|
UpdateNotifyIconText();
|
||||||
break;
|
break;
|
||||||
|
|
@ -696,5 +703,19 @@ namespace Flow.Launcher
|
||||||
be.UpdateSource();
|
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 SettingTitleLabel}" Text="{DynamicResource AlwaysPreview}" />
|
||||||
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource AlwaysPreviewToolTip}" />
|
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource AlwaysPreviewToolTip}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<CheckBox
|
<ui:ToggleSwitch
|
||||||
IsChecked="{Binding Settings.AlwaysPreview}"
|
Grid.Column="2"
|
||||||
Style="{DynamicResource SideControlCheckBox}"
|
FocusVisualMargin="5"
|
||||||
|
IsOn="{Binding Settings.AlwaysPreview}"
|
||||||
|
Style="{DynamicResource SideToggleSwitch}"
|
||||||
ToolTip="{DynamicResource AlwaysPreviewToolTip}" />
|
ToolTip="{DynamicResource AlwaysPreviewToolTip}" />
|
||||||
<TextBlock Style="{StaticResource Glyph}">
|
<TextBlock Style="{StaticResource Glyph}">
|
||||||

|

|
||||||
|
|
@ -943,13 +945,34 @@
|
||||||
Text="{Binding Settings.PluginSettings.PythonDirectory, TargetNullValue='No Setting'}" />
|
Text="{Binding Settings.PluginSettings.PythonDirectory, TargetNullValue='No Setting'}" />
|
||||||
<Button
|
<Button
|
||||||
Height="34"
|
Height="34"
|
||||||
Margin="10,10,18,10"
|
Margin="10,0,18,0"
|
||||||
Click="OnSelectPythonDirectoryClick"
|
Click="OnSelectPythonDirectoryClick"
|
||||||
Content="{DynamicResource selectPythonDirectory}" />
|
Content="{DynamicResource selectPythonDirectory}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</Border>
|
</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}">
|
<Border Style="{DynamicResource SettingGroupBox}">
|
||||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||||
<StackPanel Style="{StaticResource TextPanel}">
|
<StackPanel Style="{StaticResource TextPanel}">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue