/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 viz/branchwin.py

  • Committer: Gary van der Merwe
  • Date: 2007-09-22 20:32:05 UTC
  • mto: (256.2.56 gtk)
  • mto: This revision was merged to the branch mainline in revision 289.
  • Revision ID: garyvdm@gmail.com-20070922203205-wggmp778irmwqo03
Use fixed-height-mode on treeview so that revisions data is only 
read off the disk when it is scrolled into view.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
        self.treeview.connect("row-activated", self._treeview_row_activated_cb)
84
84
        self.treeview.connect("button-release-event", 
85
85
                self._treeview_row_mouseclick)
 
86
        self.treeview.set_property('fixed-height-mode', True)
86
87
        scrollwin.add(self.treeview)
87
88
        self.treeview.show()
88
89
 
89
90
        cell = gtk.CellRendererText()
90
 
        cell.set_property("width-chars", 10)
 
91
        cell.set_property("width-chars", 15)
91
92
        cell.set_property("ellipsize", pango.ELLIPSIZE_END)
92
93
        column = gtk.TreeViewColumn("Revision No")
93
94
        column.set_resizable(True)
 
95
        column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
 
96
        column.set_fixed_width(cell.get_size(self.treeview)[2])
94
97
        column.pack_start(cell, expand=True)
95
98
        column.add_attribute(cell, "text", treemodel.REVNO)
96
99
        self.treeview.append_column(column)
97
100
 
98
101
        self.graph_cell = CellRendererGraph()
99
 
        column = gtk.TreeViewColumn()
100
 
        column.set_resizable(True)
101
 
        column.pack_start(self.graph_cell, expand=False)
102
 
        column.add_attribute(self.graph_cell, "node", treemodel.NODE)
103
 
        column.add_attribute(self.graph_cell, "in-lines", treemodel.LAST_LINES)
104
 
        column.add_attribute(self.graph_cell, "out-lines", treemodel.LINES)
105
 
        self.treeview.append_column(column)
 
102
        self.graph_column = gtk.TreeViewColumn()
 
103
        self.graph_column.set_resizable(True)
 
104
        self.graph_column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
 
105
        self.graph_column.pack_start(self.graph_cell, expand=False)
 
106
        self.graph_column.add_attribute(self.graph_cell, "node", treemodel.NODE)
 
107
        self.graph_column.add_attribute(self.graph_cell, "in-lines", treemodel.LAST_LINES)
 
108
        self.graph_column.add_attribute(self.graph_cell, "out-lines", treemodel.LINES)
 
109
        self.treeview.append_column(self.graph_column)
106
110
 
107
111
        cell = gtk.CellRendererText()
108
112
        cell.set_property("width-chars", 40)
109
113
        cell.set_property("ellipsize", pango.ELLIPSIZE_END)
110
114
        column = gtk.TreeViewColumn("Message")
111
115
        column.set_resizable(True)
 
116
        column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
 
117
        column.set_fixed_width(cell.get_size(self.treeview)[2])
112
118
        column.pack_start(cell, expand=True)
113
119
        column.add_attribute(cell, "text", treemodel.MESSAGE)
114
120
        self.treeview.append_column(column)
118
124
        cell.set_property("ellipsize", pango.ELLIPSIZE_END)
119
125
        column = gtk.TreeViewColumn("Committer")
120
126
        column.set_resizable(True)
 
127
        column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
 
128
        column.set_fixed_width(cell.get_size(self.treeview)[2])
121
129
        column.pack_start(cell, expand=True)
122
130
        column.add_attribute(cell, "text", treemodel.COMMITER)
123
131
        self.treeview.append_column(column)
124
132
 
125
133
        cell = gtk.CellRendererText()
 
134
        cell.set_property("width-chars", 40)
126
135
        cell.set_property("ellipsize", pango.ELLIPSIZE_END)
127
136
        column = gtk.TreeViewColumn("Date")
128
137
        column.set_resizable(True)
 
138
        column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
 
139
        column.set_fixed_width(cell.get_size(self.treeview)[2])
129
140
        column.pack_start(cell, expand=True)
130
141
        column.add_attribute(cell, "text", treemodel.TIMESTAMP)
131
142
        self.treeview.append_column(column)
188
199
                                                        maxnum)
189
200
        self.model = TreeModel(self.branch, linegraphdata)
190
201
        self.graph_cell.columns_len = columns_len
 
202
        width = self.graph_cell.get_size(self.treeview)[2]
 
203
        self.graph_column.set_fixed_width(width)
 
204
        self.graph_column.set_max_width(width)
191
205
        self.index = index
192
206
        self.treeview.set_model(self.model)
193
207
    def _on_key_pressed(self, widget, event):