]> git.lyx.org Git - lyx.git/commit
TocWidget: fix an erroneous collapse and optimise updates based on profiling
authorGuillaume Munch <gm@lyx.org>
Sun, 8 May 2016 22:56:55 +0000 (23:56 +0100)
committerGuillaume Munch <gm@lyx.org>
Sun, 12 Jun 2016 22:14:22 +0000 (23:14 +0100)
commitc69426d7f57e72e3bc9640ea5e86f721c04fa0e1
tree1a70deda93814cc2ed74638be4e06887cb1e2524
parent097b17f7322609f2de6ea92f3ea6f1d0065bdea0
TocWidget: fix an erroneous collapse and optimise updates based on profiling

TocModels::reset() in GuiView::structureChanged() collapses the TocWidget, and
therefore requires an update right after, which was missing.

In fact, profiling TocWidget::updateView() shows that delaying the update is
good only for fast keypresses (essentially movement). It costs 5% of a
char-forward operation in a document with approx. 100 table of contents
items. The update optimisation has been rewritten to take this data into
account.

This also fixes #9826: Outline disclosure of subsection content disappears one
second after doubleclicking content item.
src/frontends/qt4/GuiToc.cpp
src/frontends/qt4/TocWidget.cpp
src/frontends/qt4/TocWidget.h