/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-01-21 15:01:39 UTC
  • mto: (423.5.5 viz-tags-fancy)
  • mto: This revision was merged to the branch mainline in revision 429.
  • Revision ID: daniel.schierbeck@gmail.com-20080121150139-03lftk613h1ragw3
Made tag labels stack horizontally instead of vertically, and added padding to the labels.

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
        tag_layout = pango.Layout(pango_ctx)
217
217
 
218
218
        for tag_idx, tag in enumerate(self.tags):
219
 
            tag_layout.set_markup("<small>" + tag + "</small>")
 
219
            tag_layout.set_markup(" <small>" + tag + "</small> ")
220
220
            text_width, text_height = tag_layout.get_pixel_size()
221
221
 
222
 
            x0 = cell_area.x + box_size * (column + 1.3)
 
222
            x0 = cell_area.x + \
 
223
                 box_size * (column + 1.3) + \
 
224
                 (text_width - (text_width / 4)) * tag_idx
 
225
 
223
226
            y0 = cell_area.y + \
224
 
                    cell_area.height * (tag_idx + 1) / (len(self.tags) + 1) - \
225
 
                    text_height / 2
 
227
                 cell_area.height / 2 - \
 
228
                 text_height / 2
226
229
 
227
230
            # Draw the tag border
228
231
            ctx.move_to(x0 - box_size / 3, y0 + text_height / 2)