diff --git a/src/DodoSSH.Client.Android/Views/TerminalScreen.axaml b/src/DodoSSH.Client.Android/Views/TerminalScreen.axaml index 42b8dd3..5a6545e 100644 --- a/src/DodoSSH.Client.Android/Views/TerminalScreen.axaml +++ b/src/DodoSSH.Client.Android/Views/TerminalScreen.axaml @@ -62,11 +62,40 @@ + - + + + + + + + + diff --git a/src/DodoSSH.Client.App/Views/MainWindow.axaml.cs b/src/DodoSSH.Client.App/Views/MainWindow.axaml.cs index 08aa512..b79b599 100644 --- a/src/DodoSSH.Client.App/Views/MainWindow.axaml.cs +++ b/src/DodoSSH.Client.App/Views/MainWindow.axaml.cs @@ -204,6 +204,11 @@ internal sealed partial class MainWindow : Window viewModel.ToggleSearchCommand.Execute(null); e.Handled = true; } + else if (e.KeyModifiers.HasFlag(KeyModifiers.Control) && TerminalFontCommand(viewModel, e.Key) is { } size) + { + size.Execute(null); + e.Handled = true; + } else if (viewModel.IsSearching) { Palette.HandleKey(e); @@ -212,6 +217,31 @@ internal sealed partial class MainWindow : Window base.OnKeyDown(e); } + /// + /// The text-size chords, when the terminal is not the thing hearing them. + /// + /// + /// + /// The same three chords the page answers, and the duplication is the point rather than an oversight: + /// the page hears them only while a terminal has focus, and the whole reason somebody reaches for them + /// is often that they are looking at a terminal they cannot read from a screen that is not it — the + /// host list, or preferences. Both routes end in the same commands on the shell. + /// + /// + /// Both keys for plus, because a keyboard has two of them and neither is more correct: OemPlus is the + /// one beside Backspace, Add is the one on the numeric pad. Same for minus. + /// + /// + private static System.Windows.Input.ICommand? TerminalFontCommand( + MainWindowViewModel viewModel, + Key key) => key switch + { + Key.OemPlus or Key.Add => viewModel.EnlargeTerminalFontCommand, + Key.OemMinus or Key.Subtract => viewModel.ShrinkTerminalFontCommand, + Key.D0 or Key.NumPad0 => viewModel.ResetTerminalFontCommand, + _ => null, + }; + private void Attach(MainWindowViewModel? viewModel) { if (shell is { } previous) diff --git a/src/DodoSSH.Client.App/Views/PreferencesScreen.axaml b/src/DodoSSH.Client.App/Views/PreferencesScreen.axaml index e85718a..67b1aa3 100644 --- a/src/DodoSSH.Client.App/Views/PreferencesScreen.axaml +++ b/src/DodoSSH.Client.App/Views/PreferencesScreen.axaml @@ -8,11 +8,13 @@ + + + + + + +