From 21e15c426e35083f5f6d203b86cea597a47bcb57 Mon Sep 17 00:00:00 2001 From: Rudy Huyn Date: Mon, 18 Mar 2019 14:22:44 -0700 Subject: [PATCH] hide history button in programmer mode (#327) Description of the changes: Hide the History button when in Programmer mode via VisualState How changes were validated: Open Standard mode Switch to Programmer mode Verify that the History button isn't visible Fixes #326 --- src/Calculator/Views/Calculator.xaml | 1 + src/Calculator/Views/Calculator.xaml.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Calculator/Views/Calculator.xaml b/src/Calculator/Views/Calculator.xaml index b7db10e..01164b8 100644 --- a/src/Calculator/Views/Calculator.xaml +++ b/src/Calculator/Views/Calculator.xaml @@ -515,6 +515,7 @@ + diff --git a/src/Calculator/Views/Calculator.xaml.cpp b/src/Calculator/Views/Calculator.xaml.cpp index 10858a3..65b3f45 100644 --- a/src/Calculator/Views/Calculator.xaml.cpp +++ b/src/Calculator/Views/Calculator.xaml.cpp @@ -415,7 +415,7 @@ void Calculator::UpdateHistoryState() SetChildAsHistory(); HistoryButton->Visibility = ::Visibility::Collapsed; - if (m_IsLastFlyoutHistory) + if (!IsProgrammer && m_IsLastFlyoutHistory) { DockPivot->SelectedIndex = 0; } @@ -522,7 +522,7 @@ void Calculator::HistoryFlyout_Closed(_In_ Object ^sender, _In_ Object ^args) AutomationProperties::SetName(HistoryButton, m_openHistoryFlyoutAutomationName); m_fIsHistoryFlyoutOpen = false; EnableControls(true); - if (HistoryButton->IsEnabled) + if (HistoryButton->IsEnabled && HistoryButton->Visibility == ::Visibility::Visible) { HistoryButton->Focus(::FocusState::Programmatic); }