Skip to content

Commit

Permalink
Implement platform-dependent exit hotkey (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
data-man committed Jun 5, 2023
1 parent 8963bb3 commit fbf6ecc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/NotepadNext/dialogs/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ MainWindow::MainWindow(NotepadNextApplication *app) :
connect(ui->actionCloseAll, &QAction::triggered, this, &MainWindow::closeAllFiles);
connect(ui->actionExit, &QAction::triggered, this, &MainWindow::close);

#ifdef Q_OS_WIN
ui->actionExit->setShortcut(QKeySequence("Alt+F4"));
#else
ui->actionExit->setShortcut(QKeySequence::Quit);
#endif

connect(ui->actionOpenFolderasWorkspace, &QAction::triggered, this, &MainWindow::openFolderAsWorkspaceDialog);

connect(ui->actionCloseAllExceptActive, &QAction::triggered, this, &MainWindow::closeAllExceptActive);
Expand Down
3 changes: 0 additions & 3 deletions src/NotepadNext/dialogs/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,6 @@
<property name="text">
<string>E&amp;xit</string>
</property>
<property name="shortcut">
<string>Alt+F4</string>
</property>
<property name="menuRole">
<enum>QAction::QuitRole</enum>
</property>
Expand Down

0 comments on commit fbf6ecc

Please sign in to comment.