Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Flow.Launcher.Infrastructure/PinyinAlphabet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,21 @@ public PinyinAlphabet()

_settings.PropertyChanged += (sender, e) =>
{
if (e.PropertyName == nameof(Settings.UseDoublePinyin) ||
e.PropertyName == nameof(Settings.DoublePinyinSchema))
switch (e.PropertyName)
{
Reload();
case nameof (Settings.ShouldUsePinyin):
if (_settings.ShouldUsePinyin)
{
Reload();
}
break;
case nameof(Settings.UseDoublePinyin):
case nameof(Settings.DoublePinyinSchema):
if (_settings.UseDoublePinyin)
{
Reload();
}
break;
}
};
}
Expand Down
14 changes: 13 additions & 1 deletion Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,19 @@
/// <summary>
/// when false Alphabet static service will always return empty results
/// </summary>
public bool ShouldUsePinyin { get; set; } = false;
private bool _useAlphabet = true;
public bool ShouldUsePinyin
{
get => _useAlphabet;
set
{
if (_useAlphabet != value)
{
_useAlphabet = value;
OnPropertyChanged();
}
}
}

private bool _useDoublePinyin = false;
public bool UseDoublePinyin
Expand All @@ -344,7 +356,7 @@
}
}

private DoublePinyinSchemas _doublePinyinSchema = DoublePinyinSchemas.XiaoHe;

Check warning on line 359 in Flow.Launcher.Infrastructure/UserSettings/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Xiao` is not a recognized word. (unrecognized-spelling)

[JsonInclude, JsonConverter(typeof(JsonStringEnumConverter))]
public DoublePinyinSchemas DoublePinyinSchema
Expand Down Expand Up @@ -502,7 +514,7 @@
{
var list = FixedHotkeys();

// Customizeable hotkeys

Check warning on line 517 in Flow.Launcher.Infrastructure/UserSettings/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Customizeable` is not a recognized word. (unrecognized-spelling)
if (!string.IsNullOrEmpty(Hotkey))
list.Add(new(Hotkey, "flowlauncherHotkey", () => Hotkey = ""));
if (!string.IsNullOrEmpty(PreviewHotkey))
Expand Down Expand Up @@ -636,14 +648,14 @@

public enum DoublePinyinSchemas
{
XiaoHe,

Check warning on line 651 in Flow.Launcher.Infrastructure/UserSettings/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Xiao` is not a recognized word. (unrecognized-spelling)
ZiRanMa,
WeiRuan,

Check warning on line 653 in Flow.Launcher.Infrastructure/UserSettings/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Ruan` is not a recognized word. (unrecognized-spelling)
ZhiNengABC,

Check warning on line 654 in Flow.Launcher.Infrastructure/UserSettings/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Neng` is not a recognized word. (unrecognized-spelling)

Check warning on line 654 in Flow.Launcher.Infrastructure/UserSettings/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Zhi` is not a recognized word. (unrecognized-spelling)
ZiGuangPinYin,
PinYinJiaJia,

Check warning on line 656 in Flow.Launcher.Infrastructure/UserSettings/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Jia` is not a recognized word. (unrecognized-spelling)
XingKongJianDao,
DaNiu,
XiaoLang

Check warning on line 659 in Flow.Launcher.Infrastructure/UserSettings/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Xiao` is not a recognized word. (unrecognized-spelling)
}
}
Loading