Before it was not possible to see everything in the outliner when there are e.g. long icon rows. This is because Blender did not allow panning the view to the right, since it did not know the actual width. Most of the code to compute the width correctly was there already, but there were a couple of issues that made it not work. * The tree width was computed before the tree was drawn. This does not work, since the width is only known, after it is drawn. * Every `TreeElement` stores its right-most position in `xend`. However, in the current code, the `xend` of e.g. an object is the position where the text ends. The `xend` of the icons is stored in the sub-tree-elements. Therefore, to compute the maximum width, you may not skip the closed tree elements. * The current drawing code had an early exit when the icon row would not be visible anymore. This also skipped the calculation of `xend`. So it would work correctly, when the icon was visible a little bit, but not when it was not visible at all. This patch fixes these issues. So even in more complex files, the width is computed correcly. At least I haven't found a case, where it does not. Unfortunately, some optimizations had to be turned off, to make it correct. Reviewers: brecht Differential Revision: https://developer.blender.org/D4887