mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-02 12:20:45 +02:00
* Added shortcut (Ctrl+W / Cmd+W) for closing the current (temporary) page.
This commit is contained in:
@@ -135,11 +135,12 @@ TomahawkWindow::TomahawkWindow( QWidget* parent )
|
|||||||
setupMenuBar();
|
setupMenuBar();
|
||||||
setupToolBar();
|
setupToolBar();
|
||||||
setupSideBar();
|
setupSideBar();
|
||||||
statusBar()->addPermanentWidget( m_audioControls, 1 );
|
setupStatusBar();
|
||||||
|
|
||||||
setupUpdateCheck();
|
setupUpdateCheck();
|
||||||
loadSettings();
|
loadSettings();
|
||||||
setupSignals();
|
setupSignals();
|
||||||
|
setupShortcuts();
|
||||||
|
|
||||||
if ( qApp->arguments().contains( "--debug" ) )
|
if ( qApp->arguments().contains( "--debug" ) )
|
||||||
{
|
{
|
||||||
@@ -307,10 +308,6 @@ TomahawkWindow::setupToolBar()
|
|||||||
m_searchWidget->setFixedWidth( scaledX( 340 ) );
|
m_searchWidget->setFixedWidth( scaledX( 340 ) );
|
||||||
connect( m_searchWidget, SIGNAL( returnPressed() ), SLOT( onFilterEdited() ) );
|
connect( m_searchWidget, SIGNAL( returnPressed() ), 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" ) );
|
||||||
|
|
||||||
QWidget* rightSpacer = new QWidget( this );
|
QWidget* rightSpacer = new QWidget( this );
|
||||||
@@ -440,6 +437,29 @@ TomahawkWindow::setupSideBar()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TomahawkWindow::setupStatusBar()
|
||||||
|
{
|
||||||
|
statusBar()->addPermanentWidget( m_audioControls, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TomahawkWindow::setupShortcuts()
|
||||||
|
{
|
||||||
|
{
|
||||||
|
// Use Ctrl+F to focus the searchWidget
|
||||||
|
QShortcut* shortcut = new QShortcut( QKeySequence( QKeySequence::Find ), this );
|
||||||
|
QObject::connect( shortcut, SIGNAL( activated() ), m_searchWidget, SLOT( setFocus() ) );
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// Use Ctrl+W to close current page
|
||||||
|
QShortcut* shortcut = new QShortcut( QKeySequence( QKeySequence::Close ), this );
|
||||||
|
QObject::connect( shortcut, SIGNAL( activated() ), ViewManager::instance(), SLOT( destroyCurrentPage() ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TomahawkWindow::setupUpdateCheck()
|
TomahawkWindow::setupUpdateCheck()
|
||||||
{
|
{
|
||||||
|
@@ -154,6 +154,8 @@ private:
|
|||||||
void setupMenuBar();
|
void setupMenuBar();
|
||||||
void setupToolBar();
|
void setupToolBar();
|
||||||
void setupSideBar();
|
void setupSideBar();
|
||||||
|
void setupStatusBar();
|
||||||
|
void setupShortcuts();
|
||||||
void setupUpdateCheck();
|
void setupUpdateCheck();
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
Reference in New Issue
Block a user