]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/GuiCitation.cpp
Fix readability
[lyx.git] / src / frontends / qt / GuiCitation.cpp
index b60718d3838277cd3c6be721b2380d20abd87c55..de39ce769871fe45d74a415126eeab076632c7e2 100644 (file)
@@ -98,10 +98,7 @@ GuiCitation::GuiCitation(GuiView & lv)
 
        // The filter bar
        filter_ = new FancyLineEdit(this);
-       filter_->setButtonPixmap(FancyLineEdit::Right, getPixmap("images/", "editclear", "svgz,png"));
-       filter_->setButtonVisible(FancyLineEdit::Right, true);
-       filter_->setButtonToolTip(FancyLineEdit::Right, qt_("Clear text"));
-       filter_->setAutoHideButton(FancyLineEdit::Right, true);
+       filter_->setClearButton(true);
        filter_->setPlaceholderText(qt_("All avail. citations"));
 
        filterBarL->addWidget(filter_, 0);
@@ -156,13 +153,8 @@ GuiCitation::GuiCitation(GuiView & lv)
                this, SLOT(filterChanged(QString)));
        connect(filter_, SIGNAL(returnPressed()),
                this, SLOT(filterPressed()));
-#if (QT_VERSION < 0x050000)
-       connect(filter_, SIGNAL(downPressed()),
-               availableLV, SLOT(setFocus()));
-#else
        connect(filter_, &FancyLineEdit::downPressed,
                availableLV, [this](){ focusAndHighlight(availableLV); });
-#endif
        connect(regexp_, SIGNAL(triggered()),
                this, SLOT(regexChanged()));
        connect(casesense_, SIGNAL(triggered()),
@@ -170,11 +162,7 @@ GuiCitation::GuiCitation(GuiView & lv)
        connect(instant_, SIGNAL(triggered(bool)),
                this, SLOT(instantChanged(bool)));
 
-#if (QT_VERSION < 0x050000)
-       selectedLV->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
-#else
        selectedLV->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
-#endif
 
        selectedLV->setToolTip(qt_("Ordered list of all cited references.\n"
                                   "You can reorder, add and remove references with the buttons on the left."));
@@ -838,6 +826,10 @@ void GuiCitation::init()
 
        buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
        buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
+
+       // apply filter
+       if (!filter_->text().isEmpty())
+               findText(filter_->text(), true);
 }