Don't dismiss the command palette when the new tab menu closes (#15340)
Transient UIs are hard.
Regressed in #15077.
Closes #15305
(cherry picked from commit 1bf2fcb6e0
)
Service-Card-Id: 89899296
Service-Version: 1.17
This commit is contained in:
parent
293105d885
commit
c3bdf74538
|
@ -913,7 +913,10 @@ namespace winrt::TerminalApp::implementation
|
|||
});
|
||||
// Necessary for fly-out sub items to get focus on a tab before collapsing. Related to #15049
|
||||
newTabFlyout.Closing([this](auto&&, auto&&) {
|
||||
_FocusCurrentTab(true);
|
||||
if (!_commandPaletteIs(Visibility::Visible))
|
||||
{
|
||||
_FocusCurrentTab(true);
|
||||
}
|
||||
});
|
||||
_newTabButton.Flyout(newTabFlyout);
|
||||
}
|
||||
|
@ -1460,9 +1463,10 @@ namespace winrt::TerminalApp::implementation
|
|||
return;
|
||||
}
|
||||
|
||||
if (const auto p = CommandPalette(); p.Visibility() == Visibility::Visible && cmd.ActionAndArgs().Action() != ShortcutAction::ToggleCommandPalette)
|
||||
if (_commandPaletteIs(Visibility::Visible) &&
|
||||
cmd.ActionAndArgs().Action() != ShortcutAction::ToggleCommandPalette)
|
||||
{
|
||||
p.Visibility(Visibility::Collapsed);
|
||||
CommandPalette().Visibility(Visibility::Collapsed);
|
||||
}
|
||||
|
||||
// Let's assume the user has bound the dead key "^" to a sendInput command that sends "b".
|
||||
|
@ -1781,6 +1785,13 @@ namespace winrt::TerminalApp::implementation
|
|||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool TerminalPage::_commandPaletteIs(WUX::Visibility visibility)
|
||||
{
|
||||
const auto p = CommandPalette();
|
||||
return p && p.Visibility() == visibility;
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Warn the user that they are about to close all open windows, then
|
||||
// signal that we want to close everything.
|
||||
|
|
|
@ -231,6 +231,8 @@ namespace winrt::TerminalApp::implementation
|
|||
int _renamerLayoutCount{ 0 };
|
||||
bool _renamerPressedEnter{ false };
|
||||
|
||||
bool _commandPaletteIs(winrt::Windows::UI::Xaml::Visibility visibility);
|
||||
|
||||
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::UI::Xaml::Controls::ContentDialogResult> _ShowDialogHelper(const std::wstring_view& name);
|
||||
|
||||
void _ShowAboutDialog();
|
||||
|
|
Loading…
Reference in New Issue