mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user