mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 11:50:37 +02:00
only show tray icon if systray is available
This commit is contained in:
@@ -108,7 +108,7 @@ TomahawkWindow::TomahawkWindow( QWidget* parent )
|
|||||||
#endif
|
#endif
|
||||||
, ui( new Ui::TomahawkWindow )
|
, ui( new Ui::TomahawkWindow )
|
||||||
, m_searchWidget( 0 )
|
, m_searchWidget( 0 )
|
||||||
, m_trayIcon( new TomahawkTrayIcon( this ) )
|
, m_trayIcon( 0 )
|
||||||
, m_audioRetryCounter( 0 )
|
, m_audioRetryCounter( 0 )
|
||||||
{
|
{
|
||||||
TomahawkStyle::loadFonts();
|
TomahawkStyle::loadFonts();
|
||||||
@@ -127,6 +127,11 @@ TomahawkWindow::TomahawkWindow( QWidget* parent )
|
|||||||
ui->centralWidget->setContentsMargins( 0, 0, 0, 0 );
|
ui->centralWidget->setContentsMargins( 0, 0, 0, 0 );
|
||||||
TomahawkUtils::unmarginLayout( ui->centralWidget->layout() );
|
TomahawkUtils::unmarginLayout( ui->centralWidget->layout() );
|
||||||
|
|
||||||
|
if ( QSystemTrayIcon::isSystemTrayAvailable() )
|
||||||
|
{
|
||||||
|
m_trayIcon = new TomahawkTrayIcon( this );
|
||||||
|
}
|
||||||
|
|
||||||
setupMenuBar();
|
setupMenuBar();
|
||||||
setupToolBar();
|
setupToolBar();
|
||||||
setupSideBar();
|
setupSideBar();
|
||||||
@@ -712,7 +717,10 @@ TomahawkWindow::closeEvent( QCloseEvent* e )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
m_trayIcon->setShowHideWindow( false );
|
if ( m_trayIcon )
|
||||||
|
{
|
||||||
|
m_trayIcon->setShowHideWindow( false );
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
e->accept();
|
e->accept();
|
||||||
|
Reference in New Issue
Block a user