mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
More compact search widget
* Move the search icon (with popup menu) and clear icon inside the line edit * Move the search widget to the right-side of toolbar
This commit is contained in:
committed by
Jonathan White
parent
b7546b45b3
commit
86e88c18b0
@@ -410,19 +410,24 @@ void TestGui::testSearch()
|
||||
EntryView* entryView = m_dbWidget->findChild<EntryView*>("entryView");
|
||||
QVERIFY(entryView->isVisible());
|
||||
|
||||
QAction* clearButton = searchWidget->findChild<QAction*>("clearIcon");
|
||||
QVERIFY(!clearButton->isVisible());
|
||||
|
||||
// Enter search
|
||||
QTest::mouseClick(searchTextEdit, Qt::LeftButton);
|
||||
QTRY_VERIFY(searchTextEdit->hasFocus());
|
||||
QTRY_VERIFY(!clearButton->isVisible());
|
||||
// Search for "ZZZ"
|
||||
QTest::keyClicks(searchTextEdit, "ZZZ");
|
||||
QTRY_COMPARE(searchTextEdit->text(), QString("ZZZ"));
|
||||
QTRY_VERIFY(clearButton->isVisible());
|
||||
QTRY_VERIFY(m_dbWidget->isInSearchMode());
|
||||
QTRY_COMPARE(entryView->model()->rowCount(), 0);
|
||||
// Press the search clear button
|
||||
QToolButton* clearButton = searchWidget->findChild<QToolButton*>("clearIcon");
|
||||
QTest::mouseClick(clearButton, Qt::LeftButton);
|
||||
clearButton->trigger();
|
||||
QTRY_VERIFY(searchTextEdit->text().isEmpty());
|
||||
QTRY_VERIFY(searchTextEdit->hasFocus());
|
||||
QTRY_VERIFY(!clearButton->isVisible());
|
||||
// Escape clears searchedit and retains focus
|
||||
QTest::keyClicks(searchTextEdit, "ZZZ");
|
||||
QTest::keyClick(searchTextEdit, Qt::Key_Escape);
|
||||
|
||||
Reference in New Issue
Block a user