Skip to content

[KFilePlacesView] Improve automatic resize heuristic

Felix Ernst requested to merge felixernst/kio:improve_autoresize into master

The old logic always chose the smallest possible size if any of the items had a name that is too long to fit into the view. This means that in most typical scenarios, in which a user has at least one device with a long name, the smallest possible size was chosen.

This commit makes it so the widest 20 percent of texts are ignored if there is a big difference in width between them and the widest of the other 80 percent. This way, bigger icon sizes are chosen if everything fits aside from the text of these unusually wide names.

BUG: 449544

I think this leads to generally better sizes as can be seen in the video below:

2022-02-04_14-34-38

There was a prior state of this MR that only had this behaviour trigger if elliding would be necessary no matter what. This lead to weird jumps in size. This old behaviour is not implemented anymore in this MR but I keep the video below around so the alternative is clear:

2022-01-10_18-45-15

Edited by Felix Ernst

Merge request reports