mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-01 09:22:58 -05:00
Make Ctrl+Q quit the application on Linux and Windows
Quit was only bound to Cmd+Q on macOS. Add a Quit entry to the shortcut registry bound to Ctrl+Q and handle it in the global key handler, so the shortcut reaches the app regardless of focus. The File menu shows it as display text. The macOS-only key check is removed; Cmd+Q now goes through the registry.
This commit is contained in:
1 parent
1abb2a0fd9
commit
857896dc6b
4 files changed
+7
-3
No files matched your search
@@ -801,7 +801,6 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
||||
this->Iconize();
|
||||
return;
|
||||
}
|
||||
if (evt.CmdDown() && evt.GetKeyCode() == 'Q') { wxPostEvent(this, wxCloseEvent(wxEVT_CLOSE_WINDOW)); return;}
|
||||
if (evt.CmdDown() && evt.RawControlDown() && evt.GetKeyCode() == 'F') {
|
||||
EnableFullScreenView(true);
|
||||
if (IsFullScreen()) {
|
||||
@@ -901,6 +900,9 @@ bool MainFrame::handle_global_shortcut(const KeyChord& chord)
|
||||
if (can_export_model())
|
||||
publish_project();
|
||||
break;
|
||||
case Shortcut::Quit:
|
||||
Close(false);
|
||||
break;
|
||||
case Shortcut::ShowLabels:
|
||||
if (m_plater && m_plater->is_view3D_shown()) {
|
||||
m_plater->show_view3D_labels(!m_plater->are_view3D_labels_shown());
|
||||
@@ -3116,7 +3118,7 @@ void MainFrame::init_menubar_as_editor()
|
||||
fileMenu->AppendSeparator();
|
||||
|
||||
#ifndef __APPLE__
|
||||
append_menu_item(fileMenu, wxID_EXIT, _L("Quit"), wxString::Format(_L("Quit")),
|
||||
append_shortcut_item(fileMenu, Shortcut::Quit, false, _L("Quit"), wxString::Format(_L("Quit")),
|
||||
[this](wxCommandEvent&) { Close(false); }, "menu_exit", nullptr);
|
||||
#else
|
||||
append_menu_item(fileMenu, wxID_EXIT, _L("Quit"), wxString::Format(_L("Quit")),
|
||||
|
||||
Reference in new issue
Block a user