[PT Run] Resolve text alignment issues for RTL input languages (not for mixed strings) (#5170)

* Added logic to switch TextBox/TextBlock flow direction on language change

* Move event handler to separate method

* Moved code to function
This commit is contained in:
Arjun Balgovind
2020-07-24 13:34:49 -07:00
committed by GitHub
parent ab0047a9b7
commit c4ddb7d351
3 changed files with 33 additions and 2 deletions

View File

@@ -273,7 +273,6 @@ namespace PowerLauncher.ViewModel
public string QueryText { get; set; } = String.Empty;
/// <summary>
/// we need move cursor to end when we manually changed query
/// but we don't want to move cursor to end when query is updated from TextBox.
@@ -794,6 +793,20 @@ namespace PowerLauncher.ViewModel
return string.Empty;
}
public static FlowDirection GetLanguageFlowDirection()
{
bool isCurrentLanguageRightToLeft = System.Windows.Input.InputLanguageManager.Current.CurrentInputLanguage.TextInfo.IsRightToLeft;
if (isCurrentLanguageRightToLeft)
{
return FlowDirection.RightToLeft;
}
else
{
return FlowDirection.LeftToRight;
}
}
protected virtual void Dispose(bool disposing)
{
if (!_disposed)