]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/TocWidget.cpp
Make a string translatable
[lyx.git] / src / frontends / qt4 / TocWidget.cpp
index c30d644fc00d96d1b4d8dd3fad392fb09464058e..b96a7c644cfc97e657066f6823c51f02e4ddc852 100644 (file)
@@ -55,6 +55,13 @@ TocWidget::TocWidget(GuiView & gui_view, QWidget * parent)
        moveDownTB->setIcon(QIcon(getPixmap("images/", "outline-down", "svgz,png")));
        updateTB->setIcon(QIcon(getPixmap("images/", "reload", "svgz,png")));
 
+       QSize icon_size = gui_view.iconSize();
+       moveOutTB->setIconSize(icon_size);
+       moveInTB->setIconSize(icon_size);
+       moveUpTB->setIconSize(icon_size);
+       moveDownTB->setIconSize(icon_size);
+       updateTB->setIconSize(icon_size);
+
        // avoid flickering
        tocTV->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
 
@@ -149,7 +156,7 @@ bool TocWidget::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_OUTLINE_IN:
        case LFUN_OUTLINE_OUT:
        case LFUN_SECTION_SELECT:
-               status.setEnabled(item.dit() != 0);
+               status.setEnabled((bool)item.dit());
                return true;
 
        case LFUN_LABEL_COPY_AS_REFERENCE: {
@@ -443,15 +450,17 @@ void TocWidget::updateViewNow()
 void TocWidget::finishUpdateView()
 {
        // Profiling shows that this is the expensive stuff in the context of typing
-       // text and moving with arrows (still five times less than updateToolbars in
-       // my tests with a medium-sized document, however this grows linearly in the
-       // size of the document). For bigger operations, this is negligible, and
-       // outweighted by TocModels::reset() anyway.
+       // text and moving with arrows. For bigger operations, this is negligible,
+       // and outweighted by TocModels::reset() anyway.
        if (canNavigate()) {
                if (!persistent_)
                        setTreeDepth(depth_);
                persistentCB->setChecked(persistent_);
-               select(gui_view_.tocModels().currentIndex(current_type_));
+               // select the item at current cursor location
+               if (gui_view_.documentBufferView()) {
+                       DocIterator const & dit = gui_view_.documentBufferView()->cursor();
+                       select(gui_view_.tocModels().currentIndex(current_type_, dit));
+               }
        }
        filterContents();
 }