Remove LRE/LRO characters from results and error messages (#1161)

* Remove LRE/LRO characters and rely on Xaml to correctly displayed the numbers and error messages RtL

* unit tests
This commit is contained in:
Rudy Huyn
2020-04-30 12:04:33 -07:00
committed by GitHub
parent 2cafb0dc88
commit 6e521d8f29
20 changed files with 127 additions and 188 deletions

View File

@@ -577,7 +577,9 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Controls:CalculationResult">
<Grid x:Name="Border" Background="{TemplateBinding Background}">
<Grid x:Name="Border"
Background="{TemplateBinding Background}"
FlowDirection="LeftToRight">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="12"/>
<ColumnDefinition/>

View File

@@ -215,7 +215,7 @@ void CalculationResult::UpdateTextState()
auto containerSize = m_textContainer->ActualWidth;
String ^ oldText = m_textBlock->Text;
String ^ newText = Utils::LRO + DisplayValue + Utils::PDF;
String ^ newText = DisplayValue;
// Initiate the scaling operation
// UpdateLayout will keep calling us until we make it through the below 2 if-statements

View File

@@ -37,7 +37,9 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:OverflowTextBlock">
<Grid x:Name="TokenContainer" Background="{TemplateBinding Background}">
<Grid x:Name="TokenContainer"
Background="{TemplateBinding Background}"
FlowDirection="LeftToRight">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="12"/>
<ColumnDefinition/>
@@ -96,7 +98,9 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:OverflowTextBlock">
<Grid x:Name="TokenContainer" Background="{TemplateBinding Background}">
<Grid x:Name="TokenContainer"
Background="{TemplateBinding Background}"
FlowDirection="LeftToRight">
<Grid.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>

View File

@@ -163,7 +163,8 @@
<Grid x:Name="ProgrammerOperators"
x:Uid="RadixGroup"
MaxHeight="244"
AutomationProperties.HeadingLevel="Level1">
AutomationProperties.HeadingLevel="Level1"
FlowDirection="LeftToRight">
<Grid.RowDefinitions>
<RowDefinition Height="1*" MinHeight="0"/>
<RowDefinition Height="1*" MinHeight="0"/>

View File

@@ -2,10 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:automation="using:CalculatorApp.Common.Automation"
xmlns:controls="using:CalculatorApp.Controls"
xmlns:converters="using:CalculatorApp.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:CalculatorApp"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:model="using:CalculatorApp.ViewModel"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"

View File

@@ -1,13 +1,8 @@
<UserControl x:Class="CalculatorApp.MemoryListItem"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:common="using:CalculatorApp.Common"
xmlns:controls="using:CalculatorApp.Controls"
xmlns:converters="using:CalculatorApp.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:CalculatorApp"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:model="using:CalculatorApp.ViewModel"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
x:Name="MemoryListItem"
FlowDirection="LeftToRight"