mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-09 06:52:50 -04:00
Changed built-in clear search button with custom one to fix pixelation
This commit is contained in:
parent
39e0708b3b
commit
b6f754c29a
3 changed files with 31 additions and 1 deletions
|
@ -34,7 +34,9 @@ SearchWidget::SearchWidget(QWidget *parent)
|
|||
m_searchTimer->setSingleShot(true);
|
||||
|
||||
connect(m_ui->searchEdit, SIGNAL(textChanged(QString)), SLOT(startSearchTimer()));
|
||||
connect(m_ui->searchIcon, SIGNAL(triggered(QAction*)), m_ui->searchEdit, SLOT(setFocus()));
|
||||
connect(m_ui->searchIcon, SIGNAL(pressed()), m_ui->searchEdit, SLOT(setFocus()));
|
||||
connect(m_ui->clearIcon, SIGNAL(pressed()), m_ui->searchEdit, SLOT(clear()));
|
||||
connect(m_ui->clearIcon, SIGNAL(pressed()), m_ui->searchEdit, SLOT(setFocus()));
|
||||
connect(m_searchTimer, SIGNAL(timeout()), this, SLOT(startSearch()));
|
||||
connect(this, SIGNAL(escapePressed()), m_ui->searchEdit, SLOT(clear()));
|
||||
|
||||
|
@ -50,6 +52,9 @@ SearchWidget::SearchWidget(QWidget *parent)
|
|||
m_ui->searchIcon->setIcon(filePath()->icon("actions", "system-search"));
|
||||
m_ui->searchIcon->setMenu(searchMenu);
|
||||
m_ui->searchIcon->setPopupMode(QToolButton::MenuButtonPopup);
|
||||
|
||||
m_ui->clearIcon->setIcon(filePath()->icon("actions", "edit-clear-locationbar-rtl"));
|
||||
m_ui->clearIcon->setEnabled(false);
|
||||
}
|
||||
|
||||
SearchWidget::~SearchWidget()
|
||||
|
@ -126,6 +131,9 @@ void SearchWidget::startSearch()
|
|||
m_searchTimer->stop();
|
||||
}
|
||||
|
||||
bool hasText = m_ui->searchEdit->text().length() > 0;
|
||||
m_ui->clearIcon->setEnabled(hasText);
|
||||
|
||||
search(m_ui->searchEdit->text());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue