Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable repomodel: delegate calculation of max width of author/age to repoview

If repomodel.maxWidthValueForColumn() returns None, repoview uses the default
sizeHintForColumn() implementation. Thus it calculates column width according
to the currently visible items, not by known maximum value.

Changeset 624b2d3ff078

Parent 78b356854ac2

by Yuya Nishihara

Changes to one file · Browse files at 624b2d3ff078 Showing diff from parent 78b356854ac2 Diff from another changeset...

 
124
125
126
127
128
129
130
 
206
207
208
209
210
211
212
213
214
215
 
233
234
235
236
 
237
238
239
 
245
246
247
248
249
250
251
252
 
124
125
126
 
127
128
129
 
205
206
207
 
 
 
 
208
209
210
 
228
229
230
 
231
232
233
234
 
240
241
242
 
 
243
244
245
@@ -124,7 +124,6 @@
  _ui = self.repo.ui   self.fill_step = int(_ui.config('tortoisehg', 'graphlimit', 500))   self.authorcolor = _ui.configbool('tortoisehg', 'authorcolor') - self.maxauthor = 'author name'     def updateColumns(self):   s = QSettings() @@ -206,10 +205,6 @@
  currentlen = self.rowcount   newlen = len(self.graph)   - sauthors = [hglib.username(user) for user in list(self.graph.authors)] - sauthors.append(self.maxauthor) - self.maxauthor = sorted(sauthors, key=lambda x: len(x))[-1] -   if newlen > self.rowcount:   self.beginInsertRows(QModelIndex(), currentlen, newlen-1)   self.rowcount = newlen @@ -233,7 +228,7 @@
  return '8' * len(str(len(self.repo))) + '+'   if column == 'Node':   return '8' * 12 + '+' - if column in ('Age', 'LocalTime', 'UTCTime'): + if column in ('LocalTime', 'UTCTime'):   return hglib.displaytime(util.makedate())   if column == 'Tags':   try: @@ -245,8 +240,6 @@
  return sorted(self.repo.branchtags().keys(), key=lambda x: len(x))[-1]   except IndexError:   pass - if column == 'Author': - return self.maxauthor   if column == 'Filename':   return self.filename   if column == 'Graph':