/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 branchview/graphcell.py

  • Committer: Daniel Schierbeck
  • Date: 2008-04-01 21:25:48 UTC
  • mto: This revision was merged to the branch mainline in revision 481.
  • Revision ID: daniel.schierbeck@gmail.com-20080401212548-wdo2rhv9z0nvcwjc
Made the graph cell renderer draw in white when the row is selected.

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
        for start, end, colour in self.in_lines:
156
156
            self.render_line (ctx, cell_area, box_size,
157
157
                         bg_area.y, bg_area.height,
158
 
                         start, end, colour)
 
158
                         start, end, colour, flags)
159
159
 
160
160
        # Draw lines out of the cell
161
161
        for start, end, colour in self.out_lines:
162
162
            self.render_line (ctx, cell_area, box_size,
163
163
                         bg_area.y + bg_area.height, bg_area.height,
164
 
                         start, end, colour)
 
164
                         start, end, colour, flags)
165
165
 
166
166
        # Draw the revision node in the right column
167
167
        (column, colour) = self.node
169
169
                cell_area.y + cell_area.height / 2,
170
170
                box_size / 4, 0, 2 * math.pi)
171
171
 
172
 
        self.set_colour(ctx, colour, 0.0, 0.5)
 
172
        if flags & gtk.CELL_RENDERER_SELECTED:
 
173
            ctx.set_source_rgb(1.0, 1.0, 1.0)
 
174
        else:
 
175
            self.set_colour(ctx, colour, 0.0, 0.5)
173
176
        ctx.stroke_preserve()
174
177
 
175
 
        self.set_colour(ctx, colour, 0.5, 1.0)
 
178
        if flags & gtk.CELL_RENDERER_SELECTED:
 
179
            ctx.set_source_rgb(0.8, 0.8, 0.8)
 
180
        else:
 
181
            self.set_colour(ctx, colour, 0.5, 1.0)
176
182
        ctx.fill()
177
183
 
178
184
        self.render_tags(ctx, widget.create_pango_context(), cell_area, box_size)
179
185
    
180
 
    def render_line(self, ctx, cell_area, box_size, mid, height, start, end, colour):
 
186
    def render_line(self, ctx, cell_area, box_size, mid, height, start, end, colour, flags):
181
187
        if start is None:
182
188
            x = cell_area.x + box_size * end + box_size / 2
183
189
            ctx.move_to(x, mid + height / 3)
208
214
                             endx, mid + height / 5 ,
209
215
                             endx, mid + height / 2)
210
216
                
211
 
        self.set_colour(ctx, colour, 0.0, 0.65)
 
217
        if flags & gtk.CELL_RENDERER_SELECTED:
 
218
            ctx.set_source_rgb(1.0, 1.0, 1.0)
 
219
        else:
 
220
            self.set_colour(ctx, colour, 0.0, 0.65)
212
221
        ctx.stroke()
213
222
 
214
223
    def render_tags(self, ctx, pango_ctx, cell_area, box_size):