Skip to content
Permalink
Browse files

Fix window restore from tray icon under win10 #227

  • Loading branch information...
DamirPorobic committed Oct 28, 2019
1 parent 2f0715d commit 74c5575bde41a4933f90b97c42f5de48fa43a95e
Showing with 13 additions and 1 deletion.
  1. +1 −0 CHANGELOG.md
  2. +1 −0 src/gui/MainWindow.cpp
  3. +8 −1 src/gui/TrayIcon.cpp
  4. +3 −0 src/gui/TrayIcon.h
@@ -33,6 +33,7 @@
* Fixed: ksnip opens anyway with -s option specified. ([#213](https://github.com/DamirPorobic/ksnip/issues/213))
* Fixed: Open Image with full size window doesn't resize main window. ([#194](https://github.com/DamirPorobic/ksnip/issues/194))
* Fixed: Can't work correctly when using scaled display. ([#174](https://github.com/DamirPorobic/ksnip/issues/174))
* Fixed: Not able to restore window from tray under Windows 10. ([#227](https://github.com/DamirPorobic/ksnip/issues/227))
* Fixed kImageAnnotator: Unable to select number annotation when clicking on the number without background. ([#46](https://github.com/DamirPorobic/kImageAnnotator/issues/46))
* Fixed kImageAnnotator: Ctrl Modifier stuck on second or third screenshot with Ctrl-N. ([#58](https://github.com/DamirPorobic/kImageAnnotator/issues/58))
* Fixed kImageAnnotator: Undo/Redo is now disabled during crop and scale operation. ([#56](https://github.com/DamirPorobic/kImageAnnotator/issues/56))
@@ -176,6 +176,7 @@ void MainWindow::show()
activateWindow();
raise();
QWidget::show();
setWindowState(Qt::WindowActive);
}


@@ -25,7 +25,7 @@ TrayIcon::TrayIcon(QObject *parent) : QSystemTrayIcon(parent)

mShowEditorAction = new QAction(tr("Show Editor"), this);
connect(mShowEditorAction, &QAction::triggered, this, &TrayIcon::showEditorTriggered);
connect(this, &TrayIcon::activated, this, &TrayIcon::showEditorTriggered);
connect(this, &QSystemTrayIcon::activated, this, &TrayIcon::activated);
}

void TrayIcon::setupMenu()
@@ -101,3 +101,10 @@ void TrayIcon::showCriticalToast(const QString &title, const QString &message)
{
showMessage(title, message, QSystemTrayIcon::Critical);
}

void TrayIcon::activated(ActivationReason reason) const
{
if(reason != ActivationReason::Context) {
emit showEditorTriggered();
}
}
@@ -56,6 +56,9 @@ Q_OBJECT
QAction *mQuitAction;

void setupMenu();

private slots:
void activated(ActivationReason reason) const;
};

#endif //KSNIP_TRAYICON_H

0 comments on commit 74c5575

Please sign in to comment.
You can’t perform that action at this time.