mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Bugfix: fix the contextual menu and drag-n-drop of refs
When the Subject column is not the first column in the git history table the contextual menu for refs and dragging and dropping refs don't work. Offset the mouse click's x value by the x origin of the Subject column. In PBRefController look up the column index of the subject column and check that it's the clicked column (don't assume it's the first one).
This commit is contained in:
+4
-2
@@ -94,12 +94,14 @@
|
||||
NSPoint location = [tv convertPointFromBase:[(PBCommitList *)tv mouseDownPoint]];
|
||||
int row = [tv rowAtPoint:location];
|
||||
int column = [tv columnAtPoint:location];
|
||||
if (column != 0)
|
||||
int subjectColumn = [tv columnWithIdentifier:@"SubjectColumn"];
|
||||
if (column != subjectColumn)
|
||||
return NO;
|
||||
|
||||
PBGitRevisionCell *cell = (PBGitRevisionCell *)[tv preparedCellAtColumn:column row:row];
|
||||
NSRect cellFrame = [tv frameOfCellAtColumn:column row:row];
|
||||
|
||||
int index = [cell indexAtX:location.x];
|
||||
int index = [cell indexAtX:(location.x - cellFrame.origin.x)];
|
||||
|
||||
if (index == -1)
|
||||
return NO;
|
||||
|
||||
Reference in New Issue
Block a user