Commit Graph

32 Commits

Author SHA1 Message Date
Nathan Kinsinger 4a9abd2d8c Fix drawing ref labels on the next tableview column
If there are a large number of refs pointing to a commit, then they may be drawn on top of or behind the other columns.

This will not show any labels that don't fit.
2010-03-13 22:16:18 -07:00
Nathan Kinsinger 9b39d34af4 The revision cell returns a menu for the commit if it doesn't for a ref. 2010-03-06 15:58:58 -07:00
Nathan Kinsinger ff5f3f7979 Add methods dealing with menus needed for future features.
Switch from storing both the ref and the commit to storing just one or the other as a refish.

Change action methods that receive PBRefMenuItem to support the change in functionality. In particular the removeRefSheetDidEnd:returnCode:contextInfo: method in PBRefController now looks up the commit for the ref (this was the only place that needed both the ref and the commit).
2010-03-06 15:58:20 -07:00
Nathan Kinsinger 87f76fd5a1 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).
2010-02-19 22:54:25 -07:00
Steven Michalske 58ac6ed1ff HistoryView: Change the way the HEAD is displayed
It used to be displayed in bold, but this can be easily overlooked when
visualizing all branches. It's easier to see the HEAD when it has its own
colour.
2009-06-11 19:50:45 +01:00
Pieter de Bie d38c195149 Fix moving of refs
This was seriously broken after we moved to a hash
to store the refs in ddc9ae7654. Apparently nobody
noticed this earlier.

We fix it by doing the right thing. Don't remove the array
if it's empty, but check in the drawing if we really have refs.
2009-03-23 23:33:43 +00:00
Ben Alpert 086a1c3a12 remove double path init in drawCircleInRect: 2009-01-19 16:57:12 +00:00
Pieter de Bie e570c3e50a Use structs for graph lines
We used to use NSObjects, which was really expensive, because for each commit
as many as 100 graphlines can be created. By preallocating them and not
using NSObjects in general, we gain a massive speedup
2008-11-24 22:54:04 +01:00
Pieter de Bie a9dad9dd31 GitRevisionCell: Allow right-clicking on refs
This reuses the code in the RefController to show context menus
when right-clicking on refs.
2008-11-01 22:51:10 +01:00
Pieter de Bie 4cefe8ee92 HistoryView: Allow dragging of refs to move them 2008-11-01 21:14:24 +01:00
Rufus Cable b64c1deb0e Add half a pixel to history lines so the segments always join up 2008-10-19 14:11:34 +02:00
Christian Jacobsen 63523d00e8 History view: Make lozenge of currently checked out branch (HEAD) bold, same as gitk. 2008-10-10 21:59:22 +02:00
Pieter de Bie 8c01a2964b HistoryView: Don't show path lines if the list is changed
This avoids drawing path lines if the list is sorted
or if there is a search, which would show the lines incorrectly.
2008-09-26 00:52:33 +02:00
Pieter de Bie b257f0090a Fix compiler warnings 2008-09-24 17:19:58 +02:00
Pieter de Bie 6e978dcea4 Refactor cellInfo structure
This makes the PBGitRevisionCell a bit nicer by retrieving all values
from the PBGitCommit object itself, and using another NSTextFieldCell to
draw the text.

This mean that PBGitGrapher now stores its information in the PBGitCommit's,
rather than in a custom grapher array. Also, because we don't need the
grapher to display refs anymore, the ref labels are also displayed when
using path limiting (for example, 'gitx -- Makefile').
2008-09-18 01:27:05 +02:00
Pieter de Bie 78e45bd22c Add support for --left-right
This draws rectangles instead of circles when someone supplies
--left-right as a GitX argument
2008-09-12 20:29:09 +02:00
Pieter de Bie 7f5c353ea8 Use prettier colors for labels 2008-09-06 23:10:09 +02:00
Pieter de Bie ad2e001747 Grapher: don't let the labels go down 2008-09-06 23:01:50 +02:00
Pieter de Bie 06f737df9a Use PBGitRef for other refs 2008-09-06 23:00:41 +02:00
Pieter de Bie 939a1079f9 Grapher: add coloring to ref labels 2008-09-06 22:31:10 +02:00
Ciarán Walsh f631f54ddc Some minor cleanup of the commit-ref drawing.
Proper calculation of the width required; each ref is given its own rounded box.
2008-09-06 21:13:58 +02:00
Pieter de Bie b4d7816be7 Grapher: draw ref names
This simply draws the ref names in the cell, without any markup or correct
rect.
2008-08-28 18:07:34 +02:00
Pieter de Bie 9bfccb5ea5 Grapher: add first part of displaying refs
This adds the "hasRef" boolean member in PBGitCellInfo which is set to true
if the specific commit has symbolic refs.

This is the first part in supporting labels just like gitk has. For now,
commits with refs are just displayed with a red circle.

Things that need to be done to support all refs:

	* Make the NSDictionary in PBGitRepository contain arrays of refs,
	  not a single string
	* Make PBGitGrapher store all refs of a commit in the PBGitCellInfo
	* Figure out a nice way to display the labels in PBGitRevisionCell
2008-08-28 17:29:34 +02:00
Pieter de Bie ed13cf5194 Grapher: use Tango colors for now 2008-08-28 01:06:26 +02:00
Pieter de Bie a294d911b0 Grapher: Add colors to lane
This introduces a new object, PBGitLane that keeps track of the current lane.
We used to only need a sha for a lane, but now that more information is
needed, an extra object is in order. PBGitLane keeps a lane index number. This
number is later used to pick a color.
2008-08-28 00:25:33 +02:00
Pieter de Bie 727e42fe1d Refactor and rename graph code 2008-08-27 23:31:38 +02:00
Pieter de Bie 6886bc5afb Remove cell size adjustment
We added a rect adjustment in the graphing cell in order to draw
outside the cell boundaries. This is no longer necessary
2008-08-27 22:36:42 +02:00
Pieter de Bie bbeedd10ce Rewrite the graphing code
This uses more Cocoa classes to draw the lines, making it easier to
understand and hopefully maintain.

Furthermore, we use less memory now, which is nice, but all the
dynamic arrays probably mean more CPU usage.
2008-08-27 21:51:42 +02:00
Pieter de Bie df490103f6 PBGitGrapher: Improve the grapher
This takes care of most situations. However, we don't have enough space
in the upperMapping to display multiple lines. Therefore we need to
improve it later on.
2008-06-18 13:14:40 +02:00
Pieter de Bie 52d9402513 First take on graphing
This implements some sort of graph shower like Gitk has. However, it still
has bugs and can't do color very well.
2008-06-18 01:02:29 +02:00
Pieter de Bie dcd8369ade Disable Gitk tree-like view for now.
This is not complete and perhaps should not have been committed. However,
.xib files being what they are, rewriting history or merging is getting
very difficult so I'll just disable it for now.

If anyone wants to take a look at this: we should probably do some rev-parsing
to create a graph representation in ApplicationController. That class already
is a delegate for our table and can tell individual cells what to display.

There we should tell how many lines to draw, what color, if there are merges
or splitoffs etc.
2008-06-17 15:20:55 +02:00
Pieter de Bie fe8f173360 Add custom cell 2008-06-17 13:46:18 +02:00