]> git.lyx.org Git - features.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)
committerRichard Heck <rgheck@lyx.org>
Wed, 15 Jun 2016 21:32:53 +0000 (22:32 +0100)
commit0ba875add1cc689ec19d5b51b003ea0118e5e624
treeb70edb28e3dba8bb5102927e3930004e1be26f1a
parentadcdf22042a80a3aed7d2e4efafb436709caddf8
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