mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 16:04:06 +00:00
Merge pull request #828 from xiaoyifang/fix/start-tray
fix: remove toggle main windows extra parameter
This commit is contained in:
commit
d33bb8862f
|
@ -2704,19 +2704,15 @@ void MainWindow::showTranslationForDicts( QString const & inWord,
|
||||||
ignoreDiacritics );
|
ignoreDiacritics );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_X11
|
|
||||||
void MainWindow::toggleMainWindow( bool onlyShow, bool byIconClick )
|
|
||||||
#else
|
|
||||||
void MainWindow::toggleMainWindow( bool onlyShow )
|
void MainWindow::toggleMainWindow( bool onlyShow )
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
bool shown = false;
|
bool shown = false;
|
||||||
|
|
||||||
if ( !cfg.preferences.searchInDock )
|
if ( !cfg.preferences.searchInDock )
|
||||||
translateBox->setPopupEnabled( false );
|
translateBox->setPopupEnabled( false );
|
||||||
|
|
||||||
if ( !isVisible() )
|
qDebug() << "Current state:" << isVisible() << isMinimized() << isActiveWindow() << onlyShow;
|
||||||
{
|
if ( !isVisible() ) {
|
||||||
show();
|
show();
|
||||||
|
|
||||||
qApp->setActiveWindow( this );
|
qApp->setActiveWindow( this );
|
||||||
|
@ -2970,11 +2966,7 @@ void MainWindow::trayIconActivated( QSystemTrayIcon::ActivationReason r )
|
||||||
switch ( r ) {
|
switch ( r ) {
|
||||||
case QSystemTrayIcon::Trigger:
|
case QSystemTrayIcon::Trigger:
|
||||||
// Left click toggles the visibility of main window
|
// Left click toggles the visibility of main window
|
||||||
#ifdef HAVE_X11
|
|
||||||
toggleMainWindow( false, true );
|
|
||||||
#else
|
|
||||||
toggleMainWindow();
|
toggleMainWindow();
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QSystemTrayIcon::MiddleClick:
|
case QSystemTrayIcon::MiddleClick:
|
||||||
|
|
|
@ -212,11 +212,7 @@ private:
|
||||||
|
|
||||||
/// Brings the main window to front if it's not currently, or hides it
|
/// Brings the main window to front if it's not currently, or hides it
|
||||||
/// otherwise. The hiding part is omitted if onlyShow is true.
|
/// otherwise. The hiding part is omitted if onlyShow is true.
|
||||||
#ifdef HAVE_X11
|
|
||||||
void toggleMainWindow( bool onlyShow = false, bool byIconClick = false );
|
|
||||||
#else
|
|
||||||
void toggleMainWindow( bool onlyShow = false );
|
void toggleMainWindow( bool onlyShow = false );
|
||||||
#endif
|
|
||||||
|
|
||||||
/// Creates hotkeyWrapper and hooks the currently set keys for it
|
/// Creates hotkeyWrapper and hooks the currently set keys for it
|
||||||
void installHotKeys();
|
void installHotKeys();
|
||||||
|
|
Loading…
Reference in a new issue