From af41a183a7984d505ce45bca2b255ac1488bc977 Mon Sep 17 00:00:00 2001 From: Rudy Huyn Date: Fri, 5 Apr 2019 13:04:39 -0700 Subject: [PATCH] Optimize and simplify CalculationResult to be able to update the FontSize and the DisplayMargin without fully updating the Style. (#217) - Merge the 3 CalculationResultStyle(S|M|L) in App.xaml - Only modify CalculationResult::*FontSize in Calculator.xaml instead of fully updating the style of the control. - Create a new property MaxFontSize 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 is managed to prevent the textblock Margin to shift when we update its value (without fully updating the Style). --- src/Calculator/App.xaml | 181 +----------------- src/Calculator/Controls/CalculationResult.cpp | 32 ++-- src/Calculator/Controls/CalculationResult.h | 6 +- src/Calculator/Views/Calculator.xaml | 68 +++---- src/Calculator/Views/Calculator.xaml.cpp | 39 +--- src/Calculator/Views/Calculator.xaml.h | 4 +- src/Calculator/Views/UnitConverter.xaml | 38 ++-- 7 files changed, 60 insertions(+), 308 deletions(-) diff --git a/src/Calculator/App.xaml b/src/Calculator/App.xaml index 51c2846..cec835f 100644 --- a/src/Calculator/App.xaml +++ b/src/Calculator/App.xaml @@ -134,10 +134,6 @@ 15 - 72 - 46 - 28 - - - - - - - - - - - - + - -