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

stable repoview: fixed weird behaviour when columns are resized

Changeset 83328ef80e39

Parent decdc12c7b50

by Michael De Wildt

Changes to one file · Browse files at 83328ef80e39 Showing diff from parent decdc12c7b50 Diff from another changeset...

 
249
250
251
252
253
254
255
256
257
258
259
260
 
 
 
 
 
261
262
263
264
265
266
267
268
269
 
 
 
 
270
271
272
 
 
 
 
 
 
 
 
 
 
 
273
274
275
 
249
250
251
 
 
 
 
 
 
 
 
 
252
253
254
255
256
257
 
 
 
 
 
 
 
 
258
259
260
261
262
 
 
263
264
265
266
267
268
269
270
271
272
273
274
275
276
@@ -249,27 +249,28 @@
  def resizeEvent(self, e):   # re-size columns the smart way: the column holding Description   # is re-sized according to the total widget size. - key = '%s/widget_width' % self.cfgname - widget_width, ok = QSettings().value(key).toInt() - if not ok: - widget_width = 0 - - if self.resized: - model = self.model() - vp_width = self.viewport().width() - total_width = stretch_col = 0 + if e.oldSize().width() != e.size().width(): + key = '%s/widget_width' % self.cfgname + widget_width, ok = QSettings().value(key).toInt() + if not ok: + widget_width = 0   - if vp_width != widget_width: - for c in range(model.columnCount(QModelIndex())): - if model._columns[c] in model._stretchs: - #save the description column - stretch_col = c - else: - #total the other widths - total_width += self.columnWidth(c) + if self.resized: + model = self.model() + vp_width = self.viewport().width() + total_width = stretch_col = 0   - width = max(vp_width - total_width, 100) - self.setColumnWidth(stretch_col, width) + if vp_width != widget_width: + for c in range(model.columnCount(QModelIndex())): + if model._columns[c] in model._stretchs: + #save the description column + stretch_col = c + else: + #total the other widths + total_width += self.columnWidth(c) + + width = max(vp_width - total_width, 100) + self.setColumnWidth(stretch_col, width)     super(HgRepoView, self).resizeEvent(e)