X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FTocWidget.cpp;h=80c9db97d952a6ab773ca96eca3f0675fbc5f7a8;hb=59e0cb8f85f0d2f985b31532dd3308315659c662;hp=f67d39119c13bc0cf11d50429ef9d2017e6a90c8;hpb=121fdba3666b43549a2f02dc4bfef1605707a1d5;p=lyx.git diff --git a/src/frontends/qt4/TocWidget.cpp b/src/frontends/qt4/TocWidget.cpp index f67d39119c..80c9db97d9 100644 --- a/src/frontends/qt4/TocWidget.cpp +++ b/src/frontends/qt4/TocWidget.cpp @@ -245,7 +245,7 @@ void TocWidget::on_updateTB_clicked() // The backend update can take some time so we disable // the controls while waiting. enableControls(false); - gui_view_.tocModels().updateBackend(); + gui_view_.currentBufferView()->buffer().updateBuffer(); } @@ -401,6 +401,12 @@ void TocWidget::updateView() if (update_delay_ == -1) return; QTimer::singleShot(update_delay_, this, SLOT(updateViewForce())); + // Subtler optimization for having the delay more UI invisible. + // We trigger update immediately for sparse editation actions, + // i.e. there was no editation/cursor movement in last 2 sec. + // At worst there will be +1 redraw after 2s in a such "calm" mode. + if (update_delay_ != 0) + updateViewForce(); update_delay_ = -1; }