@@ -152,11 +152,17 @@ void TrayManager::closeEvent(QCloseEvent* event) {
152152}
153153
154154void TrayManager::createActions () {
155+ auto toTop = [](QDialog* window) {
156+ window->show (); // display the window
157+ window->raise (); // bring to the top (mac)
158+ window->activateWindow (); // alternate bring to the top (windows)
159+ };
160+
155161 quitAction = new QAction (tr (" Quit" ), this );
156162 connect (quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
157163
158164 showSettingsAction = new QAction (tr (" Settings" ), this );
159- connect (showSettingsAction, &QAction::triggered, settingsWindow, &QWidget::show );
165+ connect (showSettingsAction, &QAction::triggered, [ this , toTop](){ toTop (settingsWindow);} );
160166
161167 currentOperationMenuAction = new QAction (this );
162168 currentOperationMenuAction->setEnabled (false );
@@ -168,10 +174,10 @@ void TrayManager::createActions() {
168174 connect (captureWindowAction, &QAction::triggered, this , &TrayManager::captureWindowActionTriggered);
169175
170176 showEvidenceManagerAction = new QAction (tr (" View Accumulated Evidence" ), this );
171- connect (showEvidenceManagerAction, &QAction::triggered, evidenceManagerWindow, &QWidget::show );
177+ connect (showEvidenceManagerAction, &QAction::triggered, [ this , toTop](){ toTop (evidenceManagerWindow);} );
172178
173179 showCreditsAction = new QAction (tr (" About" ), this );
174- connect (showCreditsAction, &QAction::triggered, creditsWindow, &QWidget::show );
180+ connect (showCreditsAction, &QAction::triggered, [ this , toTop](){ toTop (creditsWindow);} );
175181
176182 addCodeblockAction = new QAction (tr (" Add Codeblock from Clipboard" ), this );
177183 connect (addCodeblockAction, &QAction::triggered, this , &TrayManager::captureCodeblockActionTriggered);
0 commit comments