mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08: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)
|
private void OnPointerPressedTab(object sender, PointerPressedEventArgs e)
|
||||||
{
|
{
|
||||||
_pressedTab = true;
|
var border = sender as Border;
|
||||||
_startDragTab = false;
|
var point = e.GetCurrentPoint(border);
|
||||||
_pressedTabPosition = e.GetPosition(sender as Border);
|
if (point.Properties.IsMiddleButtonPressed)
|
||||||
_pressedPoint = e.GetCurrentPoint(sender as Border);
|
|
||||||
if (_pressedPoint.Properties.IsMiddleButtonPressed)
|
|
||||||
{
|
{
|
||||||
var vm = DataContext as ViewModels.Launcher;
|
var vm = DataContext as ViewModels.Launcher;
|
||||||
vm.CloseTab(null);
|
vm.CloseTab(border.DataContext as ViewModels.LauncherPage);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_pressedTab = true;
|
||||||
|
_startDragTab = false;
|
||||||
|
_pressedTabPosition = e.GetPosition(sender as Border);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPointerReleasedTab(object sender, PointerReleasedEventArgs e)
|
private void OnPointerReleasedTab(object sender, PointerReleasedEventArgs e)
|
||||||
|
@ -339,6 +341,5 @@ namespace SourceGit.Views
|
||||||
private bool _pressedTab = false;
|
private bool _pressedTab = false;
|
||||||
private Point _pressedTabPosition = new Point();
|
private Point _pressedTabPosition = new Point();
|
||||||
private bool _startDragTab = false;
|
private bool _startDragTab = false;
|
||||||
private PointerPoint _pressedPoint = new PointerPoint();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue