Connect filter reset button and remove unnecessary directives.

This commit is contained in:
Juergen Spitzmueller 2016-09-18 09:02:23 +02:00
parent ade098e289
commit f1ae30919f
2 changed files with 10 additions and 4 deletions

View File

@ -52,15 +52,11 @@ GuiRef::GuiRef(GuiView & lv)
// The filter bar
filter_ = new FancyLineEdit(this);
#if QT_VERSION >= 0x040600
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);
#endif
#if QT_VERSION >= 0x040700
filter_->setPlaceholderText(qt_("All available labels"));
#endif
filter_->setToolTip(qt_("Enter string to filter the list of available labels"));
filterBarL->addWidget(filter_, 0);
@ -87,6 +83,8 @@ GuiRef::GuiRef(GuiView & lv)
this, SLOT(changed_adaptor()));
connect(filter_, SIGNAL(textEdited(QString)),
this, SLOT(filterLabels()));
connect(filter_, SIGNAL(rightButtonClicked()),
this, SLOT(resetFilter()));
connect(csFindCB, SIGNAL(clicked()),
this, SLOT(filterLabels()));
connect(nameED, SIGNAL(textChanged(QString)),
@ -541,6 +539,13 @@ void GuiRef::filterLabels()
}
void GuiRef::resetFilter()
{
filter_->setText(QString());
filterLabels();
}
bool GuiRef::initialiseParams(std::string const & data)
{
InsetCommand::string2params(data, params_);

View File

@ -40,6 +40,7 @@ private Q_SLOTS:
void changed_adaptor();
void gotoClicked();
void filterLabels();
void resetFilter();
void refHighlighted(QTreeWidgetItem *);
void selectionChanged();
void refTextChanged(QString const &);