From 0d14e31e02cc9db83f1585a9e36eaa61e16e939c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enner=20Pe=CC=81rez?= Date: Wed, 19 Jun 2024 13:02:47 -0500 Subject: [PATCH] Middle Button Close Tab --- src/Views/Launcher.axaml.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs index e22a5696..dd655703 100644 --- a/src/Views/Launcher.axaml.cs +++ b/src/Views/Launcher.axaml.cs @@ -261,6 +261,14 @@ namespace SourceGit.Views _pressedTab = true; _startDragTab = false; _pressedTabPosition = e.GetPosition(sender as Border); + _pressedPoint = e.GetCurrentPoint(sender as Border); + if (_pressedPoint.Properties.IsMiddleButtonPressed) + { + var vm = DataContext as ViewModels.Launcher; + vm.CloseTab(null); + e.Handled = true; + return; + } } private void OnPointerReleasedTab(object sender, PointerReleasedEventArgs e) @@ -331,5 +339,6 @@ namespace SourceGit.Views private bool _pressedTab = false; private Point _pressedTabPosition = new Point(); private bool _startDragTab = false; + private PointerPoint _pressedPoint = new PointerPoint(); } }