mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
code_review: PR #190
* check middle button click before other action * pass clicked tab instead of null to avoid closing current active page while clicking on other invalid tab
This commit is contained in:
parent
f3e54369ad
commit
7241879f5a
1 changed files with 8 additions and 7 deletions
|
@ -258,17 +258,19 @@ namespace SourceGit.Views
|
|||
|
||||
private void OnPointerPressedTab(object sender, PointerPressedEventArgs e)
|
||||
{
|
||||
_pressedTab = true;
|
||||
_startDragTab = false;
|
||||
_pressedTabPosition = e.GetPosition(sender as Border);
|
||||
_pressedPoint = e.GetCurrentPoint(sender as Border);
|
||||
if (_pressedPoint.Properties.IsMiddleButtonPressed)
|
||||
var border = sender as Border;
|
||||
var point = e.GetCurrentPoint(border);
|
||||
if (point.Properties.IsMiddleButtonPressed)
|
||||
{
|
||||
var vm = DataContext as ViewModels.Launcher;
|
||||
vm.CloseTab(null);
|
||||
vm.CloseTab(border.DataContext as ViewModels.LauncherPage);
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
_pressedTab = true;
|
||||
_startDragTab = false;
|
||||
_pressedTabPosition = e.GetPosition(sender as Border);
|
||||
}
|
||||
|
||||
private void OnPointerReleasedTab(object sender, PointerReleasedEventArgs e)
|
||||
|
@ -339,6 +341,5 @@ namespace SourceGit.Views
|
|||
private bool _pressedTab = false;
|
||||
private Point _pressedTabPosition = new Point();
|
||||
private bool _startDragTab = false;
|
||||
private PointerPoint _pressedPoint = new PointerPoint();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue