mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
add possibility to use icon from system theme for tray icon
This commit is contained in:
parent
b34ac9630e
commit
eea6f686f6
|
@ -590,7 +590,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
|||
|
||||
if ( cfg.preferences.enableTrayIcon )
|
||||
{
|
||||
trayIcon = new QSystemTrayIcon( QIcon( ":/icons/programicon_old.png" ), this );
|
||||
trayIcon = new QSystemTrayIcon( QIcon::fromTheme("goldendict-tray", QIcon( ":/icons/programicon_old.png" )), this );
|
||||
trayIcon->setToolTip( tr( "Loading..." ) );
|
||||
trayIcon->show();
|
||||
}
|
||||
|
@ -1113,7 +1113,7 @@ void MainWindow::updateTrayIcon()
|
|||
if ( !trayIcon && cfg.preferences.enableTrayIcon )
|
||||
{
|
||||
// Need to show it
|
||||
trayIcon = new QSystemTrayIcon( QIcon( ":/icons/programicon_old.png" ), this );
|
||||
trayIcon = new QSystemTrayIcon( QIcon::fromTheme("goldendict-tray", QIcon( ":/icons/programicon_old.png" )), this );
|
||||
trayIcon->setContextMenu( &trayIconMenu );
|
||||
trayIcon->show();
|
||||
|
||||
|
@ -1131,10 +1131,9 @@ void MainWindow::updateTrayIcon()
|
|||
if ( trayIcon )
|
||||
{
|
||||
// Update the icon to reflect the scanning mode
|
||||
trayIcon->setIcon( QIcon(
|
||||
enableScanPopup->isChecked() ?
|
||||
":/icons/programicon_scan.png" :
|
||||
":/icons/programicon_old.png" ) );
|
||||
trayIcon->setIcon( enableScanPopup->isChecked() ?
|
||||
QIcon::fromTheme("goldendict-scan-tray", QIcon( ":/icons/programicon_scan.png" )) :
|
||||
QIcon::fromTheme("goldendict-tray", QIcon( ":/icons/programicon_old.png" )) );
|
||||
|
||||
trayIcon->setToolTip( "GoldenDict" );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue