From fe200b1a9975533142dbb3b8a8580d50affbbefe Mon Sep 17 00:00:00 2001 From: Jonas Arnold Date: Sun, 2 Jul 2023 15:39:17 +0200 Subject: [PATCH] fixed another tabbing issue where it was possible to reach non existing tab indices, published version 1.0.0.14 --- .../Properties/PublishProfiles/ClickOnceProfile.pubxml | 4 ++-- MultiTerm.Wpf/View/ShellView.xaml.cs | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/MultiTerm.Wpf/Properties/PublishProfiles/ClickOnceProfile.pubxml b/MultiTerm.Wpf/Properties/PublishProfiles/ClickOnceProfile.pubxml index b0b3874..276f4d4 100644 --- a/MultiTerm.Wpf/Properties/PublishProfiles/ClickOnceProfile.pubxml +++ b/MultiTerm.Wpf/Properties/PublishProfiles/ClickOnceProfile.pubxml @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - 14 + 15 1.0.0.* True Release @@ -36,7 +36,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. index.html BC1274DD90DC13A3CE1634A82AC005CDB6852B06 MultiTerm.Wpf_TemporaryKey.pfx - True|2023-07-02T09:49:58.8132399Z;True|2023-06-06T21:40:32.7933627+02:00;True|2023-05-31T13:53:55.3496532+02:00;True|2023-05-31T12:15:48.2252015+02:00; + True|2023-07-02T13:23:10.2794474Z;True|2023-07-02T11:49:58.8132399+02:00;True|2023-06-06T21:40:32.7933627+02:00;True|2023-05-31T13:53:55.3496532+02:00;True|2023-05-31T12:15:48.2252015+02:00; diff --git a/MultiTerm.Wpf/View/ShellView.xaml.cs b/MultiTerm.Wpf/View/ShellView.xaml.cs index 9c8965d..c5e29cb 100644 --- a/MultiTerm.Wpf/View/ShellView.xaml.cs +++ b/MultiTerm.Wpf/View/ShellView.xaml.cs @@ -28,6 +28,7 @@ public partial class ShellView : UserControl if ( e.Key == System.Windows.Input.Key.Tab && e.KeyboardDevice.Modifiers == System.Windows.Input.ModifierKeys.Control ) { + // increment to larger index than existing is handled by tab control this.terminalTabControl.SelectedIndex++; e.Handled = true; } @@ -35,7 +36,11 @@ public partial class ShellView : UserControl else if ( e.Key == System.Windows.Input.Key.Tab && e.KeyboardDevice.Modifiers == (System.Windows.Input.ModifierKeys.Control | System.Windows.Input.ModifierKeys.Shift) ) { - this.terminalTabControl.SelectedIndex--; + // only move backwards if the resulting index is >= 0 + if(this.terminalTabControl.SelectedIndex > 0) + { + this.terminalTabControl.SelectedIndex--; + } e.Handled = true; } }