Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

repoview: stretch last column inside resizeColumns()

but not during column width calculations/resizing.

setStretchLastSection(True) stretches the last column, so that it appears
like not having a right edge. The last column of 'hgtk log' didn't have a
right edge either.

Changeset b893fddd9692

Parent 9feec9e8e2bf

by Adrian Buehlmann

Changes to one file · Browse files at b893fddd9692 Showing diff from parent 9feec9e8e2bf Diff from another changeset...

 
188
189
190
 
 
 
 
 
 
 
 
 
191
192
193
194
195
196
 
213
214
215
216
217
218
219
 
188
189
190
191
192
193
194
195
196
197
198
199
200
 
 
201
202
203
 
220
221
222
 
223
224
225
@@ -188,9 +188,16 @@
  def resizeColumns(self, *args):   # resize columns the smart way: the column holding Log   # is resized according to the total widget size. + if not self.model(): + return + hh = self.horizontalHeader() + hh.setStretchLastSection(False) + self._resizeColumns() + hh.setStretchLastSection(True) + + def _resizeColumns(self): + # _resizeColumns misbehaves if called with last section streched   model = self.model() - if not model: - return   col1_width = self.viewport().width()   fontm = QFontMetrics(self.font())   tot_stretch = 0.0 @@ -213,7 +220,6 @@
  if model._columns[c] in model._stretchs:   w = model._stretchs[model._columns[c]] / tot_stretch   self.setColumnWidth(c, col1_width * w) - #self.horizontalHeader().setStretchLastSection(True)     def revFromindex(self, index):   if not index.isValid():