mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-22 21:06:10 +00:00
ac64bbface
* Segments implemented * Not util anymore but common * Fixed the strings to be shown as the headers better * Quick Filter functionality is supported on both Section and Segment Widget * QuickFilter should basically be on but for some widgets, they should be off
46 lines
923 B
C++
46 lines
923 B
C++
|
|
#include "QuickFilterView.h"
|
|
#include "ui_QuickFilterView.h"
|
|
|
|
QuickFilterView::QuickFilterView(QWidget *parent, bool defaultOn) :
|
|
QWidget(parent),
|
|
ui(new Ui::QuickFilterView())
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
connect(ui->closeFilterButton, &QAbstractButton::clicked, this, &QuickFilterView::closeFilter);
|
|
|
|
connect(ui->filterLineEdit, &QLineEdit::textChanged, this, [this](const QString & text) {
|
|
emit filterTextChanged(text);
|
|
});
|
|
|
|
if (!defaultOn) {
|
|
closeFilter();
|
|
}
|
|
}
|
|
|
|
QuickFilterView::~QuickFilterView() {}
|
|
|
|
|
|
void QuickFilterView::showFilter()
|
|
{
|
|
show();
|
|
ui->filterLineEdit->setFocus();
|
|
}
|
|
|
|
void QuickFilterView::clearFilter()
|
|
{
|
|
if (ui->filterLineEdit->text().isEmpty()) {
|
|
closeFilter();
|
|
} else {
|
|
ui->filterLineEdit->setText("");
|
|
}
|
|
}
|
|
|
|
void QuickFilterView::closeFilter()
|
|
{
|
|
ui->filterLineEdit->setText("");
|
|
hide();
|
|
emit filterClosed();
|
|
}
|