/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to gannotate.py

  • Committer: Dan Loda
  • Date: 2005-10-28 05:55:58 UTC
  • mto: (0.1.4)
  • mto: This revision was merged to the branch mainline in revision 49.
  • Revision ID: danloda@gmail.com-20051028055558-b3827353ac6de542
Use granny-like colors as default and rename ColorMap => AnnotateColorMap.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
from bzrlib.errors import NoSuchRevision
26
26
 
27
 
from colormap import ColorMap, GrannyColorMap
 
27
from colormap import AnnotateColorMap
28
28
from logview import LogView
29
29
from spanselector import SpanSelector
30
30
 
46
46
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
47
47
        self.set_default_size(640, 480)
48
48
        self.set_icon(self.render_icon(gtk.STOCK_FIND, gtk.ICON_SIZE_BUTTON))
49
 
        self.color_map = GrannyColorMap()
 
49
        self.annotate_colormap = AnnotateColorMap()
50
50
 
51
51
        self._create()
52
52
 
125
125
        return (seconds / (24 * 60 * 60))
126
126
    
127
127
    def _span_changed_cb(self, w, span):
128
 
        self.color_map.set_span(span)
 
128
        self.annotate_colormap.set_span(span)
129
129
        now = time.time()
130
130
        self.model.foreach(self._highlight_annotation, now)
131
131
 
133
133
        revision_id, = model.get(iter, REVISION_ID_COL)
134
134
        revision = self.revisions[revision_id]
135
135
        days = self._span_from_seconds(now - revision.timestamp)
136
 
        model.set(iter, HIGHLIGHT_COLOR_COL, self.color_map.get_color(days))
 
136
        model.set(iter, HIGHLIGHT_COLOR_COL,
 
137
                  self.annotate_colormap.get_color(days))
137
138
 
138
139
    def _show_log(self, w):
139
140
        (path, col) = self.treeview.get_cursor()