Skip to content

Commit

Permalink
Update so that save input toasts do not show display params for values
Browse files Browse the repository at this point in the history
that are not filled in
  • Loading branch information
e82eric committed Mar 21, 2024
1 parent 0ad6296 commit d4eaec3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/AppActionHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ namespace winrt::TerminalApp::implementation
try
{
KeyChord keyChord = nullptr;
hstring keyChordText = L"None";
hstring keyChordText = L"";
if (!realArgs.KeyChord().empty())
{
keyChord = KeyChordSerialization::FromString(winrt::to_hstring(realArgs.KeyChord()));
Expand Down
12 changes: 9 additions & 3 deletions src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4245,9 +4245,15 @@ namespace winrt::TerminalApp::implementation
}
}
_UpdateTeachingTipTheme(ActionSavedToast().try_as<winrt::Windows::UI::Xaml::FrameworkElement>());
ActionSavedNameText().Text(L"Name: " + name);
ActionSavedKeyChordText().Text(L"Key Chord: " + keyChord);
ActionSavedCommandLineText().Text(L"Input: " + input);

auto setText = [](const TextBlock& textBlock, const winrt::hstring& prefix, const winrt::hstring& text) {
textBlock.Text(text.empty() ? L"" : prefix + text);
textBlock.Visibility(text.empty() ? Windows::UI::Xaml::Visibility::Collapsed : Windows::UI::Xaml::Visibility::Visible);
};

setText(ActionSavedNameText(), L"Name: ", name);
setText(ActionSavedKeyChordText(), L"Key Chord: " ,keyChord );
setText(ActionSavedCommandLineText(), L"Input: " , input);

if (page->_actionSavedToast != nullptr)
{
Expand Down

0 comments on commit d4eaec3

Please sign in to comment.