mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
Use QKeySequence::Find to focus the search widget
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
|
#include <QShortcut>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
@@ -253,7 +254,6 @@ TomahawkWindow::applyPlatformTweaks()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TomahawkWindow::setupToolBar()
|
TomahawkWindow::setupToolBar()
|
||||||
{
|
{
|
||||||
@@ -292,6 +292,9 @@ TomahawkWindow::setupToolBar()
|
|||||||
m_searchWidget->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
|
m_searchWidget->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
|
||||||
m_searchWidget->setFixedWidth( 340 );
|
m_searchWidget->setFixedWidth( 340 );
|
||||||
connect( m_searchWidget, SIGNAL( returnPressed() ), this, SLOT( onFilterEdited() ) );
|
connect( m_searchWidget, SIGNAL( returnPressed() ), this, SLOT( onFilterEdited() ) );
|
||||||
|
// Use Ctrl+F to focus the searchWidget
|
||||||
|
QShortcut *shortcut = new QShortcut( QKeySequence( QKeySequence::Find ), this );
|
||||||
|
QObject::connect( shortcut, SIGNAL( activated() ), m_searchWidget, SLOT( setFocus() ) );
|
||||||
|
|
||||||
m_toolbar->addWidget( m_searchWidget )->setProperty( "kind", QString( "search" ) );
|
m_toolbar->addWidget( m_searchWidget )->setProperty( "kind", QString( "search" ) );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user