]> git.lyx.org Git - features.git/commit
Limit the size of navigation menus for performance.
authorGuillaume Munch <gm@lyx.org>
Wed, 16 Dec 2015 16:34:54 +0000 (16:34 +0000)
committerGuillaume Munch <gm@lyx.org>
Thu, 17 Dec 2015 20:38:04 +0000 (20:38 +0000)
commit2dfb5f80ce6500bd8da60a6e170227cc710c818f
tree376906278d11417529f080fa71cef83df13aaf19
parent1c668318257da2ac217d8292e9f7ad88dc7a107e
Limit the size of navigation menus for performance.

After d5a5fbb8, as indicated in the commit log, it remained to make sure that
the sub-menus of the navigation menu showing the TOCs are generated in a delayed
fashion, to avoid corner cases regarding performance when documents have very
lengthy tocs (e.g. in a document with 1000 sections it takes a few hundreds
milliseconds for the menu to be refreshed). But this idea actually requires
substantial changes to the way menus are computed, so it is not for now.

In the meanwhile, I reintroduce a max size for menus, after which it is cut
off. This differs from the one that I removed at d5a5fbb8 in two ways: 1) if
there are more items than the max size, then we still show something instead of
nothing, 2) we allow ourselves to rely on qt's scrollable menus and therefore
allow bigger menus than before the above commit. The philosophy is that it is
better to show something than nothing, that it's better to show a scrollable
menu than to cut the menu to fit the screen, and that beyond a certain size the
scrollable menu becomes useless anyways.
src/frontends/qt4/Menus.cpp