/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/treeview.py

  • Committer: Curtis Hovey
  • Date: 2011-08-27 18:03:04 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110827180304-9405wmp3lyzq5jx2
Updated most of BranchView to gtk3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
        Gtk.VBox.__init__(self, homogeneous=False, spacing=0)
109
109
 
110
110
        self.progress_widget = ProgressPanel()
111
 
        self.pack_start(self.progress_widget, expand=False, fill=True)
 
111
        self.pack_start(self.progress_widget, False, True, 0)
112
112
        if getattr(ui.ui_factory, "set_progress_bar_widget", None) is not None:
113
113
            # We'are using our own ui, let's tell it to use our widget.
114
114
            ui.ui_factory.set_progress_bar_widget(self.progress_widget)
118
118
                                        Gtk.PolicyType.AUTOMATIC)
119
119
        self.scrolled_window.set_shadow_type(Gtk.ShadowType.IN)
120
120
        self.scrolled_window.show()
121
 
        self.pack_start(self.scrolled_window, expand=True, fill=True)
 
121
        self.pack_start(self.scrolled_window, True, True, 0)
122
122
 
123
123
        self.scrolled_window.add(self.construct_treeview())
124
124
 
322
322
 
323
323
            self.model.line_graph_data = linegraphdata
324
324
            self.graph_cell.columns_len = columns_len
325
 
            width = self.graph_cell.get_size(self.treeview)[2]
 
325
            width = self.graph_cell.get_preferred_width(self.treeview)[1]
326
326
            if width > 500:
327
327
                width = 500
328
328
            self.graph_column.set_fixed_width(width)
354
354
            return (model.get_value(iter, treemodel.REVNO).find(key) != 0
355
355
                and model.get_value(iter, treemodel.MESSAGE).lower().find(key.lower()) == -1)
356
356
 
357
 
        self.treeview.set_search_equal_func(search_equal_func)
 
357
        self.treeview.set_search_equal_func(search_equal_func, None)
358
358
        self.treeview.set_enable_search(True)
359
359
 
360
 
        set_tooltip(treemodel.MESSAGE)
 
360
        self.treeview.set_tooltip_column(treemodel.MESSAGE)
361
361
 
362
362
        self._prev_cursor_path = None
363
363
        self.treeview.connect("cursor-changed",
379
379
        self.revno_column = Gtk.TreeViewColumn("Revision No")
380
380
        self.revno_column.set_resizable(True)
381
381
        self.revno_column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
382
 
        self.revno_column.set_fixed_width(cell.get_size(self.treeview)[2])
383
 
        self.revno_column.pack_start(cell, True, True, 0)
 
382
        self.revno_column.set_fixed_width(
 
383
            cell.get_preferred_width(self.treeview)[1])
 
384
        self.revno_column.pack_start(cell, True)
384
385
        self.revno_column.add_attribute(cell, "text", treemodel.REVNO)
385
386
        self.treeview.append_column(self.revno_column)
386
387
 
388
389
        self.graph_column = Gtk.TreeViewColumn()
389
390
        self.graph_column.set_resizable(True)
390
391
        self.graph_column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
391
 
        self.graph_column.pack_start(self.graph_cell, True, True, 0)
 
392
        self.graph_column.pack_start(self.graph_cell, True)
392
393
        self.graph_column.add_attribute(self.graph_cell, "node", treemodel.NODE)
393
394
        self.graph_column.add_attribute(self.graph_cell, "tags", treemodel.TAGS)
394
395
        self.graph_column.add_attribute(self.graph_cell, "in-lines", treemodel.LAST_LINES)
402
403
        self.summary_column.set_resizable(True)
403
404
        self.summary_column.set_expand(True)
404
405
        self.summary_column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
405
 
        self.summary_column.set_fixed_width(cell.get_size(self.treeview)[2])
406
 
        self.summary_column.pack_start(cell, True, True, 0)
 
406
        self.summary_column.set_fixed_width(
 
407
            cell.get_preferred_width(self.treeview)[1])
 
408
        self.summary_column.pack_start(cell, True)
407
409
        self.summary_column.add_attribute(cell, "markup", treemodel.SUMMARY)
408
410
        self.treeview.append_column(self.summary_column)
409
411
 
414
416
        self.authors_column.set_resizable(False)
415
417
        self.authors_column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
416
418
        self.authors_column.set_fixed_width(200)
417
 
        self.authors_column.pack_start(cell, True, True, 0)
 
419
        self.authors_column.pack_start(cell, True)
418
420
        self.authors_column.add_attribute(cell, "text", treemodel.AUTHORS)
419
421
        self.treeview.append_column(self.authors_column)
420
422
 
426
428
        self.date_column.set_resizable(True)
427
429
        self.date_column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
428
430
        self.date_column.set_fixed_width(130)
429
 
        self.date_column.pack_start(cell, True, True, 0)
 
431
        self.date_column.pack_start(cell, True)
430
432
        self.date_column.add_attribute(cell, "text", treemodel.TIMESTAMP)
431
433
        self.treeview.append_column(self.date_column)
432
434