From 717039a4bc839a5a46d15839b9e240ed296b3059 Mon Sep 17 00:00:00 2001 From: Rudy Huyn Date: Tue, 19 Mar 2019 23:53:07 -0700 Subject: [PATCH] take feedback into account --- src/Calculator/Controls/HorizontalNoOverflowStackPanel.cpp | 4 +++- src/Calculator/Views/SupplementaryResults.xaml.cpp | 3 +-- src/Calculator/Views/SupplementaryResults.xaml.h | 5 ----- src/Calculator/Views/UnitConverter.xaml.cpp | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Calculator/Controls/HorizontalNoOverflowStackPanel.cpp b/src/Calculator/Controls/HorizontalNoOverflowStackPanel.cpp index fed185bc..b03e0eef 100644 --- a/src/Calculator/Controls/HorizontalNoOverflowStackPanel.cpp +++ b/src/Calculator/Controls/HorizontalNoOverflowStackPanel.cpp @@ -33,10 +33,12 @@ bool HorizontalNoOverflowStackPanel::ShouldPrioritizeLastItem() Size HorizontalNoOverflowStackPanel::ArrangeOverride(Size finalSize) { - float posX = 0; if (Children->Size == 0) + { return finalSize; + } + float posX = 0; auto lastChild = Children->GetAt(Children->Size - 1); float lastChildWidth = 0; if (Children->Size > 2 && ShouldPrioritizeLastItem()) diff --git a/src/Calculator/Views/SupplementaryResults.xaml.cpp b/src/Calculator/Views/SupplementaryResults.xaml.cpp index 4f832777..01f811af 100644 --- a/src/Calculator/Views/SupplementaryResults.xaml.cpp +++ b/src/Calculator/Views/SupplementaryResults.xaml.cpp @@ -64,8 +64,7 @@ Windows::UI::Xaml::DataTemplate^ SupplementaryResultDataTemplateSelector::Select } } -SupplementaryResults::SupplementaryResults() : - m_data(ref new Vector) +SupplementaryResults::SupplementaryResults() { InitializeComponent(); } diff --git a/src/Calculator/Views/SupplementaryResults.xaml.h b/src/Calculator/Views/SupplementaryResults.xaml.h index 447f1de2..a0be9e03 100644 --- a/src/Calculator/Views/SupplementaryResults.xaml.h +++ b/src/Calculator/Views/SupplementaryResults.xaml.h @@ -72,10 +72,5 @@ namespace CalculatorApp SupplementaryResults(); DEPENDENCY_PROPERTY_OWNER(SupplementaryResults); DEPENDENCY_PROPERTY_WITH_DEFAULT(Windows::Foundation::Collections::IIterable^, Results, nullptr); - private: - void RefreshData(); - void OnLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); - void OnConverterPropertyChanged(Platform::Object^ sender, Windows::UI::Xaml::Data::PropertyChangedEventArgs^ e); - Windows::Foundation::Collections::IObservableVector^ m_data; }; } diff --git a/src/Calculator/Views/UnitConverter.xaml.cpp b/src/Calculator/Views/UnitConverter.xaml.cpp index 152020bf..247c7fda 100644 --- a/src/Calculator/Views/UnitConverter.xaml.cpp +++ b/src/Calculator/Views/UnitConverter.xaml.cpp @@ -386,7 +386,7 @@ void UnitConverter::HideProgressRing() CurrencyLoadingProgressRing->IsActive = false; } - +// The function will make sure the UI will have enough space to display supplementary results and currency information void CalculatorApp::UnitConverter::SupplementaryResultsPanelInGrid_SizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e) { //We add 0.01 to be sure to not create an infinite loop with SizeChanged events cascading due to float approximation