From 80912a33d0a4a853ebb43e312999a9fd6197d32e Mon Sep 17 00:00:00 2001 From: Rudy Huyn Date: Fri, 20 Sep 2019 16:29:45 -0700 Subject: [PATCH] Prevent the history panel to be displayed when using the Programmer mode (#676) Be sure we don't display the panel when the current view is the Programmer mode. Fixes #665 --- src/Calculator/Views/Calculator.xaml.cpp | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Calculator/Views/Calculator.xaml.cpp b/src/Calculator/Views/Calculator.xaml.cpp index ce84bb7..157b14e 100644 --- a/src/Calculator/Views/Calculator.xaml.cpp +++ b/src/Calculator/Views/Calculator.xaml.cpp @@ -554,21 +554,21 @@ void Calculator::SetDefaultFocus() void Calculator::ToggleHistoryFlyout(Object ^ /*parameter*/) { - String ^ viewState = App::GetAppViewState(); - // If app starts correctly in snap mode and shortcut is used for history then we need to load history if not yet initialized. - if (viewState != ViewState::DockedView) + if (Model->IsProgrammer || App::GetAppViewState() == ViewState::DockedView) { - if (m_fIsHistoryFlyoutOpen) - { - HistoryFlyout->Hide(); - } - else - { - HistoryFlyout->Content = m_historyList; - m_historyList->RowHeight = NumpadPanel->ActualHeight; - FlyoutBase::ShowAttachedFlyout(HistoryButton); - } + return; } + + if (m_fIsHistoryFlyoutOpen) + { + HistoryFlyout->Hide(); + } + else + { + HistoryFlyout->Content = m_historyList; + m_historyList->RowHeight = NumpadPanel->ActualHeight; + FlyoutBase::ShowAttachedFlyout(HistoryButton); + } } void Calculator::ToggleMemoryFlyout()