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:
+2
-1
@@ -61,8 +61,9 @@
|
||||
int row = [self rowAtPoint:location];
|
||||
int column = [self columnAtPoint:location];
|
||||
PBGitRevisionCell *cell = (PBGitRevisionCell *)[self preparedCellAtColumn:column row:row];
|
||||
NSRect cellFrame = [self frameOfCellAtColumn:column row:row];
|
||||
|
||||
int index = [cell indexAtX:location.x];
|
||||
int index = [cell indexAtX:(location.x - cellFrame.origin.x)];
|
||||
if (index == -1)
|
||||
return [super dragImageForRowsWithIndexes:dragRows tableColumns:tableColumns event:dragEvent offset:dragImageOffset];
|
||||
|
||||
|
||||
+1
-1
@@ -283,7 +283,7 @@
|
||||
if (!contextMenuDelegate)
|
||||
return [self menu];
|
||||
|
||||
int i = [self indexAtX:[view convertPointFromBase:[event locationInWindow]].x];
|
||||
int i = [self indexAtX:[view convertPointFromBase:[event locationInWindow]].x - rect.origin.x];
|
||||
if (i < 0)
|
||||
return [self menu];
|
||||
|
||||
|
||||
+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