mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-21 22:03:11 -07:00
- merge the 3 CalculationResultStyle(S|M|L) in App.xaml
- Create a new MaxFontSize property in order to be able to update it without being forced to fully update the Style (because m_startingFontSize was set in OnApplyTemplate) - Modify how DisplayMargin to prevent the Margin to shift when we change its value withouth fully updating the Style
This commit is contained in:
parent
c6b770eec8
commit
9e63b2c47b
6 changed files with 51 additions and 258 deletions
|
@ -351,7 +351,7 @@
|
|||
<Setter Property="ZoomMode" Value="Disabled"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CalculationResultStyleL" TargetType="Controls:CalculationResult">
|
||||
<Style x:Key="CalculationResultStyle" TargetType="Controls:CalculationResult">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="{ThemeResource SystemControlPageTextBaseHighBrush}"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
|
@ -437,179 +437,6 @@
|
|||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="CalculationResultStyleM" TargetType="Controls:CalculationResult">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="{ThemeResource SystemControlPageTextBaseHighBrush}"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Top"/>
|
||||
<Setter Property="IsTextScaleFactorEnabled" Value="False"/>
|
||||
<Setter Property="UseSystemFocusVisuals" Value="True"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Controls:CalculationResult">
|
||||
<Grid x:Name="border" Background="{TemplateBinding Background}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="12"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="12"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="ActiveStates">
|
||||
<VisualState x:Name="Active"/>
|
||||
<VisualState x:Name="Normal">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="normalOutput.FontWeight" Value="Light"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ScrollViewer x:Name="textContainer"
|
||||
Grid.Column="1"
|
||||
Padding="0,0,0,0"
|
||||
Style="{ThemeResource ResultsScrollerSnapped}"
|
||||
AutomationProperties.AccessibilityView="Raw">
|
||||
<TextBlock x:Name="normalOutput"
|
||||
Margin="{TemplateBinding DisplayMargin}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="SemiBold"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Text="{TemplateBinding DisplayValue}"
|
||||
TextAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</ScrollViewer>
|
||||
<HyperlinkButton x:Name="scrollLeft"
|
||||
Grid.Column="0"
|
||||
Width="20"
|
||||
MinWidth="20"
|
||||
MinHeight="24"
|
||||
Margin="-4,0,-4,0"
|
||||
Padding="0,-3,0,4"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="{ThemeResource SystemControlForegroundAccentBrush}"
|
||||
BorderThickness="0"
|
||||
Visibility="Collapsed">
|
||||
<FontIcon x:Name="scrollLeftText"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Glyph=""/>
|
||||
</HyperlinkButton>
|
||||
<HyperlinkButton x:Name="scrollRight"
|
||||
Grid.Column="2"
|
||||
Width="20"
|
||||
MinWidth="20"
|
||||
MinHeight="24"
|
||||
Margin="-4,0,-4,0"
|
||||
Padding="0,-3,0,4"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="{ThemeResource SystemControlForegroundAccentBrush}"
|
||||
BorderThickness="0"
|
||||
Visibility="Collapsed">
|
||||
<FontIcon x:Name="scrollRightText"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Glyph=""/>
|
||||
</HyperlinkButton>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="CalculationResultStyleS" TargetType="Controls:CalculationResult">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="{ThemeResource SystemControlPageTextBaseHighBrush}"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Top"/>
|
||||
<Setter Property="MinHeight" Value="12"/>
|
||||
<Setter Property="IsTextScaleFactorEnabled" Value="False"/>
|
||||
<Setter Property="UseSystemFocusVisuals" Value="True"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Controls:CalculationResult">
|
||||
<Grid x:Name="border" Background="{TemplateBinding Background}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="12"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="12"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="ActiveStates">
|
||||
<VisualState x:Name="Active"/>
|
||||
<VisualState x:Name="Normal">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="normalOutput.FontWeight" Value="Light"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ScrollViewer x:Name="textContainer"
|
||||
Grid.Column="1"
|
||||
Padding="0,0,0,0"
|
||||
Style="{ThemeResource ResultsScrollerSnapped}"
|
||||
AutomationProperties.AccessibilityView="Raw">
|
||||
<TextBlock x:Name="normalOutput"
|
||||
Margin="{TemplateBinding DisplayMargin}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="SemiBold"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
Text="{TemplateBinding DisplayValue}"
|
||||
TextAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</ScrollViewer>
|
||||
<HyperlinkButton x:Name="scrollLeft"
|
||||
Grid.Column="0"
|
||||
Width="20"
|
||||
MinWidth="20"
|
||||
MinHeight="24"
|
||||
Margin="-4,0,-4,0"
|
||||
Padding="0,-3,0,4"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="{ThemeResource SystemControlForegroundAccentBrush}"
|
||||
BorderThickness="0"
|
||||
Visibility="Collapsed">
|
||||
<FontIcon x:Name="scrollLeftText"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Glyph=""/>
|
||||
</HyperlinkButton>
|
||||
<HyperlinkButton x:Name="scrollRight"
|
||||
Grid.Column="2"
|
||||
Width="20"
|
||||
MinWidth="20"
|
||||
MinHeight="24"
|
||||
Margin="-4,0,-4,0"
|
||||
Padding="0,-3,0,4"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Foreground="{ThemeResource SystemControlForegroundAccentBrush}"
|
||||
BorderThickness="0"
|
||||
Visibility="Collapsed">
|
||||
<FontIcon x:Name="scrollRightText"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Glyph=""/>
|
||||
</HyperlinkButton>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CaptionButtonStyle" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
|
||||
|
|
|
@ -28,6 +28,7 @@ using namespace std;
|
|||
DEPENDENCY_PROPERTY_INITIALIZATION(CalculationResult, IsActive);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(CalculationResult, AccentColor);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(CalculationResult, MinFontSize);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(CalculationResult, MaxFontSize);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(CalculationResult, DisplayMargin);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(CalculationResult, MaxExpressionHistoryCharacters);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(CalculationResult, ExpressionVisibility);
|
||||
|
@ -50,7 +51,6 @@ StringReference CalculationResult::s_FocusedState(L"Focused");
|
|||
StringReference CalculationResult::s_UnfocusedState(L"Unfocused");
|
||||
|
||||
CalculationResult::CalculationResult():
|
||||
m_startingFontSize(0.0),
|
||||
m_isScalingText(false),
|
||||
m_haveCalculatedMax(false)
|
||||
{
|
||||
|
@ -95,7 +95,6 @@ void CalculationResult::OnApplyTemplate()
|
|||
if (m_textBlock)
|
||||
{
|
||||
m_textBlock->Visibility = ::Visibility::Visible;
|
||||
m_startingFontSize = m_textBlock->FontSize;
|
||||
}
|
||||
}
|
||||
UpdateAllState();
|
||||
|
@ -143,6 +142,16 @@ void CalculationResult::OnDisplayValuePropertyChanged(String^ /*oldValue*/, Stri
|
|||
UpdateTextState();
|
||||
}
|
||||
|
||||
void CalculationResult::OnMinFontSizePropertyChanged(double /*oldValue*/, double /*newValue*/)
|
||||
{
|
||||
UpdateTextState();
|
||||
}
|
||||
|
||||
void CalculationResult::OnMaxFontSizePropertyChanged(double /*oldValue*/, double /*newValue*/)
|
||||
{
|
||||
UpdateTextState();
|
||||
}
|
||||
|
||||
void CalculationResult::OnIsInErrorPropertyChanged(bool /*oldValue*/, bool newValue)
|
||||
{
|
||||
// We need to have a good template for this to work
|
||||
|
@ -212,7 +221,7 @@ void CalculationResult::UpdateTextState()
|
|||
{
|
||||
fontSizeChange = min(max(floor(WIDTHTOFONTSCALAR * widthDiff) - WIDTHTOFONTOFFSET, INCREMENTOFFSET), MAXFONTINCREMENT);
|
||||
}
|
||||
if (m_textBlock->ActualWidth < containerSize && abs(m_textBlock->FontSize - m_startingFontSize) > FONTTOLERANCE && !m_haveCalculatedMax)
|
||||
if (m_textBlock->ActualWidth < containerSize && abs(m_textBlock->FontSize - MaxFontSize) > FONTTOLERANCE && !m_haveCalculatedMax)
|
||||
{
|
||||
ModifyFontAndMargin(m_textBlock, fontSizeChange);
|
||||
m_textBlock->InvalidateArrange();
|
||||
|
@ -228,7 +237,7 @@ void CalculationResult::UpdateTextState()
|
|||
m_textBlock->InvalidateArrange();
|
||||
return;
|
||||
}
|
||||
assert(m_textBlock->FontSize >= MinFontSize && m_textBlock->FontSize <= m_startingFontSize);
|
||||
assert(m_textBlock->FontSize >= MinFontSize && m_textBlock->FontSize <= MaxFontSize);
|
||||
m_isScalingText = false;
|
||||
if (IsOperatorCommand)
|
||||
{
|
||||
|
@ -361,7 +370,6 @@ void CalculationResult::ModifyFontAndMargin(TextBlock^ textBox, double fontChang
|
|||
{
|
||||
double cur = textBox->FontSize;
|
||||
double newFontSize = 0.0;
|
||||
Thickness t = textBox->Margin;
|
||||
double scaleFactor = SCALEFACTOR;
|
||||
if (m_textContainer->ActualHeight <= HEIGHTCUTOFF)
|
||||
{
|
||||
|
@ -370,15 +378,14 @@ void CalculationResult::ModifyFontAndMargin(TextBlock^ textBox, double fontChang
|
|||
if (fontChange < 0)
|
||||
{
|
||||
newFontSize = max(cur + fontChange, MinFontSize);
|
||||
t.Bottom += scaleFactor * abs(cur - newFontSize);
|
||||
m_textContainer->Padding = Thickness(0, 0, 0, scaleFactor * abs(cur - newFontSize));
|
||||
}
|
||||
else
|
||||
{
|
||||
newFontSize = min(cur + fontChange, m_startingFontSize);
|
||||
t.Bottom -= scaleFactor * abs(cur - newFontSize);
|
||||
newFontSize = min(cur + fontChange, MaxFontSize);
|
||||
m_textContainer->Padding = Thickness(0, 0, 0, scaleFactor * abs(cur - newFontSize));
|
||||
}
|
||||
textBox->FontSize = newFontSize;
|
||||
textBox->Margin = t;
|
||||
}
|
||||
|
||||
void CalculationResult::UpdateAllState()
|
||||
|
|
|
@ -19,7 +19,8 @@ namespace CalculatorApp
|
|||
DEPENDENCY_PROPERTY_OWNER(CalculationResult);
|
||||
|
||||
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Visibility, ExpressionVisibility);
|
||||
DEPENDENCY_PROPERTY(double, MinFontSize);
|
||||
DEPENDENCY_PROPERTY_WITH_DEFAULT_AND_CALLBACK(double, MinFontSize, 0.0);
|
||||
DEPENDENCY_PROPERTY_WITH_DEFAULT_AND_CALLBACK(double, MaxFontSize, 30.0);
|
||||
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Thickness, DisplayMargin);
|
||||
DEPENDENCY_PROPERTY(int, MaxExpressionHistoryCharacters);
|
||||
DEPENDENCY_PROPERTY_WITH_CALLBACK(bool, IsActive);
|
||||
|
@ -52,6 +53,8 @@ namespace CalculatorApp
|
|||
void OnAccentColorPropertyChanged(Windows::UI::Xaml::Media::Brush^ oldValue, Windows::UI::Xaml::Media::Brush^ newValue);
|
||||
void OnDisplayValuePropertyChanged(Platform::String^ oldValue, Platform::String^ newValue);
|
||||
void OnIsInErrorPropertyChanged(bool oldValue, bool newValue);
|
||||
void OnMinFontSizePropertyChanged(double oldValue, double newValue);
|
||||
void OnMaxFontSizePropertyChanged(double oldValue, double newValue);
|
||||
void TextContainerSizeChanged(Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
|
||||
void OnTextContainerLayoutUpdated(Object^ sender, Object^ e);
|
||||
void UpdateVisualState();
|
||||
|
@ -74,7 +77,6 @@ namespace CalculatorApp
|
|||
Windows::UI::Xaml::Controls::TextBlock^ m_textBlock;
|
||||
Windows::UI::Xaml::Controls::HyperlinkButton^ m_scrollLeft;
|
||||
Windows::UI::Xaml::Controls::HyperlinkButton^ m_scrollRight;
|
||||
double m_startingFontSize;
|
||||
double scrollRatio = 0.7;
|
||||
bool m_isScalingText;
|
||||
bool m_haveCalculatedMax;
|
||||
|
|
|
@ -255,48 +255,17 @@
|
|||
</Style>
|
||||
|
||||
<!-- Calculation Result Styles -->
|
||||
|
||||
<Style x:Key="ResultsStyleL"
|
||||
x:Name="ResultsStyleL"
|
||||
BasedOn="{StaticResource CalculationResultStyleL}"
|
||||
<Style x:Key="ResultsStyle"
|
||||
BasedOn="{StaticResource CalculationResultStyle}"
|
||||
TargetType="controls:CalculationResult">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Top"/>
|
||||
<Setter Property="FontSize" Value="{StaticResource CalcResultFontSizeL}"/>
|
||||
<Setter Property="MinFontSize" Value="12"/>
|
||||
<Setter Property="IsActive" Value="True"/>
|
||||
<Setter Property="DisplayMargin" Value="0,0,0,0"/>
|
||||
<Setter Property="MaxExpressionHistoryCharacters" Value="51"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ResultsStyleM"
|
||||
x:Name="ResultsStyleM"
|
||||
BasedOn="{StaticResource CalculationResultStyleM}"
|
||||
TargetType="controls:CalculationResult">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Top"/>
|
||||
<Setter Property="FontSize" Value="{StaticResource CalcResultFontSizeM}"/>
|
||||
<Setter Property="MinFontSize" Value="12"/>
|
||||
<Setter Property="IsActive" Value="True"/>
|
||||
<Setter Property="DisplayMargin" Value="0,0,0,0"/>
|
||||
<Setter Property="MaxExpressionHistoryCharacters" Value="30"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ResultsStyleS"
|
||||
x:Name="ResultsStyleS"
|
||||
BasedOn="{StaticResource CalculationResultStyleS}"
|
||||
TargetType="controls:CalculationResult">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Top"/>
|
||||
<Setter Property="FontSize" Value="{StaticResource CalcResultFontSizeS}"/>
|
||||
<Setter Property="MinFontSize" Value="12"/>
|
||||
<Setter Property="IsActive" Value="True"/>
|
||||
<Setter Property="DisplayMargin" Value="0,0,0,0"/>
|
||||
<Setter Property="MaxExpressionHistoryCharacters" Value="30"/>
|
||||
</Style>
|
||||
|
||||
<!-- Button Styles -->
|
||||
|
||||
<Style x:Key="ScrollButtonStyle" TargetType="Button">
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Padding" Value="0,0,0,0"/>
|
||||
|
@ -629,7 +598,7 @@
|
|||
x:Uid="CalculatorResults"
|
||||
Grid.Row="2"
|
||||
Margin="0,0,0,0"
|
||||
Style="{ThemeResource ResultsStyleM}"
|
||||
Style="{ThemeResource ResultsStyle}"
|
||||
AutomationProperties.AutomationId="CalculatorResults"
|
||||
AutomationProperties.HeadingLevel="Level1"
|
||||
AutomationProperties.Name="{x:Bind Model.CalculationResultAutomationName, Mode=OneWay}"
|
||||
|
|
|
@ -42,10 +42,10 @@ DEPENDENCY_PROPERTY_INITIALIZATION(Calculator, IsScientific);
|
|||
DEPENDENCY_PROPERTY_INITIALIZATION(Calculator, IsProgrammer);
|
||||
|
||||
Calculator::Calculator() :
|
||||
m_doAnimate(false),
|
||||
m_isLastAnimatedInScientific(false),
|
||||
m_isLastAnimatedInProgrammer(false),
|
||||
m_resultAnimate(false)
|
||||
m_doAnimate(false),
|
||||
m_isLastAnimatedInScientific(false),
|
||||
m_isLastAnimatedInProgrammer(false),
|
||||
m_resultAnimate(false)
|
||||
{
|
||||
SetFontSizeResources();
|
||||
InitializeComponent();
|
||||
|
@ -211,19 +211,22 @@ void Calculator::SetResultStyles()
|
|||
float curHeight = window->Bounds.Height;
|
||||
if (curHeight >= 800)
|
||||
{
|
||||
Results->Style = ResultsStyleL;
|
||||
Results->MaxFontSize = (double)Application::Current->Resources->Lookup("CalcResultFontSizeL");
|
||||
Results->MaxExpressionHistoryCharacters = 51;
|
||||
RowResult->MinHeight = 108;
|
||||
RowResult->Height = GridLength(72, GridUnitType::Star);
|
||||
}
|
||||
else if ((IsProgrammer && curHeight >= 640) || (IsScientific && curHeight >= 544) || IsStandard)
|
||||
{
|
||||
Results->Style = ResultsStyleM;
|
||||
Results->MaxExpressionHistoryCharacters = 30;
|
||||
Results->MaxFontSize = (double)Application::Current->Resources->Lookup("CalcResultFontSizeM");
|
||||
RowResult->MinHeight = 72;
|
||||
RowResult->Height = GridLength(72, GridUnitType::Star);
|
||||
}
|
||||
else
|
||||
{
|
||||
Results->Style = ResultsStyleS;
|
||||
Results->MaxFontSize = (double)Application::Current->Resources->Lookup("CalcResultFontSizeS");
|
||||
Results->MaxExpressionHistoryCharacters = 30;
|
||||
RowResult->MinHeight = 42;
|
||||
RowResult->Height = GridLength(42, GridUnitType::Star);
|
||||
}
|
||||
|
@ -492,7 +495,7 @@ void Calculator::OnHistoryItemClicked(_In_ HistoryItemViewModel^ e)
|
|||
Model->SetExpressionDisplay(e->GetTokens(), e->GetCommands());
|
||||
Model->SetPrimaryDisplay(e->Result->Data(), false);
|
||||
Model->IsFToEEnabled = false;
|
||||
|
||||
|
||||
TraceLogger::GetInstance().LogHistoryItemLoadEnd(tokenSize);
|
||||
CloseHistoryFlyout();
|
||||
this->Focus(::FocusState::Programmatic);
|
||||
|
@ -658,7 +661,7 @@ void Calculator::EnableMemoryControls(bool enable)
|
|||
void Calculator::EnableControls(bool enable)
|
||||
{
|
||||
OpsPanel->IsEnabled = enable;
|
||||
|
||||
|
||||
EnableMemoryControls(enable);
|
||||
}
|
||||
|
||||
|
|
|
@ -180,46 +180,31 @@
|
|||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ValueLargeStyle"
|
||||
BasedOn="{StaticResource CalculationResultStyleL}"
|
||||
<Style x:Key="ValueBaseStyle"
|
||||
BasedOn="{StaticResource CalculationResultStyle}"
|
||||
TargetType="controls:CalculationResult">
|
||||
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundTransparentBrush}"/>
|
||||
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Bottom"/>
|
||||
<Setter Property="FontSize" Value="46"/>
|
||||
<Setter Property="MinFontSize" Value="{ThemeResource BodyFontSize}"/>
|
||||
<Setter Property="FontWeight" Value="Light"/>
|
||||
<Setter Property="MinFontSize" Value="{ThemeResource BodyFontSize}"/>
|
||||
</Style>
|
||||
<Style x:Key="ValueLargeStyle"
|
||||
BasedOn="{StaticResource ValueBaseStyle}"
|
||||
TargetType="controls:CalculationResult">
|
||||
<Setter Property="MaxFontSize" Value="46"/>
|
||||
<Setter Property="Margin" Value="-2,0,0,0"/>
|
||||
<Setter Property="DisplayMargin" Value="0,0,0,12"/>
|
||||
</Style>
|
||||
<Style x:Key="ValueMediumStyle"
|
||||
BasedOn="{StaticResource CalculationResultStyleM}"
|
||||
BasedOn="{StaticResource ValueBaseStyle}"
|
||||
TargetType="controls:CalculationResult">
|
||||
<Setter Property="FontSize" Value="34"/>
|
||||
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundTransparentBrush}"/>
|
||||
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
|
||||
<Setter Property="MinFontSize" Value="{ThemeResource BodyFontSize}"/>
|
||||
<Setter Property="FontWeight" Value="Light"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Bottom"/>
|
||||
<Setter Property="MaxFontSize" Value="34"/>
|
||||
<Setter Property="Margin" Value="0,0,0,0"/>
|
||||
<Setter Property="DisplayMargin" Value="0,0,0,4"/>
|
||||
</Style>
|
||||
<Style x:Key="ValueSmallStyle"
|
||||
BasedOn="{StaticResource CalculationResultStyleS}"
|
||||
TargetType="controls:CalculationResult">
|
||||
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundTransparentBrush}"/>
|
||||
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
|
||||
<Setter Property="FontSize" Value="24"/>
|
||||
<Setter Property="MinFontSize" Value="{ThemeResource BodyFontSize}"/>
|
||||
<Setter Property="FontWeight" Value="Light"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Bottom"/>
|
||||
<Setter Property="Margin" Value="0,0,0,0"/>
|
||||
<Setter Property="DisplayMargin" Value="0,0,0,4"/>
|
||||
</Style>
|
||||
|
||||
|
||||
<Style x:Key="CurrencySymbolBaseStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontWeight" Value="Light"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||
|
@ -616,10 +601,10 @@
|
|||
Visibility="Collapsed">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<HyperlinkButton x:Name="CurrencyRefreshBlock"
|
||||
Foreground="{ThemeResource SystemControlHyperlinkBaseHighBrush}"
|
||||
Click="CurrencyRefreshButton_Click"
|
||||
x:Uid="RefreshButtonText"/>
|
||||
<TextBlock Style="{ThemeResource CaptionTextBlockStyle}" Margin="0, 7, 0, 0">
|
||||
x:Uid="RefreshButtonText"
|
||||
Foreground="{ThemeResource SystemControlHyperlinkBaseHighBrush}"
|
||||
Click="CurrencyRefreshButton_Click"/>
|
||||
<TextBlock Margin="0,7,0,0" Style="{ThemeResource CaptionTextBlockStyle}">
|
||||
<Run x:Name="Spacing" Text=" "/>
|
||||
<Run x:Name="CurrencySecondaryStatus"
|
||||
FontWeight="SemiBold"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue