Skip to content

Commit

Permalink
Corrected search widget shortcut display on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
droidmonkey committed Oct 28, 2018
1 parent 5c504be commit 8a860c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/gui/SearchWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ SearchWidget::SearchWidget(QWidget* parent)
connect(m_searchTimer, SIGNAL(timeout()), this, SLOT(startSearch()));
connect(this, SIGNAL(escapePressed()), m_ui->searchEdit, SLOT(clear()));

new QShortcut(Qt::CTRL + Qt::Key_F, this, SLOT(searchFocus()), nullptr, Qt::ApplicationShortcut);
new QShortcut(QKeySequence::Find, this, SLOT(searchFocus()), nullptr, Qt::ApplicationShortcut);
new QShortcut(Qt::Key_Escape, m_ui->searchEdit, SLOT(clear()), nullptr, Qt::ApplicationShortcut);

m_ui->searchEdit->setPlaceholderText(tr("Search (%1)...", "Search placeholder text, %1 is the keyboard shortcut")
.arg(QKeySequence(QKeySequence::Find).toString()), QKeySequence::NativeText);
m_ui->searchEdit->installEventFilter(this);

QMenu* searchMenu = new QMenu();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/SearchWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<string notr="true">padding:3px</string>
</property>
<property name="placeholderText">
<string>Search (CTRL+F)...</string>
<string/>
</property>
<property name="clearButtonEnabled">
<bool>false</bool>
Expand Down
4 changes: 4 additions & 0 deletions tests/gui/TestGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,10 @@ void TestGui::testTotp()
QTest::mouseClick(setupTotpButtonBox->button(QDialogButtonBox::Ok), Qt::LeftButton);
QTRY_VERIFY(!setupTotpButtonBox->isVisible());

// Make sure the entry is selected
clickIndex(item, entryView, Qt::LeftButton);
QApplication::processEvents();

auto* entryEditAction = m_mainWindow->findChild<QAction*>("actionEntryEdit");
QTRY_VERIFY(entryEditAction->isEnabled());
QWidget* entryEditWidget = toolBar->widgetForAction(entryEditAction);
Expand Down

0 comments on commit 8a860c0

Please sign in to comment.