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

repoview: completely nuke column resize triggered by resize events

All resize events for the repoview were causing it to resize the columns. When
the user manually stretched a column, resizes were disabled for a short time.
(yuck). If the user column stretch caused a horizontal scrollbar to appear,
this triggered a resize event and a call to resizeColumns() (yuckier).

Now, the columns are only resized explicitly when the model is filled. Perhaps
we want to also make this feature available as a menu/accelerator action.

Changeset 4cbd0ff45ce4

Parent 104a44edd810

by Steve Borho

Changes to one file · Browse files at 4cbd0ff45ce4 Showing diff from parent 104a44edd810 Diff from another changeset...

 
83
84
85
86
87
88
89
90
91
92
93
 
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
 
83
84
85
 
 
 
 
 
86
87
88
 
181
182
183
 
 
 
 
 
 
 
 
 
 
 
 
 
184
185
186
@@ -83,11 +83,6 @@
  SIGNAL('doubleClicked (const QModelIndex &)'),   self.revisionActivated)   - self._autoresize = True - connect(self.horizontalHeader(), - SIGNAL('sectionResized(int, int, int)'), - self.disableAutoResize) -   def mousePressEvent(self, event):   index = self.indexAt(event.pos())   if not index.isValid(): @@ -186,19 +181,6 @@
  self.revisionSelected)   self.goto_toolbar.compl_model.setStringList(model.repo.tags().keys())   - def enableAutoResize(self, *args): - self._autoresize = True - - def disableAutoResize(self, *args): - self._autoresize = False - QTimer.singleShot(100, self.enableAutoResize) - - def resizeEvent(self, event): - # we catch this event to resize smartly tables' columns - QTableView.resizeEvent(self, event) - if self._autoresize: - self.resizeColumns() -   def resizeColumns(self, *args):   # resize columns the smart way: the column holding Log   # is resized according to the total widget size.