diff --git a/src/CoinsWidget.cpp b/src/CoinsWidget.cpp index 97ac2df..95a6645 100644 --- a/src/CoinsWidget.cpp +++ b/src/CoinsWidget.cpp @@ -93,6 +93,11 @@ void CoinsWidget::setSearchbarVisible(bool visible) { ui->search->setVisible(visible); } +void CoinsWidget::focusSearchbar() { + ui->search->setFocusPolicy(Qt::StrongFocus); + ui->search->setFocus(); +} + void CoinsWidget::showContextMenu(const QPoint &point) { QModelIndexList list = ui->coins->selectionModel()->selectedRows(); diff --git a/src/CoinsWidget.h b/src/CoinsWidget.h index 87515d6..90471e2 100644 --- a/src/CoinsWidget.h +++ b/src/CoinsWidget.h @@ -28,6 +28,7 @@ public: public slots: void setSearchbarVisible(bool visible); + void focusSearchbar(); private slots: void showHeaderMenu(const QPoint& position); diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 7175ed6..703443c 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1483,6 +1483,8 @@ void MainWindow::toggleSearchbar(bool visible) { m_contactsWidget->focusSearchbar(); else if (currentTab == Tabs::RECEIVE) m_receiveWidget->focusSearchbar(); + else if (currentTab == Tabs::COINS) + m_coinsWidget->focusSearchbar(); } MainWindow::~MainWindow() = default; \ No newline at end of file